Httpd配置多个顶级域名

先找到httpd.conf文件后添加:

LoadModule vhost_alias_module modules/mod_vhost_alias.so
#
#
#
Include conf/extra/httpd-vhosts.conf

然后是extra目录内的httpd-vhosts.conf文件:

<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host.localhost
    DocumentRoot "/var/www/site1"
    ServerName site1.com
    ServerAlias *.site1.com
    ErrorLog "logs/localhost-error_log"
</VirtualHost>
<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host.localhost
    DocumentRoot "/var/www/site2"
    ServerName site2.com
    ServerAlias *.site2.com
    ErrorLog "logs/localhost-error_log"
</VirtualHost>

发表评论?

0 条评论。

发表评论


注意 - 你可以用以下 HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

This site uses Akismet to reduce spam. Learn how your comment data is processed.