Home > Operation and Maintenance > Apache > How to set up apache virtual directory

How to set up apache virtual directory

王林
Release: 2020-06-12 18:02:29
forward
5266 people have browsed it

How to set up apache virtual directory

The specific method is as follows:

1. Open the "virtual directory configuration file" httpd-vhosts.conf

File path: \wamp\bin\ apache\apache2.4.9\conf\extra\httpd-vhosts.conf

Change the following configuration:

# Virtual hosts
# Include conf/extra/httpd-vhosts.conf
Copy after login

to:

# Virtual hosts
Include conf/extra/httpd-vhosts.conf
Copy after login

2, Set the virtual directory to be accessible

File path:\wamp\bin\apache\apache2.4.9\conf\extra\httpd-vhosts.conf

Configure the following:

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

is changed to:

<Directory /> 
 AllowOverride none 
 </Directory>
Copy after login

3. Add virtual directory

File path: \wamp\bin\apache\apache2.4.9\conf\extra\httpd-vhosts. conf

Add virtual directory

<VirtualHost *:80> 
 ServerAdmin webmaster@web.shop.com 
 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>
Copy after login

4. Restart apache

Complete!

Recommended tutorial: apache from entry to proficiency

The above is the detailed content of How to set up apache virtual directory. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:jb51.net
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