Install high-performance nginx notes on Ubuntu8.04

Source: Internet
Author: User
Recently, one of our customers asked to install a high-performance nginx on Ubuntu8.04VPS. below is my installation record. Ubuntu already contains nginx, so do not compile it. It is very easy to install! Modify the/etc/apt/sources. list file on VPS to debhttp: // ubuntu.cn99.com/ubuntuhardymainrestricteduniversemult.

Recently, one of our customers asked to install a high-performance nginx on his Ubuntu 8.04 VPS. below is my installation record.

Ubuntu 804 already contains nginx, so do not compile it at all. The installation is very simple!

Modify the/etc/apt/sources. list file on VPS as follows:
Deb http://ubuntu.cn99.com/ubuntu hard main restricted universe multiverse
Deb http://ubuntu.cn99.com/ubuntu hard-security main restricted universe multiverse
Deb http://ubuntu.cn99.com/ubuntu hard-updates main restricted universe multiverse

Then run:
Apt-get update
Apt-get install nginx

You can complete the installation.

Start nginx:
/Etc/init. d/nginx start

Then you can access http: // 58.30.17.160/. Everything works!

Configure php and mysql below.

Install php and MySQL:
Apt-get install php5-cli php5-cgi mysql-server-5.0 php5-mysql

We need the/usr/bin/spawn-fcgi file, which belongs to the lighttpd package. Therefore, we need to install lighttpd and set it to disabled upon startup:

Apt-get install lighttpd # We only need/usr/bin/spawn-fcgi
Rcconf # Remove lighttpd from startup

Modify the nginx configuration file:/etc/nginx/sites-available/default
Modify the row of index:
Index. php index.html index.htm;

Remove the following comments:
Location ~ \. Php $ {
Fastcgi_pass 127.0.0.1: 9000;
Fastcgi_index index. php;
Fastcgi_param SCRIPT_FILENAME/var/www/nginx-default $ fastcgi_script_name;
}

Restart nginx:
/Etc/init. d/nginx stop
/Etc/init. d/nginx start

Start fastcgi php:
Spawn-fcgi-a 127.0.0.1-p 9000-C 10-u www-data-f/usr/bin/php-cgi

Create an object in the/var/www/nginx-default/directory:
Echo "">/var/www/nginx-default/index. php

Then the browser accesses nginx and you can see that everything is normal.

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.