ubuntu+nginx+php installation tutorials for VPS based on Xen _nginx

Source: Internet
Author: User
Tags vps squid proxy
Because the system performance requirements are very low, so select the link-1,2.5g hard disk, 64M memory, 100GB traffic, 1 Independent IP.
Use the discount code 9dmm7r can have a 10% discount, vpslink.com. Of course, can also find a larger discount code, but generally limited to 3 months.
Install OS in vpslink background, select ubuntu9.04, one minute after system installed, SSH login root.
Work 1: Configure the Web server
To debug a program, a Web server that supports PHP is still needed. Memory is too small, so abandoned the always Apache, instead of Nginx, and through the fast-cgi to support PHP. Vpslink provides the source image of Ubuntu, the speed is not said.

(1) One-Step, install Nginx and PHP

Apt-get install Nginx php5-cli php5-cgi php5-mysql

(2) because the need to spawn-fcgi to start fast-cgi, so install LIGHTTPD, and set to boot does not start

Apt-get Install LIGHTTPD

(3) Configure fast-cgi

In the/etc/init.d/under the establishment of PHP-CGI service files, simple, you can directly copy Nginx to modify

CP Nginx PHP-CGI

VI php-cgi, modify 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"

When you modify the stop, the action is: pkill-9 php-cgi

Save, exit.

(4) Configure Nginx, open PHP support

Vi/etc/nginx/sites-available/default

Index to add index.php, and the relevant PHP part of the comment cancellation, 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 service

/etc/init.d/php-cgi start

/etc/init.d/nginx start

The Web server is configured.

Job 2: Configure Squid Proxy Server

This is the main purpose, or do not have to deliberately choose Xen vps. I'll talk to you next time.

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.