Apache configuration multisite, Apache configuration site
In the httpd.conf file, the following configuration is available (note: The comment content of the httpd.conf file is removed)
Listen 80ServerName localhost
allowoverride None Require all Denieddocumentroot "E:"
Options Indexes followsymlinks allowoverride None Require all granted
(It is best to clean up the browser cache before testing), then enter http://localhost/Workshop/Apache/in the browser to access all the files under E:/workshop/apache, note that the root directory here is e:, However, the above directory has permissions so that it cannot access all the contents of the E-drive, if the above directoy is changed to:
Options Indexes followsymlinks allowoverride None Require all granted
Then you can access everything in the E-drive from the browser, when you enter localhost in the browser, the browser will display all the contents of the E-packing directory, and can be accessed. For the sake of security, we do not usually do so, so the usual Setup method is the following configuration:
Listen 80ServerName localhost
allowoverride None Require all Denieddocumentroot "e:/workshop/ Apache "
Options Indexes followsymlinks allowoverride None Require all granted
The browser only allows access to a specific directory, which is all content in the E:/workshop/apache directory. Of course for the second dir, you can set access permissions for different folders under E:/workshop/apache.
Finally, for the settings of the virtual host, please follow the following format (placed at the end of the httpd.conf file):
As shown below, the listening port needs to be set first, followed by the Namevirtualhost specified host address and port, followed by VirtualHost settings, including Severname, which is the host name and the document root, note that for local development, Set servername to localhost or 127.0.0.1, where the document root directory is the same as the directory settings, or you can set different access permissions for different folders in the document root directory. The X number represents the virtual host that listens on all access settings ports.
Listen 81NameVirtualHost *:81
ServerName 127.0.0.1 documentroot "c:/users/administrator/php/ Webroot1 "
Options Indexes followsymlinks allowoverride None Require all granted
Listen 82namevirtualhostx:82
ServerName 127.0.0.1 documentroot "c:/users/administrator/php/ Webroot2 "
Options Indexes followsymlinks allowoverride None Require all granted
http://www.bkjia.com/PHPjc/1004399.html www.bkjia.com true http://www.bkjia.com/PHPjc/1004399.html techarticle Apache Configuration Multi-site, Apache configuration site in the httpd.conf file, the following configuration (note: To remove the httpd.conf file comment content) Listen 80ServerName localhostdirectory/ Allowo ...