简体   繁体   中英

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.

<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.

Struggled with the same problem a while ago. You have to enable the vhost_alias module.

In apache/conf/httpd.conf find this line and uncomment it

#LoadModule vhost_alias_module modules/mod_vhost_alias.so

I know what I am writing is not a solution. But try using Ampps . It gives an interface to create subdomains which is good for users who don't know much about Apache configurations.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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