Configuration method for placing multiple sites on the Apache server

Source: Internet
Author: User

. 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.

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.