Home > Backend Development > PHP Tutorial > Specific steps to configure virtual host in XAMPP

Specific steps to configure virtual host in XAMPP

WBOY
Release: 2016-07-29 09:08:10
Original
1589 people have browsed it

1. Install the XAMPP installation package to the D drive. After the installation is completed, exit the XAMPP integrated environment and enter the next step to configure the virtual host; first create a new directory magento2 and test folder in the XAMPP/htdocs directory (this folder is your project all content).

PS. When creating multiple virtual hosts, you also need to create a new folder to contain all the contents of your project such as magento2 and test. If you need to create more, create the corresponding folder.

2. Find your XAMPP installation directory and open the following directories in order: apache/conf/extra directory. Find the httpd-vhosts.conf file and open it with Notepad.

3. After opening http-vhosts.conf, add the following code at the bottom:

<code><VirtualHost *:80>
 ServerName www.magento2.com
 DocumentRoot "D:/XAMPP/htdocs/magento2"
<Directory "D:/XAMPP/htdocs/magento2"> 
 Options FollowSymLinks IncludesNOEXEC Indexes
 DirectoryIndex index.html index.htm index.php
 AllowOverride all 
 Order Deny,Allow 
 Allow from all 
 Require all granted
</Directory>
</VirtualHost>

<VirtualHost *:80>
 ServerName www.test.com
 DocumentRoot "D:/XAMPP/htdocs/test"
<Directory "D:/XAMPP/htdocs/test"> 
 Options FollowSymLinks IncludesNOEXEC Indexes
 DirectoryIndex index.html index.htm index.php
 AllowOverride all 
 Order Deny,Allow 
 Allow from all   
 Require all granted
</Directory>
</VirtualHost>
</code>
Copy after login

4. In addition, you need to configure the C drive host file and find the following directories in sequence: C drive/windows/system32/drivers/etc directory , find the hosts file, open it with Notepad, add 127.0.0.1 www.magento2.com and save it, such as:

<code>127.0.0.1   www.magento2.com
127.0.0.1   www.test.com</code>
Copy after login

5. After configuring the virtual host, restart the XAMPP integrated environment.

The above introduces the specific steps of configuring a virtual host in XAMPP, including the relevant content. 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