Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to configure xampp virtual host

2025-04-08 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

How is the xampp virtual host configured? I believe that many inexperienced people are at a loss about this, so this article summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.

XAMPP sometimes you need some top-level domain name access to access your local project, that is, virtual host configuration, so you need to configure a virtual host, bind a domain name to your directory, and achieve multi-domain name binding access.

1. Modify httpd.conf

File directory xampp = > apache = > conf = > httpd.conf

1. Search for the keyword "httpd-vhosts.conf" in the file and find the following fields

# Virtual hostsInclude conf/extra/httpd-vhosts.conf// make sure there is no # at the beginning of this paragraph

two。 Search for the keyword "AllowOverride All" in the file and find the following fields

Change AllowOverride AllOptions NoneRequire all granted// to Options Indexes FollowSymLinks Includes ExecCGIAllowOverride AllOrder allow,denyAllow from all

3. The search field "DocumentRoot" is as follows

DocumentRoot "D:/xampp/htdocs" / / make sure that the path here is the root path of the project you want to visit ps: you can configure a specific root path, such as: DocumentRoot "D:/www"

2. Modify httpd-vhosts.conf

File directory xampp = > apache = > conf = > extra = > httpd-vhosts.conf

At the end of the file, you can see the following

# ServerAdmin webmaster@dummy-host2.example.com##DocumentRoot "D:/xampp/htdocs/dummy-host2.example.com" # # ServerName dummy-host2.example.com##ErrorLog "logs/dummy-host2.example.com-error.log" # # CustomLog "logs/dummy-host2.example.com-access.log" common##

1. Access with ip

/ / set the accessed ip##ServerAdmin webmaster@dummy-host2.example.comDocumentRoot "D:/www" / / your project file directory ServerName testname.dev// the name of this project # # ErrorLog "logs/dummy-host2.example.com-error.log" # # CustomLog "logs/dummy-host2.example.com-access.log" common

two。 Access with ServerName

# # ServerAdmin webmaster@dummy-host2.example.comDocumentRoot "D:/www" / / your project file directory ServerName testname.dev// the name of this project. To access the project through this name, you also need to configure the hosts file # # ErrorLog "logs/dummy-host2.example.com-error.log" # # CustomLog "logs/dummy-host2.example.com-access.log" common

3. Configure the hosts file

File directory C:\ Windows\ System32\ drivers\ etc\ hosts add 127.0.0.1 testname.dev to the file. After reading the above, have you mastered how to configure the xampp virtual host? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report