求助:AS4里控制apache2.2.2设置开启虚拟主机功能

求助:AS4里控制apache2.2.2设置开启虚拟主机功能

AS4 平台使用tar包安装apache2.2.2,编译命令为:
./configure --prefix=/usr/local/apache --enable-so
安装成功后,可以正常访问定义在httpd.conf里面的网页(DoumentRoot)


修改httpd.conf里面的
# Virtual hosts
Include conf/extra/httpd-vhosts.conf拟实现虚拟基于名称的虚拟主机功能,但IE访问怎么也定位不到httpd-vhost.conf控制文件里定义的目录,
请问在开启虚拟主机功能,还需要做什么?谢谢.

httpd-vhosts.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 <VirtualHost> block.
#
<VirtualHost *:80>
    ServerAdmin webmaster@mail.njqlx.com
    DocumentRoot /data/mail
    ServerName mail.njqlx.com
    ServerAlias mail.njqlx.com
    ErrorLog logs/mail.njqlx.com-error_log
    CustomLog logs/mail.njqlx.com-access_log common
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin webmaster@cms.njqlx.com
    DocumentRoot /data/cms
    ServerName cms.njqlx.com
    ErrorLog logs/cms.njqlx.com-error_log
    CustomLog logs/cms.njqlx.com-access_log common
</VirtualHost>
感觉像是vhost不起作用一样


QUOTE:
原帖由 白领乞丐 于 2006-9-5 17:38 发表
修改httpd.conf里面的
# Virtual hosts
Include conf/extra/httpd-vhosts.conf拟实现虚拟基于名称的虚拟主机功能,但IE访问怎么也定位不到httpd-vhost.conf控制文件里定义的目录,
请问在开启虚拟主机功能,还需要做什么?谢谢.

Include 后面用绝对路径
eg.

Include /usr/local/apache2/conf/extra/httpd-vhosts.conf


QUOTE:
原帖由 todaynet 于 2006-9-5 18:16 发表


Include 后面用绝对路径
eg.

Include /usr/local/apache2/conf/extra/httpd-vhosts.conf

是的,需要绝对路径
谢谢,也帮我解决了这个问题!
谢谢,一个不错的方法