Ubuntu 12.04 apache2 virtual machine host

Main reference links:

Chinese

http://www.cnblogs.com/sunormoon/archive/2012/02/10/2345326.html

English

https://www.digitalocean.com/community/articles/how-to-set-up-apache-virtual-hosts-on-ubuntu-12-04-lts

 

The summary steps are as follows:

1. Open the directory /etc/apache2/site-available.

2. Copy the default file and rename it to your virtual server name. The key step, if the name is inconsistent, may not be found when it is activated.

3. Modify the DocumentRoot address to be your virtual service directory name and set access permissions.

4. Modify the service name to the virtual server name.

5. Activate the virtual server configuration.

6. Restart the apache server.

7. If you are testing locally, add the ip address of the virtual service name to the hosts file. So that the machine can correctly resolve the domain name.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327096437&siteId=291194637