我们提供常州网站维护服务,以实惠、方便、快捷著称!一次服务,终身朋友! ·付款帐号 ·联系我们
常州网站维护
网站维护热线: 网站维护咨询热线 网站维护:
网站建设: 网站建设
首页
维护介绍
维护套餐
案例分享
维护申请
维护反馈
维护知识
行业动态
联系我们
建站服务请点这里>>
网站维护申请
当前位置:首页 > 维护知识

apache下多站点的架设

来源:维护啦 作者:www.weihula.com 人气: 2011-6-9
内容提示:这里是指同一IP绑定N个域名,有二种方式实现

这里是指同一IP绑定N个域名,有二种方式实现
方法1、仅修改httpd.conf
假设二个域名bbs.xxx.com与blog.xxx.com
打开httpd.conf
将文件拖到最下面,加上
 
1. <VirtualHost *:80> 
2.  ServerName bbs.xxx.com   #域名  
3.  DocumentRoot "F:/website/bbs"   #该域名对应的目录地址    
4. <Directory "F:/website/bbs">   #该节点是配置权限、默认首页啊等等东东。  
5.  Options FollowSymLinks IncludesNOEXEC Indexes  
6.  DirectoryIndex  index.php   
7.  AllowOverride None   
8.  Order Deny,Allow   
9.  Allow from all      
10. </Directory> 
11. </VirtualHost> 
12.  
13. <VirtualHost *:80> 
14.  ServerName blog.xxx.com  
15.  DocumentRoot "D:/PHPSite/wordpress"  
16. <Directory "D:/PHPSite/wordpress">   
17.  Options FollowSymLinks IncludesNOEXEC Indexes  
18.  DirectoryIndex  index.php   
19.  AllowOverride None   
20.  Order Deny,Allow   
21.  Allow from all   
22. </Directory> 
23. </VirtualHost>

重启apache,就OK啦。当然你要修改你的hosts文件。

方法2、修改\PhpServer\Apache2.2\conf\extra\httpd-vhosts.conf
直接将上面一段copy到httpd-vhosts.conf的最后即可。
实际上看名字就知道httpd-vhosts.conf是一个虚拟站点配置集中地,方便管理。
也就是如下:


# Virtual Hosts 

# If you want to maintain multiple domains/hostnames on your 
# machine you can setup VirtualHost containers for them. Most configurations 
# use only name-based virtual hosts so the server doesn't need to worry about 
# IP addresses. This is indicated by the asterisks in the directives below. 

# Please see the documentation at  
# <http://httpd.apache.org/docs/2.2/vhosts/>
# for further details before you try to setup virtual hosts. 

# You may use the command line option '-S' to verify your virtual host 
# configuration. 
 

# Use name-based virtual hosting. 

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 <VirtualHost> block. 

 
 
<VirtualHost *:80>
 ServerName bbs.xxx.com   #域名 
 DocumentRoot "F:/website/bbs"   #该域名对应的目录地址   
<Directory "F:/website/bbs">   #该节点是配置权限、默认首页啊等等东东。 
 Options FollowSymLinks IncludesNOEXEC Indexes 
 DirectoryIndex  index.php  
 AllowOverride None  
 Order Deny,Allow  
 Allow from all     
</Directory>
</VirtualHost>
 
 
<VirtualHost *:80>
 ServerName blog.xxx.com 
 DocumentRoot "D:/PHPSite/wordpress" 
<Directory "D:/PHPSite/wordpress">  
 Options FollowSymLinks IncludesNOEXEC Indexes 
 DirectoryIndex  index.php  
 AllowOverride None  
 Order Deny,Allow  
 Allow from all  
</Directory>
</VirtualHost> 
重启apache。
如果不行的话,看你的httpd.conf是否启用了vhost
打开httpd.conf,找到
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
看是否启用,即去掉Include conf/extra/httpd-vhosts.conf前的#
重启apache。

【声明】本文章系本站编辑转载,转载目的在于传递更多信息,并不代表本网赞同其观点和对其真实性负责。如涉及作品内容、版权和其它问题,请与本站联系,我们将在第一时间删除内容!
上一篇 上一篇:要约出售域名若用管理邮箱须谨慎
下一篇 下一篇:愤怒的小鸟将在facebook“筑巢”
返回维护知识
维护动态 网站维护案例 更多动态 维护动态
积木人展览展示
海德睿工程
创际门窗
天津雷公
利君云商
维护动态 行业动态 更多动态 维护动态
谷歌悄然删去人工智能团队网页中
谷歌Colab推出数据科学助手
天价域名再现:ai.com挂牌
京东云发布八大领先智算产品 五
全球开源大模型榜单揭晓,阿里通
维护动态 网站维护知识 更多动态 维护动态
网站中木马了怎么办,怎么清除?
企业建设网站的好处
网站维护的工作内容有哪些?
制作网站需要关注这些核心要素
网站优化中十分影响排名的是什么
网站维护申请 网站维护申请点此进入 网站维护意见反馈 反馈意见

网站维护电话咨询

返回顶部
关于我们 | 案例分享 | 维护套餐 | 维护申请 | 意见反馈 | 维护知识 | 行业动态 | 联系方式
2025 © 网站维护 www.weihula.com 版权所有