apache配置

1)配置好虚拟主机后启动apache时报下面的错误
[root@localhost /home/alex]#/etc/init.d/httpd start
Stopping httpd: [  OK  ]
[Sat Aug 07 07:58:35 2010] [warn] NameVirtualHost *:80 has no VirtualHosts
[  OK  ]
经过定位,是下面的问题导致的:
NameVirtualHost字段一定要放在主配置文件(我用的是fedora,所以主配置文件是/etc/httpd/conf/httpd.conf)中
原来的配置:
/etc/httpd/conf/httpd.conf文件:
include "conf.d/perl.conf"
/etc/httpd/conf.d/perl.conf文件:
NameVirtualHost *:80
<VirtualHost *:80>
    ServerName mail.hello.com
    DocumentRoot /var/www/extsuite/extmail/html
    ScriptAlias /extmail/cgi /var/www/extsuite/extmail/cgi
    Alias /extmail /var/www/extsuite/extmail/html
    SuexecUserGroup vuser vgroup
</VirtualHost>
修改后的配置:
/etc/httpd/conf/httpd.conf文件:
NameVirtualHost *:80
include "conf.d/perl.conf"
/etc/httpd/conf.d/perl.conf文件:
<VirtualHost *:80>
    ServerName mail.hello.com
    DocumentRoot /var/www/extsuite/extmail/html
    ScriptAlias /extmail/cgi /var/www/extsuite/extmail/cgi
    Alias /extmail /var/www/extsuite/extmail/html
    SuexecUserGroup vuser vgroup
</VirtualHost>

Advertisements
This entry was posted in Computers and Internet. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s