Ubuntu 下 Apache 虚拟主机设置指南
一 准备与目录结构
二 创建并启用虚拟主机
<VirtualHost *:80>
ServerAdmin webmaster@example.com
ServerName example.com
ServerAlias www.example.com
DocumentRoot /var/www/example.com
<Directory /var/www/example.com>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/example.com_error.log
CustomLog ${APACHE_LOG_DIR}/example.com_access.log combined
</VirtualHost>
三 DNS 与本地测试
四 启用 HTTPS 与自动续期
五 常用排错与优化