Home >Backend Development >PHP Tutorial >About the settings of apache virtual domain name

About the settings of apache virtual domain name

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-07-28 08:29:341238browse

Set a virtual domain name

1. Modify the hosts file, directory: C:WindowsSystem32driversetc, add, for example

localhost doma.com

2. Modify the httpd.conf file

<Directory />
    AllowOverride none
    Require all denied
</Directory>
is
<Directory />
    #AllowOverride none
    #Require all denied

   AllowOverride all
    Order deny,allow
    Allow from all
</Directory>

3. Modify the https-vhosts.conf file and add, for example
<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 server
cannot 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.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn