在 Debian 8 中从 Prefork 切换到 Apache Event MPM

在 Debian 8 中从 Prefork 切换到 Apache Event MPM

使用a2query -M命令,我发现 Apache 2.4 使用 Prefork,所以今天,我想切换到 Event MPM。我使用apt-get install apache2-mpm-event命令安装了 Event MPM,并重新启动了 Apache,如下所示这里。但是a2query -M告诉我 Prefork 仍然处于启用状态。

然后,我运行a2dismod mpm_preforka2enmod mpm_event。重新启动Apache时出现错误:

Job for apache2.service failed. See 'systemctl status apache2.service' and 'jour nalctl -xn' for details.

接下来,我运行systemctl status apache2.service提示

● apache2.service - LSB: Apache2 web server
   Loaded: loaded (/etc/init.d/apache2)
  Drop-In: /lib/systemd/system/apache2.service.d
           └─forking.conf
   Active: failed (Result: exit-code) since Tue 2017-04-18 02:13:12 CEST; 32s ago
  Process: 29867 ExecStop=/etc/init.d/apache2 stop (code=exited, status=0/SUCCESS)
  Process: 11895 ExecReload=/etc/init.d/apache2 reload (code=exited, status=0/SUCCESS)
  Process: 29961 ExecStart=/etc/init.d/apache2 start (code=exited, status=1/FAILURE)

Apr 18 02:13:12 localhost apache2[29961]: Starting web server: apache2 failed!
Apr 18 02:13:12 localhost apache2[29961]: The apache2 configtest failed. .......
Apr 18 02:13:12 localhost apache2[29961]: Output of config test was:
Apr 18 02:13:12 localhost apache2[29961]: [Tue Apr 18 02:13:12.111084 2017] ....
Apr 18 02:13:12 localhost apache2[29961]: AH00013: Pre-configuration failed
Apr 18 02:13:12 localhost apache2[29961]: Action 'configtest' failed.
Apr 18 02:13:12 localhost apache2[29961]: The Apache error log may have more....
Apr 18 02:13:12 localhost systemd[1]: apache2.service: control process exit...=1
Apr 18 02:13:12 localhost systemd[1]: Failed to start LSB: Apache2 web server.
Apr 18 02:13:12 localhost systemd[1]: Unit apache2.service entered failed state.
Hint: Some lines were ellipsized, use -l to show in full.

journalctl -xn

-- Logs begin at Tue 2017-04-11 11:38:36 CEST, end at Tue 2017-04-18 02:14:01 CEST. --
Apr 18 02:13:14 localhost sshd[29955]: pam_unix(sshd:session): session closed for user root
Apr 18 02:13:28 localhost sshd[29981]: reverse mapping checking getaddrinfo for 177.64.uzpak.uz [213.230.102.177] failed - POSSIBLE BREAK-IN ATTEMPT!
Apr 18 02:13:28 localhost sshd[29981]: Accepted password for root from 213.230.102.177 port 64786 ssh2
Apr 18 02:13:28 localhost sshd[29981]: pam_unix(sshd:session): session opened for user root by (uid=0)
Apr 18 02:14:01 localhost CRON[29990]: pam_unix(cron:session): session opened for user root by (uid=0)
Apr 18 02:14:01 localhost CRON[29989]: pam_unix(cron:session): session opened for user root by (uid=0)
Apr 18 02:14:01 localhost CRON[29992]: (root) CMD (/usr/local/ispconfig/server/server.sh 2>&1 | while read line; do echo `/bin/date` "$line" >> /var/log/ispconfig/cron.
Apr 18 02:14:01 localhost CRON[29991]: (root) CMD (/usr/local/ispconfig/server/cron.sh 2>&1 | while read line; do echo `/bin/date` "$line" >> /var/log/ispconfig/cron.lo
Apr 18 02:14:01 localhost CRON[29989]: pam_unix(cron:session): session closed for user root
Apr 18 02:14:01 localhost CRON[29990]: pam_unix(cron:session): session closed for user root

我不知道自己在哪个阶段做错了。我跟着本教程 安装服务器。任何想法、建议都值得赞赏。

更新

我在我的 Apache 日志中发现了这一点:

[mpm_prefork:notice] [pid 28858] AH00163: Apache/2.4.10 (Debian) mod_fastcgi/mod_fastcgi-SNAP-0910052141 mod_fcgid/2.3.9 Phusion_Passenger/4.0.53 mod_python/3.3.1 Python/2.7.9 OpenSSL/1.0.1t configured -- resuming normal operations

[core:notice] [pid 28858] AH00094: Command line: '/usr/sbin/apache2'

[mpm_prefork:notice] [pid 28858] AH00169: caught SIGTERM, shutting down
[ 2017-04-18 02:17:19.3278 30199/7f89356db740 agents/Watchdog/Main.cpp:538 ]: Options: { 'analytics_log_user' => 'nobody', 'default_group' => 'nogroup', 'default_python' => 'python', 'default_ruby' => '/usr/bin/ruby', 'default_user' => 'nobody', 'log_level' => '0', 'max_pool_size' => '6', 'passenger_root' => '/usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini', 'passenger_version' => '4.0.53', 'pool_idle_time' => '300', 'temp_dir' => '/tmp', 'union_station_gateway_address' => 'gateway.unionstationapp.com', 'union_station_gateway_port' => '443', 'user_switching' => 'true', 'web_server_passenger_version' => '4.0.53', 'web_server_pid' => '30197', 'web_server_type' => 'apache', 'web_server_worker_gid' => '33', 'web_server_worker_uid' => '33' }

此外,apache2ctl configtest结果是:

AH00548: NameVirtualHost has no effect and will be removed in the next release /etc/apache2/sites-enabled/000-ispconfig.conf:69
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using ::1. Set the 'ServerName' directive globally to suppress this message
Syntax OK

相关内容