当前位置: 首页 > 图文教程 > 服务器 > Linux服务器 > Apache 多站点虚拟主机配置方法

Linux服务器
RedHatLinux网络服务器构架实务(七)
RedHatLinux网络服务器构架实务(八)
RedHatLinux网络服务器构架实务(九)
在LINUX下使用Squid代理服务器
构建没有NT服务器的NT域
用Samba实现文件服务器功能
Debian服务器设置入门系列教程
RedHat8.0服务器配置指南--Webmail的实现
代理服务器Squid使用详解
为编程开发准备一台友好的CVS服务器
Linux的FTP服务器设置篇
在Linux代理服务器上设置防火墙
在Linux上用Qpopper建立POP3服务器
用Linux引导CD排除服务器故障
在Linux上如何重新进行Domino服务器的配置
TurbolinuxforiSeries服务器软/硬件需求
Linux服务器中架设AntiVir指南
基于Linux的Web服务器性能测试
Linux怎样做计费服务器
网络服务器基础

Linux服务器 中的 Apache 多站点虚拟主机配置方法


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-10-04   浏览: 257 ::
收藏到网摘: n/a

Apache 多站点虚拟主机配置方法, 有这类需要的朋友可以参考下。 修改配置文件 conf/httpd.conf
1.加入下面两句
NameVirtualHost *:80
Include conf/vhosts
2.在conf目录中建立vhosts目录
然后在 vhosts 目录下面建立相应的站点配置文件
如建立 hhj.ruanchen.com.conf 文件
内容:
复制代码 代码如下:

<VirtualHost *:80>
ServerAdmin [email protected]
ServerName www.hhj.ruanchen.com
ServerAlias hhj.ruanchen.com
DocumentRoot "F:\wwwroot\hhj.ruanchen.com"
DirectoryIndex index.html index.htm index.php
ErrorLog logs/hhj.ruanchen.com-error_log.log
CustomLog logs/hhj.ruanchen.com-access_log.log common
<Directory "F:\wwwroot\hhj.ruanchen.com">
AllowOverride All
Options FollowSymLinks
Order Deny,Allow
Allow from all
</Directory>
</VirtualHost>

3.重启apache服务