Linux: deploy apache configurations for multiple projects on an apache server.

Source: Internet
Author: User

Linux: deploy apache configurations for multiple projects on an apache server.

Step 1:

Get the code to the/var/www/html directory (this is the default directory, depending on apache settings). Multiple projects can be stored in this directory, for example:

[Root @ www html] # pwd
/Var/www/html
[Root @ www html] # ls
Bossmail.cn bossq.cn oem ydj.org yzhantong

Step 2:

Vim/usr/local/apache/conf/extra/httpd-vhosts.conf

<VirtualHost *: 80>
DocumentRoot "/var/www/html/bossq.cn"
ServerName test.bossq.cn
ServerAlias bqapi.bossq.cn
</VirtualHost>

<VirtualHost *: 80>
DocumentRoot "/var/www/html/ydj.org"
ServerName ydj.org
ServerAlias www.ydj.org
ErrorLog "logs/ydj.org-error_log"
CustomLog "logs/ydj.org-access_log" common
</VirtualHost>

<VirtualHost *: 80>
DocumentRoot "/var/www/html/oem"
ServerName yzt241.com
ServerAlias www.yzt241.com
ErrorLog "log/oem-error_log"
CustomLog "logs/oem-access_log" common
</VirtualHost>

<VirtualHost *: 80>
DocumentRoot "/var/www/html/yzhantong"
ServerName cnh.cn
ServerAlias www.cnh.cn
ErrorLog "logs/cnh.cn-error_log"
CustomLog "logs/cnh.cn-access_log" common
</VirtualHost>

<VirtualHost *: 80>
DocumentRoot "/var/www/html/bossmail.cn"
ServerName bossmail.cn
ServerAlias test.bossmail.cn
ErrorLog "logs/cnh.cn-error_log"
CustomLog "logs/cnh.cn-access_log" common
</VirtualHost>

Step 3:

Add resolution to the hosts file on the local computer, for example:

192.168.148.18 test.bossmail.cn

 

Open the browser and enter test.bossmail.cn or bossmail.cn to access

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.