Xen-based VPS ubuntu + nginx + php installation tutorial

Source: Internet
Author: User
Tags mysql tutorial php tutorial vps squid proxy

Because the system performance requirements are very low, we chose link-1, GB hard drive, 64 m memory, GB traffic, and 1 independent ip address.
You can use the discount code 9dmm7r to enjoy a 10% discount. The vps tutorial is link.com. Of course, you can also find a discount code for a larger discount, but generally only within 3 months.
Install OS in the vpslink background, select ubuntu9.04, one minute later the system is installed, and log on to the root through ssh.
Job 1: configure the web server
To debug the program, the web server that supports the php Tutorial still needs. Because the memory is too small, apache has been abandoned. nginx is used instead and php is supported through fast-cgi. Vpslink provides the ubuntu source image.
(1) install nginx and php in one step

Apt-get install nginx php5-cli php5-cgi php5-mysql tutorial

(2) because spawn-fcgi is required to start fast-cgi, install lighttpd and set it to not start upon startup.

Apt-get install lighttpd

(3) configure fast-cgi

Create a php-cgi service file under/etc/init. d/. For simplicity, you can directly copy nginx to modify it.

Cp nginx php-cgi

Vi php-cgi, modify the corresponding parameters

Daemon =/usr/bin/spawn-fcgi
Daemon_opts = "-a 127.0.0.1-p 9000-c 10-u www-data-f/usr/bin/php-cgi"

Modify the stop action to pkill-9 php-cgi.

Save and exit.

(4) Configure nginx and enable php support

Vi/etc/nginx/sites-available/default

Add index. php to index, and uncomment related php parts. Note that you need to modify the fastcgi_param path.

Location ~ . Php $ {
Fastcgi_pass 127.0.0.1: 9000;
Fastcgi_index index. php;
Fastcgi_param script_filename/var/www/nginx-default $ fastcgi_script_name;
Include/etc/nginx/fastcgi_params;
}

(5) start the service

/Etc/init. d/php-cgi start

/Etc/init. d/nginx start

The web server is configured.

Work 2: configure the squid proxy server

This is the main purpose, or you do not need to select xen vps. Next.

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.