【发布时间】:2018-02-16 23:08:20
【问题描述】:
当我尝试启动 apache 时出现此错误:
balter@balterbox:/etc/apache2$ sudo service apache2 restart
Job for apache2.service failed because the control process exited with error code.
See "systemctl status apache2.service" and "journalctl -xe" for details.
这里是日志:
balter@balterbox:/etc/apache2$ sudo systemctl status apache2.service
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Drop-In: /lib/systemd/system/apache2.service.d
└─apache2-systemd.conf
Active: failed (Result: exit-code) since Fri 2018-02-16 14:45:58 PST; 33s ago
Process: 2534 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)
CPU: 34ms
和
balter@balterbox:~$ sudo journalctl -xe | tail
Feb 16 15:05:17 balterbox sshd[2777]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=###.###.###.### user=root
Feb 16 15:05:19 balterbox sshd[2777]: Failed password for root from ###.###.###.### port 33812 ssh2
Feb 16 15:05:19 balterbox sshd[2779]: Connection closed by 114.32.120.181 port 47696 [preauth]
Feb 16 15:05:21 balterbox sshd[2777]: Failed password for root from ###.###.###.### port 33812 ssh2
Feb 16 15:05:24 balterbox sshd[2777]: Failed password for root from ###.###.###.### port 33812 ssh2
Feb 16 15:05:24 balterbox sshd[2777]: Received disconnect from ###.###.###.### port 33812:11: [preauth]
Feb 16 15:05:24 balterbox sshd[2777]: Disconnected from authenticating user root 121.18.238.39 port 33812 [preauth]
Feb 16 15:05:24 balterbox sshd[2777]: PAM 2 more authentication failures; logname= uid=0 euid=0 tty=ssh ruser= rhost=###.###.###.### user=root
Feb 16 15:05:29 balterbox sudo[2781]: balter : TTY=pts/2 ; PWD=/home/balter ; USER=root ; COMMAND=/bin/journalctl -xe
Feb 16 15:05:29 balterbox sudo[2781]: pam_unix(sudo:session): session opened for user root by balter(uid=0)
编辑: @Carlo 建议的结果:
balter@balterbox:~$ sudo apache2ctl restart
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
httpd not running, trying to start
(98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
(98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
AH00015: Unable to open logs
Action 'restart' failed.
The Apache error log may have more information.
balter@balterbox:~$ sudo apachectl restart
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
httpd not running, trying to start
(98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
(98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
AH00015: Unable to open logs
Action 'restart' failed.
The Apache error log may have more information.
balter@balterbox:~$ sudo /etc/init.d/apache2 restart
[....] Restarting apache2 (via systemctl): apache2.serviceJob for apache2.service failed because the control process exited with error code.
See "systemctl status apache2.service" and "journalctl -xe" for details.
为什么打不开日志?
【问题讨论】:
-
从 ssh 日志中删除你的 ip
-
@CarloFedericoVescovo 不错!
标签: apache permissions root