Apache多站点配置注意事项

起码有7、8年不碰Apache了,一直是Nginx当道,想在一个配置过剩的服务器上部署点东西,搞一个多站点配置,发现一直不能成功,找到conf/httpd.conf里的

LoadModule vhost_alias_module modules/mod_vhost_alias.so

这句,去掉前面的注释,增加一个配置节


<VirtualHost *:80>
    DocumentRoot /srv/www/niubibudeliao
    ServerName a.niubibudeliao.cn
    <Directory /srv/www/niubibudeliao >
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Require all granted
    </Directory>
    <IfModule dir_module>
        DirectoryIndex index.html
    </IfModule>
    ErrorLog "/var/log/a.niubibudeliao.cn-error.log"
    CustomLog "/var/log/a.niubibudeliao.cn-access.log" common
</VirtualHost>

搞定

For example, "name@something.com". If someone replies to you it will be via email.
For example, "http://someaddress.com"