Configure the virtual domain environment under wamp

1. First, WAMP directory to find httpd.conf file in a specific directory \ bin \ apache \ apache2.4.9 \ conf

2. Then copy the following line to the bottom of the file

 

  1. <VirtualHost *:80>                                                                                     
  2.     DocumentRoot "D:/wamp/www/web/code1"                                                
  3.     ServerName www.test.com                                                                    
  4.      <Directory "D:/wamp/www/web/code1">                                       
  5.         Options Indexes FollowSymLinks                                                                 
  6.         AllowOverride All                                                                              
  7.         Order allow,deny                                                                               
  8.         Allow from all                                                                                 
  9.     </Directory>                                                                                       
  10. </VirtualHost>  

 

3. Locate the C drive, find C: \ Windows \ System32 \ drivers \ etc folder and then the following hosts open configuration

4. If not reboot or restart Apache error

Forbidden:You don't have permission to access / on this server.

The reason is that: your file path will report this error out wamp / wwww

The reason for this error is usually reported as follows:

Then our case is part of the fourth

Open the folder wamp following bin folder to find the Apache Open the following conf folder. Find httpd.conf file will open 240 lines read:

 

  1. <Directory />  
  2.     Options Indexes FollowSymLinks  
  3.     AllowOverride All  
  4.     Order allow,deny  
  5.     Allow from all  
  6. </Directory> 

 Alternatively, you can refer to this practice http://blog.csdn.net/zhangweiguangsunjiao/article/details/51750932

Released two original articles · won praise 1 · views 386

Guess you like

Origin blog.csdn.net/a304784669/article/details/79515909