Apache HTTP Server(十三)--虚拟主机

991阅读 0评论2012-06-08 yourtommy
分类:系统运维

基于名称


    # This first-listed virtual host is also the default for *:80
    ServerName
    ServerAlias example.com
    DocumentRoot /www/domain



    ServerName other.example.com
    DocumentRoot /www/otherdomain


基于IP


    ServerAdmin webmaster@www1.example.com
    DocumentRoot /www/vhosts/www1
    ServerName www1.example.com
    ErrorLog /www/logs/www1/error_log
    CustomLog /www/logs/www1/access_log combined



    ServerAdmin webmaster@www2.example.org
    DocumentRoot /www/vhosts/www2
    ServerName www2.example.org
    ErrorLog /www/logs/www2/error_log
    CustomLog /www/logs/www2/access_log combined
上一篇:Apache HTTP Server(十二)--mod_rewrite模块
下一篇:mms协议