中小企业web服务器的的负载均衡集群方案设计+脚本代码(19)
时间:2018-11-20 09:25 来源:毕业论文 作者:毕业论文 点击:次
#vim !$ 修改如下行 prefix=/usr/local/php4nginx exec_prefix=${prefix} php_fpm_BIN=${exec_prefix}/sbin/php-fpm php_fpm_CONF=${prefix}/etc/php-fpm.conf php_fpm_PID=${prefix}/var/run/php-fpm.pid #chmod +x /etc/rc.d/init.d/php-fpm 接下来就可以使用service管理服务了 4.#service php-fpm start 使用如下命令来验证(如果此命令输出有中几个php-fpm进程就说明启动成功了): #ps aux | grep php-fpm (e)整合nginx和php5.3.10 1.编辑/etc/nginx/nginx.conf,启用如下选项: location ~ \.php$ { root html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; include fastcgi_params; } 2.编辑/etc/nginx/fastcgi_params,将其内容更改为如下内容: #vim /etc/nginx/fastcgi_params fastcgi_param GATEWAY_INTERFACE CGI/1.1; fastcgi_param SERVER_SOFTWARE nginx; fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_NAME $fastcgi_script_name; fastcgi_param REQUEST_URI $request_uri; fastcgi_param DOCUMENT_URI $document_uri; fastcgi_param DOCUMENT_ROOT $document_root; fastcgi_param SERVER_PROTOCOL $server_protocol; fastcgi_param REMOTE_ADDR $remote_addr; fastcgi_param REMOTE_PORT $remote_port; fastcgi_param SERVER_ADDR $server_addr; fastcgi_param SERVER_PORT $server_port; 3.并在所支持的主页面格式中添加php格式的主页,类似如下: location / { root html; index index.php index.html index.htm; } (责任编辑:qin) |