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

The solution to the invalid configuration of Virtual Domain name in apache

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article mainly introduces the apache configuration virtual domain name invalid solution, the article introduces in great detail, has a certain reference value, interested friends must read it!

Background of the article:

Apache is reinstalled on the computer, but cannot be accessed after configuring the virtual domain name. Localhost always displays the it works status, and entering any configured domain name shows the it works status, but the file directory can be seen through 127.0.0.1.

Analysis:

The problem is that on the httpd_conf file, you only need to comment out ServerName localhost:80.

Solution:

Start by configuring the virtual host:

Start with the host file in the system disk:

First, add a domain name: 127.0.0.1 www.m.com. Open the httpd.conf file and open httpd-vhosts.conf:

# Virtual hostsInclude conf/extra/httpd-vhosts.conf

Then open the httpd-vhosts.conf file and configure a virtual host:

DocumentRoot "D:/wamp/apache/htdocs" ServerName www.m.com

Restart Apache. In this case, the domain name www.m.com of the virtual host cannot be accessed, or the status of it works

Resolve:

First, several other virtual domain names are configured, and none of them can access the file code.

Access through localhost is also out of it works status.

Finally, it is found that you only need to put the following in the httpd-vhosts.conf file:

# ServerName localhost:80

Comment out and restart apache!

The above is all the contents of the article "the solution to the invalid virtual domain name in apache configuration". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

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