centos下的apache2.4.6虚拟主机设置

在httpd.conf里做以下添加

1.设置服务器名

ServerName 127.0.0.1


2.第一个:当别人不小心指到你的服务器来时的显示给对方的内容

第二个:自己设置的虚拟主机目录


    ServerAdmin [email protected]
    DocumentRoot /mnt/www/default/public_html
    ServerName dummy-host.example.com
    ErrorLog logs/dummy-host.example.com-error_log
    CustomLog logs/dummy-host.example.com-access_log common



    ServerAdmin [email protected]
    DocumentRoot /mnt/www/wp-car.com/public_html
    ServerName wp-car.com
    ServerAlias www.wp-car.com
    ErrorLog /mnt/www/wp-car.com/logs/error.log
    CustomLog /mnt/www/wp-car.com/logs/access.log common



你可能感兴趣的:(apache)