I must say that I am not the guy that set up the server,but the poor sap tasked with finding out what is happening for the time being. I only have a rough kNowledge about apache and linux,so please bear with me…

问题

我们的apache服务器关闭(主要是在夜间)并且无法恢复并重新开始备份,没有任何人实际告诉它.

从我可以收集的内容来看,这里有趣的是apache错误日志中的以下行;

[Wed Apr 15 03:43:02.114879 2015] [mpm_prefork:notice] [pid 25778] AH00171: Graceful restart requested,doing restart

之后是一个非常长的堆栈跟踪,这里是前几行:

*** Error in `/usr/sbin/httpd': free(): invalid pointer: 0x00007f581d5c13c0 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x7d19d)[0x7f583b69519d]
/etc/httpd/modules/libPHP5.so(PHP_module_shutdown+0x2b)[0x7f58301d255b]
/etc/httpd/modules/libPHP5.so(PHP_module_shutdown_wrapper+0x9)[0x7f58301d2619]
[...]

回溯持续了一段时间,但有趣的是,在这之间,/usr/sbin / httpd […]中的错误重复5次,直到最后一条消息为止

[Wed Apr 15 03:43:02.269626 2015] [core:notice] [pid 25778] AH00060: seg fault or similar nasty error detected in the parent process

下一条消息是第二天我再次启动服务器;

[Wed Apr 15 08:14:46.200884 2015] [core:notice] [pid 30326] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
[Wed Apr 15 08:14:46.215410 2015] [suexec:notice] [pid 30326] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Wed Apr 15 08:14:46.235346 2015] [auth_digest:notice] [pid 30326] AH01757: generating secret for digest authentication ...
[Wed Apr 15 08:14:46.236045 2015] [lbmethod_heartbeat:notice] [pid 30326] AH02282: No slotmem from mod_heartmonitor
[Wed Apr 15 08:14:46.280992 2015] [core:warn] [pid 30326] AH00098: pid file /run/httpd/httpd.pid overwritten -- Unclean shutdown of prevIoUs Apache run?
[Wed Apr 15 08:14:46.284919 2015] [mpm_prefork:notice] [pid 30326] AH00163: Apache/2.4.6 (CentOS) PHP/5.4.16 configured -- resuming normal operations
[Wed Apr 15 08:14:46.284939 2015] [core:notice] [pid 30326] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'

思考

在我看来,prefork模块以某种方式请求apache进程(或其中一个?)关闭.这失败了,作为回报,整个事情都崩溃得非常可怕.

问题

首先是:我的分析 – 崩溃服务器的问题是prefork模块 – 是否正确?

我应该禁用prefork模块吗?我不知道如何调试/帮助软件内部的内存错误.

禁用此模块时有什么影响?

版本信息

Linux version 3.10.0-123.13.2.el7.x86_64 (builder@kbuilder.dev.centos.org) (gcc version 4.8.2 20140120 (Red Hat 4.8.2-16) (GCC) )

Server version: Apache/2.4.6 (CentOS)
Server built:   Jan 12 2015 13:22:31
Server's Module Magic Number: 20120211:23
Server loaded:  APR 1.4.8,APR-UTIL 1.5.2
Compiled using: APR 1.4.8,APR-UTIL 1.5.2
Architecture:   64-bit
Server MPM:     prefork
  threaded:     no
    forked:     yes (variable process count)
Server compiled with....
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_SYSVSEM_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=256
 -D HTTPD_ROOT="/etc/httpd"
 -D SUEXEC_BIN="/usr/sbin/suexec"
 -D DEFAULT_PIDLOG="/run/httpd/httpd.pid"
 -D DEFAULT_scoreBOARD="logs/apache_runtime_status"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONfig_FILE="conf/mime.types"
 -D SERVER_CONfig_FILE="conf/httpd.conf"

对评论的回应

cron的

没有/etc/cron.d/dailyjobs,但只有一个0hourly脚本,它执行每小时脚本0anacron,0yum-hourly.cron和dellrda.cron – 其中任何一个似乎都没有做任何与apache相关的事情(恕我直言)

/etc/logrotate.d/httpd

/var/log/httpd/*log {
    missingok
    notifempty
    sharedscripts
    delaycompress
    postrotate
        /bin/systemctl reload httpd.service > /dev/null 2>/dev/null || true
    endscript
}

手动重装

/bin/systemctl reload httpd.service

得出以下结果

Job for httpd.service Failed. See 'systemctl status httpd.service' and 'journalctl -xn' for details.

在error_log中显示与上面相同的消息.

一个快速的systemctl状态httpd.service显示:

httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled)
   Active: Failed (Result: signal) since Fri 2015-04-17 12:26:36 CEST; 8s ago
  Process: 8828 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited,status=0/SUCCESS)
  Process: 8826 ExecReload=/usr/sbin/httpd $OPTIONS -k graceful (code=exited,status=0/SUCCESS)
  Process: 8767 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=killed,signal=ABRT)
 Main PID: 8767 (code=killed,signal=ABRT)
   Status: "Total requests: 0; Current requests/sec: 0; Current traffic:   0 B/sec"

apachectl -M

Loaded Modules:
 core_module (static)
 so_module (static)
 http_module (static)
 access_compat_module (shared)
 actions_module (shared)
 alias_module (shared)
 allowmethods_module (shared)
 auth_basic_module (shared)
 auth_digest_module (shared)
 authn_anon_module (shared)
 authn_core_module (shared)
 authn_dbd_module (shared)
 authn_dbm_module (shared)
 authn_file_module (shared)
 authn_socache_module (shared)
 authz_core_module (shared)
 authz_dbd_module (shared)
 authz_dbm_module (shared)
 authz_groupfile_module (shared)
 authz_host_module (shared)
 authz_owner_module (shared)
 authz_user_module (shared)
 autoindex_module (shared)
 cache_module (shared)
 cache_disk_module (shared)
 data_module (shared)
 dbd_module (shared)
 deflate_module (shared)
 dir_module (shared)
 dumpio_module (shared)
 echo_module (shared)
 env_module (shared)
 expires_module (shared)
 ext_filter_module (shared)
 filter_module (shared)
 headers_module (shared)
 include_module (shared)
 info_module (shared)
 log_config_module (shared)
 logio_module (shared)
 mime_magic_module (shared)
 mime_module (shared)
 negotiation_module (shared)
 remoteip_module (shared)
 reqtimeout_module (shared)
 rewrite_module (shared)
 setenvif_module (shared)
 slotmem_plain_module (shared)
 slotmem_shm_module (shared)
 socache_dbm_module (shared)
 socache_memcache_module (shared)
 socache_shmcb_module (shared)
 status_module (shared)
 substitute_module (shared)
 suexec_module (shared)
 unique_id_module (shared)
 unixd_module (shared)
 userdir_module (shared)
 version_module (shared)
 vhost_alias_module (shared)
 dav_module (shared)
 dav_fs_module (shared)
 dav_lock_module (shared)
 lua_module (shared)
 mpm_prefork_module (shared)
 proxy_module (shared)
 lbmethod_bybusyness_module (shared)
 lbmethod_byrequests_module (shared)
 lbmethod_bytraffic_module (shared)
 lbmethod_heartbeat_module (shared)
 proxy_ajp_module (shared)
 proxy_balancer_module (shared)
 proxy_connect_module (shared)
 proxy_express_module (shared)
 proxy_fcgi_module (shared)
 proxy_fdpass_module (shared)
 proxy_ftp_module (shared)
 proxy_http_module (shared)
 proxy_scgi_module (shared)
 systemd_module (shared)
 cgi_module (shared)
 PHP5_module (shared)
我的猜测是你遇到了这个bug: http://bugs.centos.org/view.php?id=7669,但我没有在你加载的模块中看到mod_gnutls.不过,对我而言,似乎你遇到了某种错误.我可以看到,你没有使用最新的httpd版本,所以你应该首先尝试更新你的httpd包:
yum update

请稍后重新启动httpd,然后尝试重新加载问题是否仍然存在.如果它仍然存在,我建议在CentOS上打开一个错误报告.为了避免在半夜发生崩溃,我建议您编辑要使用的logrotate脚本

/bin/systemctl restart httpd.service

而不是它的重新加载对应,直到问题解决.

编辑:

在CentOS打开错误报告之前,您应该确保只使用标准的CentOS apache包和模块.如果您使用自编译或从第三方存储库安装的任何Apache模块,他们可能不会接受此操作.

要显示包含它们来自的repo的所有已安装软件包,可以使用该命令

rpm -qa --qf '%{NAME} %{vendOR}\n'

centos – Apache无意中关闭的更多相关文章

  1. IOs Cordova长按显示文本选择放大镜即使禁用文本选择,如何删除?

    是否有任何可能导致此问题的插件?任何帮助深表感谢.Cordova插件:>com.mbppower.camerapreview>cordova-plugin-statusbar>cordova-plugin-whitelist>离子插件键盘>org.apache.cordova.camera>org.apache.cordova.console>org.apache.cordova.device>org.apache.cordova.dialogs>org.apache.cordova.file>org.a

  2. android – org.apache.cordova.api不存在. PhoneGap 3.0

    我正在尝试将VideoPlayer插件(https://github.com/macdonst/VideoPlayer)添加到我的phonegapAndroid应用程序中.在编译时遇到问题:第25行:解决方法将您的导入更改为:

  3. 如何将android客户端连接到我的笔记本电脑内的Apache服务器(php)的localhost?

    我的笔记本电脑中的localhost-127.0.0.1或android10.0.0.1中的localhost?>那么,如果我想从android访问localhost来调用PHP来运行?哪个ip地址/url我需要放在Android应用程序?我需要在httpconfig中为XAMPP修改任何内容吗?解决方法使用ipconfig在笔记本电脑中找到您的IP地址.在手机中使用该地址而不是127.0.0.1.

  4. android – 在android工作室中的proguard错误

    我想在我的应用程序中使用proguard,我启用它但是当我想生成apk文件时,它给了我这个错误:我正在使用最新版本的sdk23,这是我的gradle文件:怎么了?我在这段代码中做错了什么?谢谢解决方法只需在proguard上添加:

  5. 无法修复Android Proguard返回错误代码1错误

    当我尝试在我的Android应用程序中使用proguard时只需添加到我的project.properties文件,APK导出失败并显示消息Proguard返回错误代码1这是我的project.properties文件这是错误堆栈:解决方法将这些行添加到proguard配置文件(proguard-android.txt)见ProguardTroubleshooting请注意,如果您使用您的配置文件

  6. Phonegap 2.4 Android Proguard配置

    有人有主意吗???

  7. android – 如何在sharedPreferences中分析ANR

    在sharedPreferences中遇到ANR,不知道如何定位问题.以下是trace的三个部分,其他大多数线程都是“WAIT”或“TIMED_WAIT”.由于countdownlatch.await(),“主”线程被阻止.第二个线程“pool-1-thread-1”等待fsync.最后一个是试图读一些东西.我认为第二个线程已经阻塞了主线程,因为如果这个无法完成,它将不会调用countdownla

  8. Android无法访问org.apache.http.client.HttpClient

    我正在使用androidstudio创建一个向服务器发出GET请求的应用程序.我的代码是这样的:问题是AndroidStudio标记了这一行有错误:说“无法访问org.apache.http.client.HttpClient”这是我的gradle文件:解决方法在AndroidSDK23中不推荐使用HttpClient,因为它推断,您可以在HttpURLConnection中迁移代码https:/

  9. Android L – 没有对等证书

    我开发了一个小应用程序,使用带有自签名证书的SSL连接到我的服务器.为了使它工作,我使用BouncyCastleProvider将我的证书加载到自定义密钥库中,并在我的自定义SSLSocketFactory中导入证书.Everythink在android2.3(最小sdk)到4.4.4之间运行良好.但在androidL(预览版)中,我的应用失败了:TueAug1214:34:40BRT2014:j

  10. Android Http服务器和破碎的管道

    标题可能有问题吗?

随机推荐

  1. 在airgapped(离线)CentOS 6系统上安装yum软件包

    我有一个CentOS6系统,出于安全考虑,它已经被空气泄漏.它可能从未连接到互联网,如果有,它很长时间没有更新.我想将所有.rpm软件包放在一个驱动器上,这样它们就可以脱机安装而无需查询互联网.但是,我在测试VM上遇到的问题是,即使指定了本地路径,yum仍然会挂起并尝试从在线存储库进行更新.另外,有没有办法使用yum-utils/yumdownloader轻松获取该包的所有依赖项和所有依赖项?目前

  2. centos – 命名在日志旋转后停止记录到rsyslog

    CentOS6.2,绑定9.7.3,rsyslog4.6.2我最近设置了一个服务器,我注意到在日志轮换后,named已停止记录到/var/log/messages.我认为这很奇怪,因为所有日志记录都是通过rsyslog进行的,并且named不会直接写入日志文件.这更奇怪,因为我在更新区域文件后命名了HUPed,但它仍然没有记录.在我停止并重新启动命名后,记录恢复.这里发生了什么?

  3. centos – 显示错误的磁盘大小

    对于其中一个磁盘,Df-h在我的服务器上显示错误的空白区域:Cpanel表明它只有34GB免费,但还有更多.几分钟前,我删除了超过80GB的日志文件.所以,我确信它完全错了.fdisk-l/dev/sda2也显示错误:如果没有格式化,我该怎么做才能解决这个问题?并且打开文件描述符就是它需要使用才能做到这一点.所以…使用“lsof”并查找已删除的文件.重新启动写入日志文件的服务,你很可能会看到空间可用.

  4. 如何在centos 6.9上安装docker-ce 17?

    我目前正在尝试在centOS6.9服务器上安装docker-ce17,但是,当运行yuminstalldocker-ce时,我收到以下错误:如果我用跳过的标志运行它我仍然得到相同的消息,有没有人知道这方面的方法?

  5. centos – 闲置工作站的异常负载平均值

    我有一个新的工作站,具有不寻常的高负载平均值.机器规格是:>至强cpu>256GB的RAM>4x512GBSSD连接到LSI2108RAID控制器我从livecd安装了CentOS6.564位,配置了分区,网络,用户/组,并安装了一些软件,如开发工具和MATLAB.在启动几分钟后,工作站负载平均值的值介于0.5到0.9之间.但它没有做任何事情.因此我无法理解为什么负载平均值如此之高.你能帮我诊断一下这个问题吗?

  6. centos – Cryptsetup luks – 检查内核是否支持aes-xts-plain64密码

    我在CentOS5上使用cryptsetupluks加密加密了一堆硬盘.一切都很好,直到我将系统升级到CentOS6.现在我再也无法安装磁盘了.使用我的关键短语装载:我收到此错误:在/var/log/messages中:有关如何装载的任何想法?找到解决方案问题是驱动器使用大约512个字符长的交互式关键短语加密.出于某种原因,CentOS6中的新内核模块在由旧版本创建时无法正确读取512个字符的加密密钥.似乎只会影响内核或cryptsetup的不同版本,因为在同一系统上创建和打开时,512字符的密钥将起作用

  7. centos – 大量ssh登录尝试

    22个我今天登录CentOS盒找到以下内容这是过去3天内的11次登录尝试.WTF?请注意,这是我从我的提供商处获得的全新IP,该盒子是全新的.我还没有发布任何关于此框的内容.为什么我会进行如此大量的登录尝试?是某种IP/端口扫描?基本上有4名匪徒,其中2名来自中国,1名来自香港,1名来自Verizon.这只发生在SSH上.HTTP上没有问题.我应该将罪魁祸首子网路由吗?你们有什么建议?

  8. centos – kswap使用100%的CPU,即使有100GB的RAM也可用

    >Linux内核是否应该足够智能,只需从内存中清除旧缓存页而不是启动kswap?

  9. centos – Azure将VM从A2 / 3调整为DS2 v2

    我正在尝试调整前一段时间创建的几个AzureVM,从基本的A3和标准A3到标准的DS2v2.我似乎没有能力调整到这个大小的VM.必须从头开始重建服务器会有点痛苦.如果它有所不同我在VM中运行CentOS,每个都有一个带有应用程序和操作系统的磁盘.任何人都可以告诉我是否可以在不删除磁盘的情况下删除VM,创建新VM然后将磁盘附加到新VM?

  10. centos – 广泛使用RAM时服务器计算速度减慢

    我在非常具体的情况下遇到服务器速度下降的问题.事实是:>1)我使用计算应用WRF>2)我使用双XeonE5-2620v3和128GBRAM(NUMA架构–可能与问题有关!

返回
顶部