Apache 2.4
#虚拟主机配置文件
<virtualhost *:80>
#绑定的主域
ServerName bookstore.com
#绑定的子域名
Serveralias www.bookstore.com
#网站主目录
documentroot/var/www/www.bookstore.com/
#日志路径配置 (if not, please remember to create)
Errorlog/var/www/web_log/error_bookstore.com.log
Customlog/var/www/web_log/custom_bookstore.com.log Common
#ServerSignature OFF
</VirtualHost>
#网站的配置
<directory "/var/www/www.bookstore.com/" >
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
Apache 2.2
Namevirtualhost : 80
<virtualhost :80>
ServerAdmin [email protected]
DocumentRoot "C:/Program files/apache2/docs/dummy-host.www.phpstudy.net"
ServerName dummy-host.www.phpstudy.net
Serveralias www.dummy-host.www.phpStudy.net
Errorlog "Logs/dummy-host.www.phpstudy.net-error.log"
Customlog "Logs/dummy-host.www.phpstudy.net-access.log" common
</VirtualHost>
apache2.2 and 2.4 Virtual host configuration Files