简体   繁体   English

在 ubuntu 中启动 apache2 服务器时出错

[英]Error while starting apache2 server in ubuntu

systemctl start apache2.service systemctl start apache2.service

Getting this error:-收到此错误:-

Job for apache2.service failed because the control process exited with error code. apache2.service 的作业失败,因为控制进程以错误代码退出。 See "systemctl status apache2.service" and "journalctl -xe" for details.有关详细信息,请参阅“systemctl status apache2.service”和“journalctl -xe”。

Logs of systemctl status apache2.service systemctl状态日志apache2.service

● apache2.service - The Apache HTTP Server
   Loaded: loaded (/lib/systemd/system/apache2.service; disabled; vendor preset: enabled)
  Drop-In: /lib/systemd/system/apache2.service.d
           └─apache2-systemd.conf
   Active: failed (Result: exit-code) since Tue 2020-06-02 08:24:55 IST; 49s ago
  Process: 9759 ExecStart=/usr/sbin/apachectl start (code=exited, status=127)

Jun 02 08:24:55 GS-4996 systemd[1]: Starting The Apache HTTP Server...
Jun 02 08:24:55 GS-4996 apachectl[9759]: /usr/sbin/apachectl: 174: /usr/sbin/apachectl: /usr/sbin/apache2: not found
Jun 02 08:24:55 GS-4996 apachectl[9759]: Action 'start' failed.
Jun 02 08:24:55 GS-4996 apachectl[9759]: The Apache error log may have more information.
Jun 02 08:24:55 GS-4996 systemd[1]: apache2.service: Control process exited, code=exited status=127
Jun 02 08:24:55 GS-4996 systemd[1]: apache2.service: Failed with result 'exit-code'.
Jun 02 08:24:55 GS-4996 systemd[1]: Failed to start The Apache HTTP Server.

Looks like the apache2 file is not available on server.看起来 apache2 文件在服务器上不可用。 /usr/sbin/apache2 is provided by apache2-bin. /usr/sbin/apache2 由 apache2-bin 提供。 apache2-bin is a dependency of the apache2 package, so apache2 will not work properly without it. apache2-bin 是 apache2 package 的依赖项,因此没有它 apache2 将无法正常工作。 Open the terminal and type:打开终端并输入:

sudo apt install --reinstall apache2-bin   
sudo service apache2 start  

Can you please attach error logs or the output of "systemctl status apache2.service"您能否附上错误日志或“systemctl status apache2.service”的 output

My Best Solution No Need Restart.. After Long Time of se:)我最好的解决方案无需重新启动.. 经过很长时间的 se :)

sudo apt-get --reinstall install apache2-bin

Step 1: Stop nginx & Start apache第 1 步:停止 nginx 并启动 apache

That's it.而已。

service nginx stop
systemctl restart postgresql
systemctl restart apache2
systemctl status apache2.service

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM