. Find apache % C5 % E4 % D6 % C3/"target =" _ blank "> apache configuration file: httpd. conf.
For apache configuration files, different linux hosts may be placed in different places, especially for those compiling and installing environments.
For example, the location is more unfixed. The ITLee environment is installed using yum. For linux, centos5.6,
After the installation is complete, httpd. conf is in the/etc/httpd/conf/Directory. For your reference, find your own apache configuration.
Set files.
2. Modify the configuration file and add a VM
Use vim to open the configuration file and find the following configuration information:
The code is as follows: |
Copy code |
# <VirtualHost *: 80> # ServerAdmin webmaster@dummy-host.example.com # DocumentRoot/www/docs/dummy-host.example.com # ServerName dummy-host.example.com # ErrorLog logs/dummy-host.example.com-error_log # CustomLog logs/dummy-host.example.com-access_log common # </VirtualHost> |
The above configuration information is the template provided by apache for adding virtual hosts. You can choose to repair it on the basis of the original
You can also install this template and add it by yourself. Here, ITLee adopts the latter method. We usually follow this section of configuration information
Add the following information at the end of the entire file:
The code is as follows: |
Copy code |
<VirtualHost *: 80> # ServerAdmin webmaster@dummy-host.example.com DocumentRoot/var/www/web/wordpress ServerName www.111cn.net ErrorLog logs/www.111cn.net-error_log CustomLog logs/www.111cn.net-access_log common </VirtualHost> <VirtualHost *: 80> # ServerAdmin webmaster@dummy-host.example.com DocumentRoot/var/www/web/itlee ServerName www.111cn.net ErrorLog logs/www. itlee. Name-error_log CustomLog logs/www. itlee. Name-access_log common </VirtualHost> |
In this way, you can configure the two sites to take up, and restart apache.