Ubuntu8.04 quickly build the nginx + php System

Source: Internet
Author: User
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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.