当前位置: 移动技术网 > 网络运营>服务器>Linux > Apache 多站点虚拟主机配置方法

Apache 多站点虚拟主机配置方法

2019年05月07日  | 移动技术网网络运营  | 我要评论
修改配置文件 conf/httpd.conf
1.加入下面两句
namevirtualhost *:80
include conf/vhosts
2.在conf目录中建立vhosts目录
然后在 vhosts 目录下面建立相应的站点配置文件
如建立 hhj.jb51.net.conf 文件
内容:
复制代码 代码如下:

<virtualhost *:80>
serveradmin hhj@live.it
servername www.hhj.jb51.net
serveralias hhj.jb51.net
documentroot "f:\wwwroot\hhj.jb51.net"
directoryindex index.htm index.php
errorlog logs/hhj.jb51.net-error_log.log
customlog logs/hhj.jb51.net-access_log.log common
<directory "f:\wwwroot\hhj.jb51.net">
allowoverride all
options followsymlinks
order deny,allow
allow from all
</directory>
</virtualhost>

3.重启apache服务

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网