我知道这是重复的,但我读到的所有其他答案对我都不起作用。
我想为我的Apache Web服务器创建子域,我希望能够通过以下之一访问它。我发现只有能够访问该网站的人才是我网络上的用户,你知道为什么吗?
我尝试编辑vhost.config文件并设法打破Xampp。我在输入时重新安装它。
还可以在一台服务器上托管多个网站吗?请向我解释这一切,我现在和Xampp和Goggling玩的时间太长了。
我得到的错误是服务器没有响应sub.localhost,但它是针对localhost的。
的httpd-vhost.config
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/site1"
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/site2"
ServerName sub.localhost
</VirtualHost>