Configure a Ubuntu server (VPS) 1, install basic services apache + php + mysql1. install sudoapt-getinstallapache2sudoapt-getinstallphp5sudoapt-getinstalllibapache2-mod-php5sudoapt-getinstallmysql-serversudoapt-get in turn
Configure a Ubuntu server (VPS)
1. Install basic services apache + php + mysql
1. Install
Sudo apt-get install apache2
Sudo apt-get install php5
Sudo apt-get install libapache2-mod-php5
Sudo apt-get installmysql-server
Sudo apt-get php5-mysql
Sudo apt-get php5-gd
2. After the installation is complete, enter http: // 127.0.0.1 or the Server IP address in the browser. If it's works appears, apache is successfully installed.
3. Create the phpinfo. php file under/var/www,
Sudo nano/var/www/phpinfo. php
Add the following content to the file and save it.
Phpinfo ();
?>
Press CTRL + X to save the dialog. Enter Y to save the dialog.
3. Enter http: // your ip address/phpinfo. php in the browser. Test whether your PHP installation is successful.
If the phpinfo page cannot or is not displayed, open the file/etc/apache2/httpd. conf as an administrator,
Sudo nano/etc/apache2/httpd. conf
Add and save the following two lines to the file:
AddType application/x-httpd-php. php
AddType application/x-httpd-php-source. phps
The purpose is to enable Apache to support the PHP file, and then execute the command/etc/init. d/apache2 restart in the terminal to restart Apache.
4. Add the MySQL command to change the user password:
Set password for root @ localhost = password ('20140901 ');
5. Change the listening port to 81.
Sudo nano/etc/apache2/ports. conf
Change 80 to 81
Nano/etc/apache2/sites-available/default
Change 80 to 81.
Install nginx for now
Sudo apt-get install nginx
Jump
Nano/etc/nginx/sites-available/default
Join
If ($ host! = 'Www .4899.com '){
Rewrite ^/(. *) $ http://www.linuxidc.com/permanent;
}