当我运行#/etc/init.d/apache2 restart它高兴地声称已经启动了该程序,但实际上并没有这样做。 输出有点像这样。
www〜#/etc/init.d/apache2 restart
*停止Apache2 ... [Sun Oct 25 23:50:38 2009] [warn]在/etc/apache2/vhosts.d/30_subversion_ssl_vhost.conf的第63行中无用UseOverride。 [Sun Oct 25 23:50:38 2009] [warn] NameVirtualHost --removed - :443 has no VirtualHosts [Sun Oct 25 23:50:38 2009] [warn] NameVirtualHost --removed1 - :8443 has no VirtualHosts httpd(没有pid文件)没有运行[ok] *启动apache2 ... [Sun Oct 25 23:50:38 2009] [警告]在/ et的第63行中无用的AllowOverride C / apache2的/ vhosts.d / 30_subversion_ssl_vhost.conf。 [Sun Oct 25 23:50:38 2009] [warn] NameVirtualHost --removed - :443 has no VirtualHosts [Sun 10月25日23:50:38 2009] [警告] NameVirtualHost --removed1 - :8443没有VirtualHosts [ 好 ]
正如你所看到的,尽pipe声称之前已经开始,但没有任何httpd进程正在运行,就像在这里再次一样。 手工validation/var/run/apache2/apache2.pid不存在。 run / apache2 /目录甚至在我手动添加和修改之前还没有。 没有任何附加到/ var / log / apache2 / error_log,也没有任何我的虚拟主机的特定于域的日志。
然而,使用–verbose和–debug选项运行,它似乎挂起了一个for循环涉及位置/var/run/apache2/apache2.pid
+ i = 0
+'[''!' -e /var/run/apache2.pid']'
+'['0 -lt 10']'
+睡1
++ expr 0 + 1
+ i = 1
+'[''!' -e /var/run/apache2.pid']'
+'['1 -lt 10']'
+睡1
++ expr 1 + 1
...
我在最新版本的Gentoo Linux上运行apache 2.2。 vhosts.dconfiguration文件已经从以前的设置导入,但是httpd.conf和相关的文件都是全新的。
编辑:进一步调查,apache2 init脚本调用
/ usr / sbin / apache2 -D DEFAULT_VHOST -D INFO -D SSL -D SSL_DEFAULT_VHOST \
-D LANGUAGE -d / usr / lib / apache2 -f /etc/apache2/httpd.conf -k start
如果我删除了-D SSL部分,pid创build自己的罚款…但是,我想ssl …任何想法?
EDIT2:
start() { checkconfig || return 1 [ -f /var/log/apache2/ssl_scache ] && rm /var/log/apache2/ssl_scache ebegin "Starting ${SVCNAME}" ${APACHE2} ${APACHE2_OPTS} -k start i=0 while [ ! -e "${PIDFILE}" ] && [ $i -lt ${TIMEOUT} ]; do sleep 1 && i=$(expr $i + 1) done test $i -le ${TIMEOUT} eend $? }
如果这提供了进一步的见解,让我知道
EDIT3:
如果,在我的ssl虚拟主机,我注释掉SSLEngine on
,Apache成功启动…
edit4:
只要看看我的Apache构build选项
www〜#emerge -av apache 这些是将被合并的包,为了: 计算依赖项| ...完成! [ebuild R] www-servers / apache-2.2.11-r2 USE =“sni ssl -debug -doc -ldap(-s elinux)-static -suexec -threads“APACHE2_MODULES =”操作别名asis auth_diges t authz_host autoindexcachingdav deflate dir env过期filter头包括 info log_config logio mime negotiation proxy rewrite setenvif speling status use rdir usertrack -auth_basic -authn_alias -authn_anon -authn_dbd -authn_dbm -authn _default -authn_file -authz_dbm -authz_default -authz_groupfile -authz_owner -au thz_user -cern_meta -charset_lite -dav_fs -dav_lock -dbd -disk_cache -dumpio -ex t_filter -file_cache -ident -imagemap -log_forensic -mem_cache -mime_magic -prox y_ajp -proxy_balancer -proxy_connect -proxy_ftp -proxy_http -substitute -unique_ id -version -vhost_alias“APACHE2_MPMS =” - event -itk -peruser -prefork -worker“0 KB 总共:1个软件包(1个重新安装),下载大小:0 kB 你想合并这些软件包吗? [是/否]
并validation校验和
www〜#equery检查apache [检查www-servers / apache-2.2.11-r2] ! /etc/apache2/vhosts.d/00_default_vhost.conf有不正确的md5sum ! /etc/conf.d/apache2有不正确的md5sum ! /etc/apache2/vhosts.d/00_default_ssl_vhost.conf有不正确的md5sum 406个文件中的403个很好
edit5:
呜! 编辑5!
将/etc/conf.d/apache2
的相应行更改为APACHE2_OPTS="-X -e debug -D DEFAULT_VHOST -D INFO -D SSL -D SSL_DEFAULT_VHOST -D LANGUAGE -D PHP5
后启动输出
*启动apache2 ... [星期二10月27日23:15:19 2009] [debugging] mod_so.c(246):加载模块actions_module [星期二10月27日23:15:19 2009] [debugging] mod_so.c(246):加载模块alias_module [星期二10月27日23:15:19 2009] [debugging] mod_so.c(246):加载模块asis_module [星期二10月27日23:15:19 2009] [debugging] mod_so.c(246):加载模块authz_host_modul Ë [星期二10月27日23:15:19 2009] [debugging] mod_so.c(246):加载模块autoindex_module [星期二10月27日23:15:19 2009] [debugging] mod_so.c(246):加载模块cgi_module [星期二10月27日23:15:19 2009] [debugging] mod_so.c(246):加载模块deflate_module [星期二10月27日23:15:19 2009] [debugging] mod_so.c(246):加载模块dir_module [星期二10月27日23:15:19 2009] [debugging] mod_so.c(246):加载模块env_module [星期二10月27日23:15:19 2009] [debugging] mod_so.c(246):加载模块expires_module [星期二10月27日23:15:19 2009] [debugging] mod_so.c(246):加载模块filter_module [星期二10月27日23:15:19 2009] [debugging] mod_so.c(246):加载模块headers_module [星期二10月27日23:15:19 2009] [debugging] mod_so.c(246):加载模块include_module [星期二10月27日23:15:19 2009] [debugging] mod_so.c(246):加载模块info_module [2009年10月27日星期二23:15:19] [debug] mod_so.c(246):加载模块log_config_modul Ë [星期二10月27日23:15:19 2009] [debugging] mod_so.c(246):加载模块logio_module [星期二10月27日23:15:19 2009] [debugging] mod_so.c(246):加载模块mime_module [2009年10月27日星期二23:15:19] [debug] mod_so.c(246):加载模块negotiation_modu 乐 [星期二10月27日23:15:19 2009] [debugging] mod_so.c(246):加载模块rewrite_module [星期二10月27日23:15:19 2009] [debugging] mod_so.c(246):加载模块setenvif_module [星期二10月27日23:15:19 2009] [debugging] mod_so.c(246):加载模块speling_module [星期二10月27日23:15:19 2009] [debugging] mod_so.c(246):加载模块ssl_module [星期二10月27日23:15:19 2009] [debugging] mod_so.c(246):加载模块usertrack_module [星期二10月27日23:15:19 2009] [debugging] mod_so.c(246):加载模块php5_mod [ok]
没有提示。 另外,不知道如何validationSSLconfiguration,如果确实是这个问题
嗯,我非常怀疑configuration文件
/etc/apache2/vhosts.d/30_subversion_ssl_vhost.conf
当您删除“-D SSL”时,将导致跳过包含在…中的configuration文件的所有部分。 我的Gentoo盒子上的默认SSL vhost文件被封装在这个标签中,所以我想知道是否通过删除'-D SSL'来防止30_subversion_ssl_vhost.conf中的configuration被运行,如果这是允许Apache开始。
如果您暂时从/etc/apache2/vhosts.d中删除文件30_subversion_ssl_vhost.conf,Apache运行的是否? vhosts.d中是否还有其他与SSL相关的vhost.conf文件? 我的合理新鲜/未使用的Apache安装的vhosts.d目录如下所示:
# pwd && ls /etc/apache2/vhosts.d 00_default_ssl_vhost.conf 00_default_vhost.conf default_vhost.include
编辑1:
那么多的理论:)我现在想知道如果问题是与Apache的SSL设置本身。 我很抱歉,如果我已经检查覆盖地面,但我想知道是否可以执行以下操作来帮助validation您的Apache安装。
在我的Apache安装与工作SSL使用标志如下:
# emerge -av apache These are the packages that would be merged, in order: Calculating dependencies... done! [ebuild U ] www-servers/apache-2.2.11-r2 [2.2.11] USE="ssl -debug -doc -ldap (-selinux) -sni -static -suexec -threads" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias -asis -auth_digest -authn_dbd -cern_meta -charset_lite -dbd -dumpio -ident -imagemap -log_forensic -proxy -proxy_ajp -proxy_balancer -proxy_connect -proxy_ftp -proxy_http -substitute -version" APACHE2_MPMS="-event -itk -peruser -prefork -worker" 64 kB
特别是你有'SSL'USE标志设置?
另外,你可以使用equery来validation你的apache2安装的完整性吗? 如果你没有equery命令,你可以通过运行'emerge -av gentoolkit'来安装它。 以下命令应该validation你的apache安装的完整性:
equery check apache
在我的服务器上面的命令给出了以下输出:
[ Checking www-servers/apache-2.2.11 ] !!! /etc/apache2/vhosts.d/00_default_ssl_vhost.conf has wrong mtime (is 1256620928, should be 1246793824) !!! /etc/apache2/modules.d/00_default_settings.conf has wrong mtime (is 1246796304, should be 1246793824) !!! /etc/conf.d/apache2 has incorrect md5sum * 429 out of 432 files good
编辑2:
那么安装对我来说看起来不错,对于理论来说太多了。我想知道我们是否可以哄骗Apache给出一些关于启动的更多信息。 在/etc/conf.d/apache2中,如果您将APACHE2_OPTS行从以下位置更改:
APACHE2_OPTS="-D DEFAULT_VHOST -D INFO -D SSL -D SSL_DEFAULT_VHOST -D LANGUAGE"
至
APACHE2_OPTS="-X -e debug -D DEFAULT_VHOST -D INFO -D SSL -D SSL_DEFAULT_VHOST -D LANGUAGE"
然后启动Apache(/etc/init.d/apache2 start),守护进程应保持在前台(-X标志),并在启动时输出debugging消息(-edebugging选项)。 也许这会给出一个线索,为什么它在启动时就要死了。
该脚本正在访问/var/run/apache2.pid,而不是/var/run/apache2/apache2.pid。 你可以检查/var/run/apache2.pid是否有正确的权限?
不知何故,在创build我自己的.crt和.key文件之后,尝试一个emerge mod_ssl
,最终做了一堆东西,然后再次重buildapache,一切都以某种方式落空了。 我没有解释,除了可能以前的一些不一致的方式,我做我的.crt和.key文件:/
这个旅程让我感到空虚,没有实现。 那么,除了你的帮助:]谢谢大家。