我的Apache2安装有一些问题。
硬盘故障的最后一周我做了一个普通的备份,把硬盘换成新的,再次安装所有的SO(Debian 7 AMD64)和Apache2。 我已将所有数据从备份还原到新磁盘。
我再次configuration了与上次安装相同configuration的虚拟主机,但是这次我尝试访问除只托pipe静态内容的虚拟主机。
Apache错误文件没有错误,Apache启动时也没有错误或警告。 我还检查了文件系统的权限和所有者。
这是我的configuration文件:
apache2.conf
ServerRoot "/etc/apache2" LockFile ${APACHE_LOCK_DIR}/accept.lock PidFile ${APACHE_PID_FILE} Timeout 300 KeepAlive On MaxKeepAliveRequests 100 KeepAliveTimeout 5 <IfModule mpm_prefork_module> StartServers 5 MinSpareServers 5 MaxSpareServers 10 MaxClients 150 MaxRequestsPerChild 0 </IfModule> <IfModule mpm_worker_module> StartServers 2 MinSpareThreads 25 MaxSpareThreads 75 ThreadLimit 64 ThreadsPerChild 25 MaxClients 150 MaxRequestsPerChild 0 </IfModule> <IfModule mpm_event_module> StartServers 2 MinSpareThreads 25 MaxSpareThreads 75 ThreadLimit 64 ThreadsPerChild 25 MaxClients 150 MaxRequestsPerChild 0 </IfModule> User ${APACHE_RUN_USER} Group ${APACHE_RUN_GROUP} AccessFileName .htaccess <Files ~ "^\.ht"> Order allow,deny Deny from all Satisfy all </Files> DefaultType None HostnameLookups Off ErrorLog ${APACHE_LOG_DIR}/error.log LogLevel debug Include mods-enabled/*.load Include mods-enabled/*.conf Include ports.conf LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined LogFormat "%h %l %u %t \"%r\" %>s %O" common LogFormat "%{Referer}i -> %U" referer LogFormat "%{User-agent}i" agent Include conf.d/ Include httpd.conf
httpd.conf文件
<VirtualHost xxxx:80> DocumentRoot /home/www/hostname.domain.tld ServerName hostname.domain.tld ServerAdmin [email protected] <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /home/www/hostname.domain.tld> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> </VirtualHost> <VirtualHost xxxx:80> DocumentRoot /home/www/static.domain.tld ServerName static.domain.tld ServerAdmin [email protected] <Directory /home/www/static.domain.tld> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> </VirtualHost> <VirtualHost xxxx:80> DocumentRoot /home/www/mail.anijapan.com ServerName mail.domain.tld ServerAdmin [email protected] <Directory /home/www/mail.domain.tld> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> </VirtualHost> <VirtualHost xxxx:80> DocumentRoot /home/www/bugs.domain.tld ServerName bugs.domain.tld ServerAdmin [email protected] <Directory /home/www/bugs.domain.tld> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> </VirtualHost>
ports.conf
NameVirtualHost xxxx:80 Listen 80 <IfModule mod_ssl.c> Listen 443 </IfModule> <IfModule mod_gnutls.c> Listen 443 </IfModule>
我尝试了不同的东西,看了Google等等,没有任何结果。
任何人有我的问题的一些想法?
谢谢!
像这样启动Apache,前台+debugging,如果因为某种原因无法写日志,用这种方式就会启动。
. /etc/apache2/envvars apache2 -e debug -DFOREGROUND
另一个build议是查看/ var / log / messages和/ var / log / syslog,但是你可能已经完成了更多信息在这个页面zroger.com
我终于达到了没有403错误的Apache工作。 403错误的原因很容易,它不在服务器上。
对于域名DNSpipe理我使用CloudFlare。 为了在服务器HD发生变化时提供服务,我将所有网站移动到具有新IP的另一台服务器。 当我在新的HD上安装操作系统后,我将这些网站从救援服务器移到了新磁盘上,并且在CloudFlare上将DNSlogging的IP更改为旧的,但CloudFlare在这里失败,因为它们不通过内部错误传播新的IP地址。 我看到,使traceroute(非常愚蠢的解决scheme,但有效)看到Alogging的真正的最终目的地,而不是出现在CloudFlare上的最终目的地。
要使CloudFlare使用正确的Alogging,我已经删除它,保存更改,然后将Alogging添加到正确的IP地址。 一旦我这样做,所有人开始正常工作。