Article Title: Ubuntu8.04 quickly build the nginx + php system. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
I played nginx + php in FreeBSD yesterday and went to ubuntu today. First of all, I would like to thank the article "over enough". The following is a change from his article. It is much faster to build on ubuntu than on freebsd, because on freebsd, I installed on ports and needed to be compiled. on ubuntu, I installed on apt-get install directly, which is fast, let's start the installation!
1. Install nginx. Execute the following command and it will be completed soon. However, the default installation version of apg-get is 0.5.33.
Sudo apt-get install nginx
Default Configuration File Installation location:
Conf:/etc/nginx. conf Bin:/usr/sbin/nginx Vhost:/etc/nginx/sites-enable/default Cgi-params:/etc/nginx/fastcgi-params |
For example, create a virtual Server
Server { Listen 80; Server_name www.23day.com; Access_log/var/log/nginx/home. ucenter. access. log;
Location /{ Root/var/www/23day.com; Index. php;
Location ~ \. Php $ { Fastcgi_pass 127.0.0.1: 9000; Fastcgi_index index. php; Fastcgi_param SCRIPT_FILENAME/var/www/23day.com $ fastcgi_script_name; Include/etc/nginx/fastcgi_params; } } |
2. Install the php-cgi Module.
Execute sudo apt-get install php5-cgi
Default Configuration File Installation location:
Php-cgi:/usr/bin/php-cgi Php5-cgi:/usr/bin/php5-cgi Cgi config:/usr/bin/cgi/php. ini |
Modify the cgi. fix_pathinfo data of the php. ini file to 1. The default value is 0 cgi. fix_pathinfo = 1. In this way, the SCRIPT_FILENAME variable can be used normally in php-cgi.
[1] [2] Next page