1.环境搭建(参考本站的配置文章)2.编写配置文件
cd /etc/httpd/conf
vi httpd.conf
在httpd.conf的文件末尾加上
Include /etc/httpd/conf/vhost.conf
同时在 /etc/httpd/conf/conf目录下,vi vhost.conf
内容如下:NameVirtualHost *:80
<VirtualHost *:80>
ServerName itzls.com
ServerName www.itzls.com
DocumentRoot "/var/www/html"
<directory "/var/www/html">
allow from all
</directory>
DirectoryIndex index.php index.html
</VirtualHost>
<VirtualHost *:80>
ServerName shop.itzls.com
DocumentRoot "/var/www/html/shop"
<directory "/var/www/html/shop"">
allow from all
</directory>
DirectoryIndex index.html index.php
</VirtualHost>
本文详细介绍了如何使用Apache HTTP服务器配置虚拟主机,包括环境搭建步骤、配置文件编写及域名解析设置等关键信息。

1013

被折叠的 条评论
为什么被折叠?



