CentOS + Apache2.2 一个ip配置多个域名


看官方文档:

http://httpd.apache.org/docs/2.2/vhosts/name-based.html


示例:

NameVirtualHost *:80


  ServerName www.domain.tld
  ServerAlias domain.tld *.domain.tld
  DocumentRoot /www/domain



  ServerName www.otherdomain.tld
  DocumentRoot /www/otherdomain


不熟悉的直接在 httpd.conf 结尾贴上上面一段就就好了。


不要问 * 指代什么,它不指代什么, * 就是 *,照着打就是了。


只需要修改 ServerName 为你自己想要的域名,DocumentRoot 为你想设定的 根目录值就好了。


更多的什么 CustomLog ErrorLog,自己照着写吧。

你可能感兴趣的:(Linux,apache)