简体   繁体   English

Apache VirtualHost无法正常工作

[英]Apache VirtualHost is not working

I have a server running Apache 2.4 on Windows, and I have set up a VirtualHost in the httpd-vhosts.conf file, and an 'A' record in my DNS server that points subdomain.mydomain.com to my IP address. 我有一台在Windows上运行Apache 2.4的服务器,并且已经在httpd-vhosts.conf文件中设置了VirtualHost,并在DNS服务器中设置了“ A”记录,该记录将subdomain.mydomain.com指向我的IP地址。 Unfortunately, connecting to subdomain.mydomain.com just shows the same page as mydomain.com. 不幸的是,连接到subdomain.mydomain.com只会显示与mydomain.com相同的页面。 Here is the code I used in the httpd-vhosts.conf file: 这是我在httpd-vhosts.conf文件中使用的代码:

<VirtualHost *:80>
    ServerAdmin admin@mydomain.com
    DocumentRoot "c:/Apache24/subdomain/htdocs"
    ServerName subdomain.mydomain.com
    ErrorLog "c:/Apache24/subdomain/logs/errors.log"
    CustomLog "c:/Apache24/subdomain/logs/access.log"
</VirtualHost>

What am I doing wrong? 我究竟做错了什么?

确保您的域提供商配置未将@重定向到www,您需要分别配置它们以重定向到您的计算机IP地址

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM