Apache2 无法在 Ubuntu Server 17.04 上启动

Apache2 无法在 Ubuntu Server 17.04 上启动

无法重新启动 apache2。

检查sudo netstat -tulpn | grep :80得到这个结果:

tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      1627/nginx: master  
tcp6       0      0 127.0.0.1:8005          :::*                    LISTEN      4486/java           
tcp6       0      0 :::8080                 :::*                    LISTEN      4486/java           
tcp6       0      0 :::80                   :::*                    LISTEN      1627/nginx: master

尝试重新加载 apache2 后systemctl reload apache2收到以下消息:

==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===   
Authentication is required to reload 'apache2.service'.  
Authenticating as: Name Surname,,, (Username)  
Password:   
==== AUTHENTICATION COMPLETE ===  
apache2.service is not active, cannot reload.

尝试多次重新加载服务、安装/更新服务:

  • OpenSSH 服务器
  • PHP7
  • MySQL
  • phpMyAdmin
  • 阿帕奇 Tomcat8
  • FTP(vsftpd)

其他可以帮助解决我的问题检查状态的消息
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 Mon 2017-04-24 20:03:47 CEST; 29min ago   
  Process: 6623 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)<br><br>
Apr 24 20:03:47 mcServer apachectl[6623]: AH00526: Syntax error on line 1 of /etc/apache2/sites-enabled/mysite.conf:  
Apr 24 20:03:47 mcServer apachectl[6623]: Invalid command '[email protected]', perhaps misspelled or defined by a module not included in the server configuration  
Apr 24 20:03:47 mcServer apachectl[6623]: Action 'start' failed.  
Apr 24 20:03:47 mcServer apachectl[6623]: The Apache error log may have more information.  
Apr 24 20:03:47 mcServer systemd[1]: apache2.service: Control process exited, code=exited status=1  
Apr 24 20:03:47 mcServer systemd[1]: Failed to start The Apache HTTP Server.  
Apr 24 20:03:47 mcServer systemd[1]: apache2.service: Unit entered failed state.  
Apr 24 20:03:47 mcServer systemd[1]: apache2.service: Failed with result 'exit-code'.  
Apr 24 20:18:33 mcServer systemd[1]: apache2.service: Unit cannot be reloaded because it is inactive.  
Apr 24 20:18:35 mcServer systemd[1]: apache2.service: Unit cannot be reloaded because it is inactive.

附加说明
我正在尝试为自己的基于 Web(php)的应用程序设置一个 WebHost 服务器。

答案1

通过在@Nadav Tasher 的支持下解决问题:

Nginx 无法正常工作!两个服务(nginx-apache2)无法同时工作!运行 Apache2 已永久修复此问题!

相关内容