Home >Operation and Maintenance >Apache >How to set up apache virtual directory
The specific method is as follows:
1. Open the "virtual directory configuration file" httpd-vhosts.conf
File path: \wamp\bin\ apache\apache2.4.9\conf\extra\httpd-vhosts.conf
Change the following configuration:
# Virtual hosts # Include conf/extra/httpd-vhosts.conf
to:
# Virtual hosts Include conf/extra/httpd-vhosts.conf
2, Set the virtual directory to be accessible
File path:\wamp\bin\apache\apache2.4.9\conf\extra\httpd-vhosts.conf
Configure the following:
<Directory /> AllowOverride none Require all denied </Directory>
is changed to:
<Directory /> AllowOverride none </Directory>
3. Add virtual directory
File path: \wamp\bin\apache\apache2.4.9\conf\extra\httpd-vhosts. conf
Add virtual directory
<VirtualHost *:80> ServerAdmin webmaster@web.shop.com DocumentRoot "D:/_HelloWorld/01_MyProjects/06_PHP/01_Web/Product/Source/Shop" ServerName web.shop.com ErrorLog "logs/web.shop.com-error.log" CustomLog "logs/web.shop.com-access.log" common </VirtualHost>
4. Restart apache
Complete!
Recommended tutorial: apache from entry to proficiency
The above is the detailed content of How to set up apache virtual directory. For more information, please follow other related articles on the PHP Chinese website!