nginx0.6.34+php-5.27 fastcgi 安装



hqlong@ubuntu:~/software/tar.gz$ tar zxvf mysql-5.0.67.tar.gz 
hqlong@ubuntu:~/software/tar.gz$ cd mysql-5.0.67/
hqlong@ubuntu:~/software/tar.gz/mysql-5.0.67$ ./configure \
--prefix=/usr/local/webserver/mysql/ \
--without-debug \
--with-unix-socket-path=/tmp/mysql.sock \
--with-client-ldflags=-all-static \
--with-mysqld-ldflags=-all-static --enable-assembler \
--with-extra-charsets=gbk,gb2312,utf8 \
--with-pthread \
hqlong@ubuntu:~/software/tar.gz/mysql-5.0.67$ make && sudo make install
hqlong@ubuntu:~/software/tar.gz/mysql-5.0.67$ sudo chmod +w /usr/local/webserver/mysql
hqlong@ubuntu:~/software/tar.gz/mysql-5.0.67$ sudo chown -R mysql:mysql /usr/local/webserver/mysql
hqlong@ubuntu:~/software/tar.gz/mysql-5.0.67$ cp support-files/my-medium.cnf /usr/local/webserver/mysql/my.cnf


hqlong@ubuntu:/usr/local/webserver/mysql/bin$ sudo ./mysql_install_db \
--defaults-file=/usr/local/webserver/mysql/my.cnf \
--basedir=/usr/local/webserver/mysql \
--datadir=/usr/local/webserver/mysql/data \
--user=mysql \
--pid-file=/usr/local/webserver/mysql/ \
--skip-locking --port=3306 \


hqlong@ubuntu:~/software/tar.gz/php-5.2.7$ ./configure \
--prefix=/usr/local/webserver/php \
--with-config-file-path=/usr/local/webserver/php/etc \
--with-mysql=/usr/local/webserver/mysql \
--with-pdo-mysql=/usr/local/webserver/mysql \
--with-gd --with-jpeg-dir=/usr \
--with-png-dir=/usr \
--enable-safe-mode \
--enable-fastcgi \
hqlong@ubuntu:~/software/tar.gz/php-5.2.7$ make && sudo make install


groupadd www -g 48
useradd -g 48 www

安装 Linghttpd’s spawn-fcgi用 Lighttpd 的 spawn-fcgi 来管理 PHP FastCGI 进程。

tar zxvf lighttpd-1.4.20.tar.bz2
cd lighttpd-1.4.20
./configure --without-bzip2
cp -a src/spawn-fcgi /usr/local/php-fcgi/bin/


sudo ./spawn-fcgi -a -p 10080 -C 64 -u www -f /usr/local/webserver/php/bin/php-cgi


tar zxvf nginx-0.6.34.tar.gz
cd nginx-0.6.34/
./configure --user=www --group=www --prefix=/usr/local/webserver/nginx --with-http_stub_status_module
make && make install
cd ../


rm -f /usr/local/webserver/nginx/conf/nginx.conf
vi /usr/local/webserver/nginx/conf/nginx.conf


user www www;
worker_processes 1;

#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;

#pid logs/;

events {
use epoll;
worker_connections 1024;

http {
include mime.types;
default_type application/octet-stream;

#log_format main ‘$remote_addr – $remote_user [$time_local] $request ‘
# ‘”$status” $body_bytes_sent “$http_referer” ‘
# ‘”$http_user_agent” “$http_x_forwarded_for”‘;

#access_log logs/access.log main;

sendfile on;
#tcp_nopush on;

#keepalive_timeout 0;
keepalive_timeout 65;

#gzip on;

server {
listen 80;
server_name localhost;
index index.html index.htm index.php;
root html;

#charset koi8-r;

#access_log logs/host.access.log main;

location ~ .*\.(php|php5)?$
fastcgi_index index.php;
include fcgi.conf;

#error_page 404 /404.html;

# redirect server error pages to the static page /50x.html
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;

# proxy the PHP scripts to Apache listening on
#location ~ \.php$ {
# proxy_pass;

# pass the PHP scripts to FastCGI server listening on
#location ~ \.php$ {
# root html;
# fastcgi_pass;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;

# deny access to .htaccess files, if Apache’s document root
# concurs with nginx’s one
#location ~ /\.ht {
# deny all;

# another virtual host using mix of IP-, name-, and port-based configuration
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias;

# location / {
# root html;
# index index.html index.htm;
# }

# HTTPS server
#server {
# listen 443;
# server_name localhost;

# ssl on;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;

# ssl_session_timeout 5m;

# ssl_protocols SSLv2 SSLv3 TLSv1;
# ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
# ssl_prefer_server_ciphers on;

# location / {
# root html;
# index index.html index.htm;
# }



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;
fastcgi_param SERVER_NAME $server_name;

# PHP only, required if PHP was built with –enable-force-cgi-redirect
#fastcgi_param REDIRECT_STATUS 200;


ulimit -SHn 51200


sudo sh "ulimit -SHN 51200"


sudo vim  /etc/rc.local


/usr/local/webserver/mysql/bin/mysqld_safe --user=mysql &
ulimit -SHn 51200

机器人 2008-12-7 23:29 于 北京

此条目发表在 linux/server 分类目录,贴了 , , , , 标签。将固定链接加入收藏夹。

nginx0.6.34+php-5.27 fastcgi 安装》有 28 条评论

  1. 小黑米 说:

    ulimit -SHn 51200


  2. 机器人 说:


  3. 小黑米 说:

    偶一直没敢设置这个 不大懂什么意思

  4. 机器人 说:


  5. 机器人 说:


  6. effemnada 说:

    yo, great name for site)))

  7. hqlong 说:

    my nickname is hqlong!!thank you!

  8. tommy 说:

    Ccr2gm gIcbEw9n3n6JdaL72z0Fu

  9. Sherly Rusell 说:

    I really enjoyed your writing. The topic is one I have been trying to get info on.

  10. The next time I read a blog, I hope that it doesnt disappoint me as much as this one. I mean, I do know it was my option to read, however I truly thought youd have something interesting to say. All I hear is a bunch of whining about something that you possibly can repair for those who werent too busy on the lookout for attention.

  11. It is legitimate happiness to study you blog!

  12. Pingback 引用通告: St Albans Van Rentals

  13. Pingback 引用通告: supplements for better memory

  14. buy steroids 说:

    interesting article but I’m not sure if the author is correct here.want ot learn about our website you should visit our website we are the top leader in the interest industry of online information and planning of ph@rma stuff, go to us

  15. 崔舍保食 说:





    杭州东方魅力官方网站欢迎你 联系电话:13666653761 官方微信:dongfangmeili

  16. Fausto Dubre 说:

    I like to have letters with U.S. commemorative stamps on them; I collect these. How are your letters stampedor are they metered (yech)?

  17. Pingback 引用通告: szkło bezpieczne piotrków

  18. Pingback 引用通告: best halloween creative ideas and horror artwork

  19. Pingback 引用通告: This is why this video will make you like Indie Euro Rock again!

  20. Pingback 引用通告: ingray band music videos live

  21. Pingback 引用通告: wordpress visual builder

  22. Pingback 引用通告: convert animated gif to video free


电子邮件地址不会被公开。 必填项已用*标注

您可以使用这些HTML标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>