Chinaunix首页 | 论坛 | 博客
  • 博客访问: 91702
  • 博文数量: 6
  • 博客积分: 1477
  • 博客等级: 上尉
  • 技术积分: 90
  • 用 户 组: 普通用户
  • 注册时间: 2008-10-30 13:31
文章分类

全部博文(6)

文章存档

2009年(1)

2008年(5)

我的朋友
最近访客

分类: 系统运维

2008-11-04 14:34:37

1.编译nginx和php,编译之前先装好php相关的包
cd /usr/local/src/nginx
./configure --prefix=/usr/local/nginx \
--with-http_perl_module \
--with-http_gzip_static_module \
--with-http_stub_status_module \
--with-poll_module \
--with-pcre=/home/webroot/pcre-7.6 \
--with-zlib=/home/webroot/zlib-1.2.3
 
cd /usr/local/src/php
./configure --prefix=/usr/local/php-fcgi \
--with-mysql=/usr/local/mysql \
--with-iconv-dir \
--with-freetype-dir \
--with-jpeg-dir=/usr/lcoal/jpeg6 \
--with-png-dir \
--with-zlib \
--with-libxml-dir \
--enable-xml \
--disable-debug \
--disable-rpath \
--enable-discard-path \
--enable-safe-mode \
--enable-bcmath \
--enable-shmop \
--enable-sysvsem \
--enable-inline-optimization \
--with-curl \
--with-curlwrappers \
--enable-mbregex \
--enable-fastcgi \
--enable-force-cgi-redirect \
--enable-mbstring
2.借用lighttpd的spawn-fcgi启动php-cgi进程,监听127.0.0.1的9000端口,
进程数为64(如果服务器内存小于3GB,可以只开启25个进程),用户为nobody:
/usr/local/php-fcgi/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -C 64 -u nobody -f /usr/local/php-fcgi/bin/php-cgi
3.配置nginx.conf

 server {
        listen       81;
        server_name  abc.com;
        root /usr/local/htdocs;
        index  index.html index.htm index.php;
        location ~ \.php$ {
            root           /usr/local/htdocs;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  /usr/local/htdocs/$fastcgi_script_name;
            include        fastcgi_params;
        }
}
阅读(2591) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~