It is often necessary to configure multiple sites at development time and to switch frequently.
The previous practice was often to include all of the configuration files in the httpd.conf, without needing to comment, for example
Include Conf/translate.conf#include Conf/addons.confinclude conf/spider.conf
This will need to locate the httpd.conf directory, then use the editor to open, modify, and then save, more trouble.
Another option is to include all the configuration files in the httpd.conf.
Include conf/*.conf
It is also troublesome to rename the unwanted configuration file.
in fact, Apache provides a convenient tool, which is a2ensite and a2dissite, they're all in the Apache2-common bag.
A2ensite can activate the sites-available in the Apache folder that contains the configuration file, A2dissite the opposite.
1. Go to the Sites-available folder and create a new file, such as spider.conf.
ServerName ci.hfahe.cn documentroot/data/html/ci.hfahe.cn directoryindex index.php
run A2ensite, you can see that it gives the choice, these choices are all the files under Sites-available, enter the required file name to activate the site.
After running, see that it gives a hint, need reload Apache to make the configuration take effect. You can also use the Apache2ctl graceful/restart command.
To the Sites-enables directory, you can see that this folder has just activated the site configuration file of the symbolic link, this is the A2ensite, A2dissite control the principle of the site.
The principle and operation of A2dissite is similar to that of A2ensite, which is not described in detail here.
With A2dissite and A2ensite, we can quickly activate/block sites and accelerate development and deployment efficiencies.
The above describes the Apache use A2ensite and a2dissite to quickly switch sites, including aspects of the content, I hope that the PHP tutorial interested in a friend helpful.