Create a dynamic virtual host configuration

Source: Internet
Author: User

In a development project, it is often the use of SVN to control the version, and it is natural to adopt the trunk branch for security.

Think of the way we can use a configuration domain name in a project?

This is explained below:

My project is called demo inside there are two files trunk (trunk)/branches (branch) host:127.0.0.1 Trunk.demo.dev. Own domain Name

<virtualhost *:80>
DocumentRoot "C:/wamp/www/demo/trunk/public"
ServerName Trunk.demo.dev. Own domain Name
setenv Application_env Dev
Adddefaultcharset UTF-8
</VirtualHost>

<virtualhost *:80>
Serveralias *(1). Demo.dev. Own domain Name
setenv Application_env Dev
Adddefaultcharset UTF-8
Usecanonicalname OFF
Virtualdocumentroot "c:/wamp/www/demo/%1/%2(2)/public"
</VirtualHost>

To the above (1) Explanation: Serveralias pan domain name * after the "Demo.dev. Own domain name" This domain is a fixed domain name

To the above (2) explanation: such as input branches.master.demo.dev. own domain name =>virtualdocumentroot "c:/wamp/www/demo/branches/master/ Public to generate the path dynamically.

Reference: Http://www.jinbuguo.com/apache/menu22/mod/mod_vhost_alias.html#page-header

Create a dynamic virtual host configuration

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.