Configure a Ubuntu server (VPS)

Source: Internet
Author: User
Tags vps
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;
}

Related Article

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.