当我启动 httpd 时它显示:
NameVirtualHost *:443 has no VirtualHosts
NameVirtualHost *:80 has no VirtualHosts
但是我已经配置了一个虚拟主机,如下所示:
httpd.conf:
Listen 80
NameVirtualHost *:80
NameVirtualHost *:443
Include /etc/httpd/conf/sites-enabled/
在 sites-enabled 目录中有一个符号链接:
900-tennisconnect.eu.vhost -> /etc/httpd/conf/sites-available/tennisconnect.eu.vhost
错误可能出现在这里(在 tennisconnect.eu.vhost 文件中):
# Apache did not start after modifying this vhost file.
# Please check file /etc/httpd/conf/sites-available/tennisconnect.eu.vhost.err for syntax errors.
它说 apache 没有启动?但是当我执行“service httpd status”时,它说服务正在运行
最后但同样重要的是,tennisconnect.eu.vhost.err 文件:
<Directory /var/www/tennisconnect.eu>
AllowOverride None
Order Deny,Allow
Deny from all
</Directory>
<VirtualHost *:80>
DocumentRoot /var/www/tennisconnect.eu/web
ServerName tennisconnect.eu
ServerAlias *.tennisconnect.eu
ServerAdmin [email protected]
ErrorLog /var/log/ispconfig/httpd/tennisconnect.eu/error.log
Alias /error/ "/var/www/tennisconnect.eu/web/error/"
ErrorDocument 400 /error/400.html
ErrorDocument 401 /error/401.html
ErrorDocument 403 /error/403.html
ErrorDocument 404 /error/404.html
ErrorDocument 405 /error/405.html
ErrorDocument 500 /error/500.html
ErrorDocument 502 /error/502.html
ErrorDocument 503 /error/503.html
<IfModule mod_ssl.c>
</IfModule>
<Directory /var/www/tennisconnect.eu/web>
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<Directory /var/www/clients/client1/web1/web>
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
# Clear PHP settings of this website
<FilesMatch "\.ph(p3?|tml)$">
SetHandler None
</FilesMatch>
# php as fast-cgi enabled
# For config options see: http://httpd.apache.org/mod_fcgid/mod/mod_fcg$
<IfModule mod_fcgid.c>
IdleTimeout 300
ProcessLifeTime 3600
# MaxProcessCount 1000
DefaultMinClassProcessCount 0
DefaultMaxClassProcessCount 100
IPCConnectTimeout 3
IPCCommTimeout 360
BusyTimeout 300
</IfModule>
<Directory /var/www/tennisconnect.eu/web>
AddHandler fcgid-script .php .php3 .php4 .php5
FCGIWrapper /var/www/php-fcgi-scripts/web1/.php-fcgi-starter .php
Options +ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<Directory /var/www/clients/client1/web1/web>
AddHandler fcgid-script .php .php3 .php4 .php5
FCGIWrapper /var/www/php-fcgi-scripts/web1/.php-fcgi-starter .php
Options +ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
# add support for apache mpm_itk
<IfModule mpm_itk_module>
AssignUserId web1 client1
</IfModule>
<IfModule mod_dav_fs.c>
# Do not execute PHP files in webdav directory
<Directory /var/www/clients/client1/web1/webdav>
<FilesMatch "\.ph(p3?|tml)$">
SetHandler None
</FilesMatch>
</Directory>
DavLockDB /var/www/clients/client1/web1/tmp/DavLock
# DO NOT REMOVE THE COMMENTS!
# IF YOU REMOVE THEM, WEBDAV WILL NOT WORK ANYMORE!
# WEBDAV BEGIN
# WEBDAV END
</IfModule>
</VirtualHost>
这是 httpd -S 返回的内容:
[Sat Aug 18 14:52:26 2012] [warn] NameVirtualHost *:443 has no VirtualHosts
[Sat Aug 18 14:52:26 2012] [warn] NameVirtualHost *:80 has no VirtualHosts
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
_default_:8081 uk2be.com (/etc/httpd/conf/sites-enabled/000-apps.vhost:10)
*:8080 is a NameVirtualHost
default server uk2be.com (/etc/httpd/conf/sites-enabled/000-ispconfig.vhost:10)
port 8080 namevhost uk2be.com (/etc/httpd/conf/sites-enabled/000-ispconfig.vhost:10)
Syntax OK
在我的 Apache 日志中发现这个:
BEGIN failed--compilation aborted at /usr/local/ispconfig/server/scripts/vlogger line 148.
piped log program ' /usr/local/ispconfig/server/scripts/vlogger -s access.log -t "%Y%m%d-access.log" /var/log/ispconfig/httpd' failed unexpectedly
Can't locate Date/Format.pm in @INC (@INC contains: /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8/i386- linux-thread-multi /usr/lib/perl5/5.8.8) at /usr/local/ispconfig/server/scripts/vlogger line 148.
apache日志中出现新错误,上面的错误已解决:)
[Sat Aug 18 23:15:01 2012] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /var/www/html/