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

About the settings of apache virtual domain name

WBOY
Release: 2016-07-28 08:29:34
Original
1223 people have browsed it

Set a virtual domain name

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

localhost doma.com
Copy after login

2. Modify the httpd.conf file

<Directory />
    AllowOverride none
    Require all denied
</Directory>
Copy after login
is
<Directory />
    #AllowOverride none
    #Require all denied

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

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>
Copy after login
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
Copy after login
404 Forbidden The requested URL  was not found on this server
Copy after login
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>
Copy after login
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>
Copy after login
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.

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template