Nginx 0.7.x PHP 5.2.6(FastCGI)搭建高性能web服务器
作者 佚名技术
来源 Linux系统
浏览
发布时间 2012-05-15
,以及虚拟主机目录 groupadd www -g 48 useradd -u 48 -g www www mkdir -p /var/htdoc/www chmod w /var/htdoc/www chown -R www:www /var/htdoc/www mkdir -p /var/htdoc/mail chmod w /var/htdoc/mail chown -R www:www /var/htdoc/mail #创建php-fpm配置文件 rm -f /usr/local/webserver/php/etc/php-fpm.conf cp /opt/php-fpm.conf /usr/local/webserver/php/etc/ #启动php-cgi进程 ulimit -SHn 51200 /usr/local/webserver/php/sbin/php-fpm start #安装Nginx 0.7.17 #1、安装Nginx所需的pcre库: cd /opt tar zxvf pcre-7.7.tar.gz cd pcre-7.7/ ./configure make && make install cd ../ #2、安装Nginx tar zxvf nginx-0.7.17.tar.gz cd nginx-0.7.17/ ./configure --user=www --group=www --prefix=/usr/local/webserver/nginx --with-http_stub_status_module --with-http_ssl_module make && make install cd ../ #3、创建Nginx日志目录 mkdir -p /var/nginx/logs chmod w /var/nginx/logs chown -R www:www /var/nginx/logs 拥有帝国一切,皆有可能。欢迎访问phome.net#创建Nginx配置文件 rm -f /usr/local/webserver/nginx/conf/nginx.conf cp /opt/nginx.conf /usr/local/webserver/nginx/conf/ #nginx虚拟主机配置实例 server { listen 80; server_name mail.1*****1.com; index index.html index.htm index.php; root /var/htdoc/56guider; #limit_conn crawler 20; location ~ .*.(php|php5)?$ { #fastcgi_pass unix:/tmp/php-cgi.sock; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fcgi.conf; } location ~ .*.(gif|jpg|jpeg|png|bmp|swf)$ { expires 30d; } location ~ .*.(js|css)?$ { expires 1h; } log_format access ''$remote_addr - $remote_user [$time_local] "$request" '' ''$status $body_bytes_sent "$http_referer" '' ''"$http_user_agent" $http_x_forwarded_for''; access_log /var/nginx/logs/56guider/access.log access; } server { listen 80; server_name mail.2*****2.com; index index.html index.htm index.php; root /var/htdoc/chembidworld; #limit_conn crawler 20; location ~ .*.(php|php5)?$ { #fastcgi_pass unix:/tmp/php-cgi.sock; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fcgi.conf; } location ~ .*.(gif|jpg|jpeg|png|bmp|swf)$ { expires 30d; } location ~ .*.(js|css)?$ { expires 1h; } log_format chemlog ''$remote_addr - $remote_user [$time_local] "$request" '' ''$status $body_bytes_sent "$http_referer" '' 拥有帝国一切,皆有可能。欢迎访问phome.net ''"$http_user_agent" $http_x_forwarded_for''; access_log /var/nginx/logs/chembidworld/access.log chemlog; } server { listen 80; server_name 192.168.8.152; location /nginx_status { stub_status on; access_log off; } } cp /opt/fcgi.conf /usr/local/webserver/nginx/conf/ #配置开机自动启动Nginx PHP echo "ulimit -SHn 51200" >> /etc/rc.local echo "/usr/local/webserver/php/sbin/php-fpm start" >> /etc/rc.local echo "/usr/local/webserver/ngi |
凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢! |
你可能对下面的文章感兴趣
关于Nginx 0.7.x PHP 5.2.6(FastCGI)搭建高性能web服务器的所有评论