Apache配置多个网页服务器

cd /usr/local/apache2/

vim conf/extra/httpd-vhosts.conf

NameVirtualHost *:80

    ServerAdmin [email protected]
    DocumentRoot "/data/webapp/vv1/"
    ServerName vv1.com
    
    AllowOverride all
    #option -Indexes of FollowSymlinks
    Order allow,deny
    Allow from all
    
    ErrorLog logs/error_log
    CustomLog logs/access_log common


    ServerAdmin [email protected]
    DocumentRoot "/data/webapp/vv2/"
    ServerName vv2.com
    
    AllowOverride all
    #option -Indexes of FollowSymlinks
    Order allow,deny
    Allow from all
    
    ErrorLog logs/error_log
    CustomLog logs/access_log common

还要在主配置文件httpd.conf中有这样一句:

Include conf/extra/httpd-vhosts.conf

主配置文件默认将它注释,删掉开头的#号。

你可能感兴趣的:(Linux)