Warning: session_start(): open(/tmp/session/sess_oa7mnlv466i8of2ubhcvpsr8hd, O_RDWR) failed: No such file or directory (2) in /www/wwwroot/new_blog/webpage/index.php on line 8

Warning: session_start(): Failed to read session data: files (path: /tmp/session) in /www/wwwroot/new_blog/webpage/index.php on line 8
APACHE多站点配置方法_涂鸦绘画网 - 一个走在web开发路上的爱好者个人博客

您现在的位置是:首页 >学习教程 > APACHE多站点配置方法网站首页学习教程

APACHE多站点配置方法

admin网络2018-11-03 13:21:273007人围观
简介APACHE多站点配置方法
例如你的主机 IP:192.168.1.8

而你有三个站点,域名 为:www.111.com ,www.222.com ,www.333.com 

相应的网站 文件放在主机的 :web site111;D:website222;D:website333文件夹下

现在打开APACHE配置文件httpd.conf文件,设置不同的域名到不同的目录中:

  NameVirtualHost 192.168.1.8

<VirtualHost 192.168.1.8>
DocumentRoot "D:website111"
ServerName www.111.com 
</Virtualhost>

<VirtualHost 192.168.1.8>
DocumentRoot "D:website222"
ServerName www.222.com 
</Virtualhost>

<VirtualHost 192.168.1.8>
DocumentRoot "D:website333"
ServerName www.333.com 
</Virtualhost>

保存关闭文件,重启一下APACHE就可以了!

文章评论