简体   繁体   English

Apache虚拟子域

[英]Apache virtual subdomains

I'm trying to create virtual subdomains but apache fails to start after I edit the httpd-vhosts.conf and there are no errors in the error log. 我正在尝试创建虚拟子域,但是在编辑httpd-vhosts.conf后apache无法启动,并且错误日志中没有错误。

<VirtualHost 127.0.0.1:80>
  ServerAlias *.localhost
  UseCanonicalName Off    
  VirtualDocumentRoot C:/xampp/htdocs/%1
</VirtualHost>

Note: I'm running apache via xampp on windows. 注意:我正在Windows上通过xampp运行apache。

Struggled with the same problem a while ago. 前一阵子也遇到同样的问题。 You have to enable the vhost_alias module. 您必须启用vhost_alias模块。

In apache/conf/httpd.conf find this line and uncomment it apache / conf / httpd.conf中找到这一行并取消注释

#LoadModule vhost_alias_module modules/mod_vhost_alias.so

I know what I am writing is not a solution. 我知道我在写什么不是解决方案。 But try using Ampps . 但是,请尝试使用Ampps It gives an interface to create subdomains which is good for users who don't know much about Apache configurations. 它提供了一个用于创建子域的接口,该接口对不太了解Apache配置的用户非常有用。

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

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