Xen based VPS ubuntu+nginx+php installation tutorial
- 2020-05-06 12:14:17
- OfStack
You can get a 10% discount with the coupon code 9DMM7R, vpslink.com. Of course, you can also find more discount discount code, but generally only within 3 months.
Install os in vpslink background, select ubuntu9.04, the system is installed in a minute, ssh login root.
job 1: configure web server
An web server that supports php is still needed to debug the program. The memory is too small so apache has been abandoned, nginx, fast-cgi support php. vpslink provides a source mirror for ubuntu, which is just as fast.
(1) in one step, install nginx and php
apt-get install nginx php5-cli php5-cgi php5-mysql
(2) since spawn-fcgi is required to start fast-cgi, lighttpd is installed and set to not start
on startupapt-get install lighttpd
(3) the configuration fast - cgi
Create the php-cgi service file under /etc/ init.d /. For simplicity, you can directly modify
by copy nginxcp nginx php-cgi
vi php-cgi, modify the corresponding parameter
DAEMON=/usr/bin/spawn-fcgi
DAEMON_OPTS= "-a 127.0.0.1-p 9000-C 10-u com-f /usr/bin/ php-cgi"
The action when modifying stop is: pkill-9 php-cgi
Save and exit.
(4) configure nginx, open php to support
vi /etc/nginx/sites-available/default
Add index.php to index and cancel the comments on php. Note that the fastcgi_param path
needs to be modified
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 you don't have to choose Xen vps. Next time.