第一个虚拟主机留空,例如此vhost.conf文件:

<VirtualHost *:80>
ServerAdmin webmaster@zhezhe168.com
DocumentRoot “/opt/lampp/docs”
ServerName (这里填写你的IP地址)
ServerAlias
<Directory />
Order Allow,Deny
Deny from all
</Directory>
</VirtualHost>

<VirtualHost *:80>
ServerAdmin webmaster@zhezhe168.com
DocumentRoot “/opt/lampp/docs/blog”
ServerName blog.zhezhe168.com
ServerAlias
ErrorLog “logs/blog-error_log”
CustomLog “logs/blog-access_log” common
<Directory />
AllowOverride All
Require all granted
</Directory>
</VirtualHost>