`
haohappy2
  • 浏览: 315730 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论
文章列表
在开源Apache服务器中能不能进行负载均衡设置呢?可以的,那么如何进行呢?本文就将一个实际的站点为例,为大家讲述一下Apache负载均衡的配置。那么具体内容就请来看看文章吧。 下面以在apachemod_proxy下做的反向代理Apache负载均衡为配置实例:在站点www.test.com,我们按提供的内容进行分类,不同的服务器用于提供不同的内容服务,将对http://www.test.com/news的访问转到IP地址为192.168.1.1的内部服务器上处理,对http://www.test.com/it的访问转到服务器192.168.1.2上,对http://www.test.com/ ...
You need: Create split-level menu. The upper string is main items (first level), and sub-menu appears to the left of the selected item. Parent item from main menu items is active when navigation through submenus.   Solution: We need to form one menu creating its structure through selection ...
In this article I would like to share my experience in creating of custom Contact Us form. We will use standard Contact Drupal module as a basis for it.   So, you need to create custom Contact Us form, for example like this: Let’s start! First of all, enable Contact module. It is core Drupal mo ...
一、在drupal建站时遇到的性能问题1.打开网站缓慢2.经常宕机......二、影响drupal网站性能的因素1.服务器负载均衡2.网站冗余脚本请求3.网站设置不合理三、drupal性能解决方案 1.Drupal服务器优化 Drupal服务器环境比较理想的还是基于LAMP组合。我们都知道其中apache受带宽的制约,PHP受CPU的制约,mysql受内存的制约。 在网站服务器配置,我们最好能够分析一下网站预计的流量,尽可能的在服务器环境(如cpu,带宽,内存,硬盘...)方面保证资源充足.并且apache,php,mysql数据库都加以优化。如果必要的时候做些数据分离的部署。 2.Dru ...
<?php $cookie_file = dirname(__FILE__).”/cookie_”.md5(basename(__FILE__)).”.txt”; // 设置Cookie文件保存路径及文件名 function vlogin($url,$data){ // 模拟登录获取Cookie函数 $curl = curl_init(); // 启动一个CURL会话 curl_setopt($curl, CURLOPT_URL, $url); // 要访问的地址 curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0); // 对认 ...
示例代码1: 用file_get_contents 以get方式获取内容<?php$url='http://www.baidu.com/';$html=file_get_contents($url);//print_r($http_response_header);ec($html);printhr();printarr($http_response_header);printhr();?>示例代码2: 用fopen打开url, 以get方式获取内容<?$fp=fopen($url,'r');printarr(stream_get_meta_data($fp));printhr ...
PHP中用来获取网页的途径主要有三个:1 file_get_content 这个最简单,也最快,但不能构造http header头信息等2 fscokopen3 使用CURL库, php 利用 curl 登录,并把cookie 值记录在该文件目录下的 .tmp 文件供下面使用; 等登录后,就可以获得网页的信息。curl 的参数可以自己设置(参考文档)。 以下 curl 代码经测试可正常运行,fscokopen 请自己测试,如有误请各位指正留言。 代码如下:   <?php$login_url = 'http://www.xxx.com/login.php';$login_req ...
Drupal 6 的 Mail API 是为 Drupal 模块提供邮件发送服务的。大多数时候,使用 Mail API 需要两个步骤: 1,在你的模块中实现 hook_mail().2,在模块的其它地方,使用 drupal_mail() 函数调用你的 hook_mail() 实现,并进行附加的格式化和发送操作。 在上一节中,我们大体上看了一下 drupal_mail() 函数。现在,我们来仔细分析一下这个函数。在 emailusers_compose_form_submit() 函数中,我们用下列参数调用了 drupal_mail():   drupal_mail( 'emai ...
1抓取网页的内容 fetch2 抓取网页的文本内容 (去除HTML标签) fetchtext3抓取网页的链接,表单 fetchlinks fetchform4 支持代理主机5支持基本的用户名/密码验证6 支持设置 user_agent, referer(来路), cookies 和 header content(头文件)7支持浏览器重定向,并能控制重定向深度8能把网页中的链接扩展成高质量的url(默认)9提交数据并且获取返回值10 支持跟踪HTML框架11支持重定向的时候传递cookies 1获取指定url内容<?php$url = “http://www.youtube.com”;in ...
  <form action="http://ebm.cheetahmail.com/r/regf2" method="post" name="form1"> <input value="6" name="n" type="hidden"> <input value="2068290525" name="aid" type="hidden"> <input val ...
Drupal 6.x 和 5.x 的 HOOK 函数和参数表有很大的差别,所以建议大家多看看 Drupal API手册。后来绕了一大圈发现 Drupal 6.x 的默认模组 (modules) 里面,有一个叫 OpenId 的模组可以实现这个功能。当然,我们的外部身份验证需求通常不唯一的,比如可能是 Discuz! 论坛或者你当前站点的身份验证,制定一个外部身份验证模组正是我们今天的题目解决的问题。 首先我们做开发一个模组的例行工作 exuser.info- (模组信息) name = External authenticatedescription = Allows users to l ...
一个module的基本构成:一个module_name的文件夹,一个module_name.info,一个module_name.module我的开发环境是lamp,所以drupal文件夹是在/var/www/drupal下,也就是说,需要root权限才能修改这个文件夹下的内容。如果在这个目录下直接进行开发,每次都要root权限是相当不实际的……书上给的方法是(使用连接~linux下的连接和win下的连接是完全不同的两个概念哦。)如:ln -s /home/mbutcher/modules/modules_name  /var/www/drupal/sites/all/modules/modul ...
如果想在drupal的用户账号里添加一些自己的内容,就要用到hook_user钩子函数。 例如在wedpage.module中添加一个“创建页面的链接”和一个“发送邮件的form” /*** Implementation of hook_user.** @return array*/function wedpage_user($type, &$edit, &$user, $category = NULL){if ($type == 'view') {$items['wedpage'] = array('value' => l(t('Create your wedding ...
http://orzl.com/static/archive/drupal_modules/f.html http://www.ibm.com/developerworks/cn/web/i-osource5/ http://hellodrupal.info/node/120 http://5d0d.net/2009/05/18/drupal-%E5%9F%BA%E6%9C%AC%E7%AB%99%E7%82%B9%E8%AE%BE%E7%BD%AE/ http://viiiix.com/drupal/showcase-study/509-amazee-2-using-of-the-dr ...
Creating a subtheme is a powerful and flexible way of theming in Drupal. Drupal 6 made implementing subthemes relatively easy to do. There are a few basic concepts to understand before starting, but once underway, creating a subtheme is a simple straightforward process. In this post, I'll outline the ...
Global site tag (gtag.js) - Google Analytics