gpt4 book ai didi

apache - 如何在 Ubuntu 上为 Apache2 配置子域?

转载 作者:行者123 更新时间:2023-12-04 01:03:00 24 4
gpt4 key购买 nike

我关注了这些 instructions to configure subdomains for apache .我可以使用 http://localhost/test 访问子域虽然我无法通过 http://test.localhost 访问它.我怎样才能实现后者?

# /etc/apache2/sites-available/test.localhost
<VirtualHost *:80>

# Server name
ServerName test.localhost

# Document root
DocumentRoot /var/www/test/

# Custom log file locations
ErrorLog /var/www/test/logs/error.log
CustomLog /var/www/test/logs/access.log combined

</VirtualHost>

最佳答案

马克 B 已经正确回答问题是 /etc/hosts 中的配置错误.正确的配置是:

# /etc/hosts
127.0.0.1 test.localhost

关于apache - 如何在 Ubuntu 上为 Apache2 配置子域?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6836725/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com