Overview
Setting up the Apache virtual directory
1. Turn on the "virtual directory configuration file" httpd-vhosts.conf
File path: \wamp\bin\apache\apache2.4.9\conf\extra\httpd-vhosts.conf
Configure the following:
[PHP]View Plaincopy
- # Virtual Hosts
- # Include Conf/extra/httpd-vhosts.conf
Switch
[PHP]View Plaincopy
- # Virtual Hosts
- Include conf/extra/httpd-vhosts.conf
2. Set the virtual directory to access
File path: \wamp\bin\apache\apache2.4.9\conf\extra\httpd-vhosts.conf
Configure the following:
[PHP]View Plaincopy
- <directory/>
- allowoverride None
- Require all denied
- </Directory>
Switch
[PHP]View Plaincopy
- <directory/>
- allowoverride None
- </Directory>
3. Add a virtual directory
File path: \wamp\bin\apache\apache2.4.9\conf\extra\httpd-vhosts.conf
Add a virtual directory
[PHP]View Plaincopy
- <virtualhost *:80>
- ServerAdmin [email protected]
- 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
5. Enter web.shop.com in the browser
"PHP Programming Path-1" setting Apache virtual directory