方法1、僅修改httpd.conf
假設(shè)二個域名bbs.xxx.com與blog.xxx.com
打開httpd.conf
將文件拖到下面,加上


view plaincopy to clipboardprint?

ServerName bbs.xxx.com" />

日韩精品久久久久,亚洲 www. 色图 夜夜嗨,男女性爽大片在线观看,色网站视频,久久高清国产,欧美一区二区三区精品免费

186-0984-0880
 
教你如何用apache同ip多站點架設(shè)
日期:09-29 瀏覽次數(shù):23

這里是指同一IP綁定N個域名,有二種方式實現(xiàn)
方法1、僅修改httpd.conf
假設(shè)二個域名bbs.xxx.com與blog.xxx.com
打開httpd.conf
將文件拖到下面,加上


view plaincopy to clipboardprint?
 
 ServerName bbs.xxx.com   #域名  
 DocumentRoot "F:/website/bbs"   #該域名對應(yīng)的目錄地址    
   #該節(jié)點是配置權(quán)限、默認(rèn)首頁啊等等東東。  
 Options FollowSymLinks IncludesNOEXEC Indexes  
 DirectoryIndex  index.php   
 AllowOverride None   
 Order Deny,Allow   
 Allow from all      
 
 
 
 
 ServerName blog.xxx.com  
 DocumentRoot "D:/PHPSite/wordpress"  
   
 Options FollowSymLinks IncludesNOEXEC Indexes  
 DirectoryIndex  index.php   
 AllowOverride None   
 Order Deny,Allow   
 Allow from all   
 
 


 ServerName bbs.xxx.com   #域名
 DocumentRoot "F:/website/bbs"   #該域名對應(yīng)的目錄地址 
   #該節(jié)點是配置權(quán)限、默認(rèn)首頁啊等等東東。
 Options FollowSymLinks IncludesNOEXEC Indexes
 DirectoryIndex  index.php
 AllowOverride None
 Order Deny,Allow
 Allow from all   




 ServerName blog.xxx.com
 DocumentRoot "D:/PHPSite/wordpress"

 Options FollowSymLinks IncludesNOEXEC Indexes
 DirectoryIndex  index.php
 AllowOverride None
 Order Deny,Allow
 Allow from all



重啟apache,就OK啦。當(dāng)然你要修改你的hosts文件。

方法2、修改/PhpServer/Apache2.2/conf/extra/httpd-vhosts.conf
直接將上面一段copy到httpd-vhosts.conf的后即可。
實際上看名字就知道httpd-vhosts.conf是一個虛擬站點配置集中地,方便管理。
也就是如下:
view plaincopy to clipboardprint?
#  
# 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   
#  
# 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 block.  
#  
 
 
 
 ServerName bbs.xxx.com   #域名  
 DocumentRoot "F:/website/bbs"   #該域名對應(yīng)的目錄地址    
   #該節(jié)點是配置權(quán)限、默認(rèn)首頁啊等等東東。  
 Options FollowSymLinks IncludesNOEXEC Indexes  
 DirectoryIndex  index.php   
 AllowOverride None   
 Order Deny,Allow   
 Allow from all      
 
 
 
 
 
 ServerName blog.xxx.com  
 DocumentRoot "D:/PHPSite/wordpress"  
   
 Options FollowSymLinks IncludesNOEXEC Indexes  
 DirectoryIndex  index.php   
 AllowOverride None   
 Order Deny,Allow   
 Allow from all   
 
 

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



 ServerName bbs.xxx.com   #域名
 DocumentRoot "F:/website/bbs"   #該域名對應(yīng)的目錄地址 
   #該節(jié)點是配置權(quán)限、默認(rèn)首頁啊等等東東。
 Options FollowSymLinks IncludesNOEXEC Indexes
 DirectoryIndex  index.php
 AllowOverride None
 Order Deny,Allow
 Allow from all   





 ServerName blog.xxx.com
 DocumentRoot "D:/PHPSite/wordpress"

 Options FollowSymLinks IncludesNOEXEC Indexes
 DirectoryIndex  index.php
 AllowOverride None
 Order Deny,Allow
 Allow from all



重啟apache。
如果不行的話,看你的httpd.conf是否啟用了vhost
打開httpd.conf,找到
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
看是否啟用,即去掉Include conf/extra/httpd-vhosts.conf前的#
重啟apache,爽去吧。

← 上一篇 下一篇 → 返回首頁
如有意向,請聯(lián)系我們的客戶經(jīng)理
我們會根據(jù)您的需求為你制定詳細(xì)的解決方案
在線咨詢 or 撥打業(yè)務(wù)熱線:186-0984-0880
在線咨詢
熱線電話
解決方案
掃一掃

掃一掃
關(guān)注新圖聞科技

全國咨詢熱線
186-0984-0880

返回頂部
宁远县| 嘉荫县| 旅游| 长兴县| 甘谷县| 金山区| 云浮市| 江西省| 韩城市| 久治县| 板桥市| 晴隆县| 织金县| 巫山县| 阳谷县| 怀集县| 鲁甸县| 江永县| 兴安县| 桐梓县| 高唐县| 稷山县| 霍州市| 信阳市| 临泉县| 蛟河市| 双峰县| 上思县| 阿坝县| 奉化市| 章丘市| 靖江市| 喀喇沁旗| 辉县市| 宿松县| 新田县| 囊谦县| 新乐市| 淳化县| 明水县| 白山市|