红联Linux门户
Linux帮助

Apache虚拟主机配置!请教下各位!

发布时间:2010-10-26 12:30:59来源:红联作者:yk19880829
[i=s] 本帖最后由 yk19880829 于 2010-10-26 12:32 编辑 [/i]

基于linux下apache单IP多站点配置! 大家可能都遇见这个问题! 一台LINUX服务器1个IP 却有多个PHP站! 那么我们可以使用多个域名!
但是默认编译好的apache只支持一个80端口提供服务! 这里我想请教下实践配置过单IP多站点的朋友下是如何配置apache的!
W2K下是这样子的配置的!
打开apache httpd.conf 开启虚拟主机支持 Include conf/extra/httpd-vhosts.conf

首把httpd.conf里的Document_Root,ServerName注释掉可以使用*去注释掉!

然后配置目录的访问规则


Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all


Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all


然后在httpd.conf尾末写上 Include conf/extra/httpd-vhosts.conf 插上此代码

打开extra/httpd-vhost.conf 模仿这样配置

NameVirtualHost *:80

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any block.
#


NameVirtualHost *

ServerAdmin iworkiwin@gmail.com
DocumentRoot D:\foo
ServerName foo.com
ErrorLog logs/localhost-error_log
CustomLog logs/localhost-access_log common

NameVirtualHost *

ServerAdmin iworkiwin@gmail.com
DocumentRoot D:/www/htdocs
ServerName localhost
ErrorLog logs/localhost-error_log
CustomLog logs/localhost-access_log common



ServerAdmin iworkiwin@gmail.com
DocumentRoot D:/www/WEB
ServerName localhost
ErrorLog logs/localhost-error_log
CustomLog logs/localhost-access_log common



那么在LINUX如何配置单IP多站点呢! 大家谁实践配置过哦 发一份资料看看学习下! 谢谢了
文章评论

共有 0 条评论