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

来源:互联网 发布:扫一扫软件免费下载 编辑:程序博客网 时间:2024/05/22 12:12


看官方文档:

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


示例:

NameVirtualHost *:80<VirtualHost *:80>  ServerName www.domain.tld  ServerAlias domain.tld *.domain.tld  DocumentRoot /www/domain</VirtualHost><VirtualHost *:80>  ServerName www.otherdomain.tld  DocumentRoot /www/otherdomain</VirtualHost>


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


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


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


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

0 0