Home >Backend Development >PHP Tutorial >About the settings of apache virtual domain name
Set a virtual domain name
1. Modify the hosts file, directory: C:WindowsSystem32driversetc, add, for example
localhost doma.com
<Directory /> AllowOverride none Require all denied </Directory>is
<Directory /> #AllowOverride none #Require all denied AllowOverride all Order deny,allow Allow from all </Directory>
<VirtualHost *:80> ServerAdmin doma.com DocumentRoot "c:/wamp/www/doma" ServerName doma.com ServerAlias www.dummy-host.example.com ErrorLog "logs/dummy-host.example.com-error.log" CustomLog "logs/dummy-host.example.com-access.log" common </VirtualHost>restarts the apache service and accesses the domain name doma.com, successfully
However, a problem occurs, accessing localhost, or error reporting in other directories
403 Forbidden You don't have permission to access / on this server
404 Forbidden The requested URL was not found on this servercannot resolve For this error, delete the original modification and restart the server. The above error still exists and cannot be understood.
You need the https-vhosts.cong file, comment out all the
<VirtualHost *:80> ... </VirtualHost>in it, modify the httpd.cong file, and the
<Directory /> #AllowOverride none #Require all denied Options Indexes FollowSymLinks Includes ExecCGI AllowOverride All Order deny,allow Allow from all </Directory>problem is solved. , the virtual domain name setting failed, need to think about the solution
The above has introduced the settings of the apache virtual domain name, including the relevant aspects. I hope it will be helpful to friends who are interested in PHP tutorials.