我正在尝试在我的 Ubuntu 18.04 虚拟盒上安装 LAMP 堆栈。虽然我正在运行 Geth(以太坊客户端),但该盒基本上是全新安装的。
当我运行命令时sudo apt-get install apache2
,我收到错误,安装失败,代码为 127。Apache 错误日志中没有任何内容告诉我此安装失败的原因。这是我的错误日志:
Setting up apache2 (2.4.29-1ubuntu4.5) ...
Job for apache2.service failed because the control process exited with error code.
See "systemctl status apache2.service" and "journalctl -xe" for details.
invoke-rc.d: initscript apache2, action "start" failed.
● 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 Wed 2019-01-16 22:47:47 UTC; 7ms ago
Process: 3978 ExecStart=/usr/sbin/apachectl start (code=exited, status=127)
Main PID: 8972 (code=exited, status=0/SUCCESS)
Jan 16 22:47:47 EthereumDaemon systemd[1]: Starting The Apache HTTP Server...
Jan 16 22:47:47 EthereumDaemon apachectl[3978]: /usr/sbin/apachectl: 174: /usr/sbin/apachectl: /usr/sbin/apache2: not found
Jan 16 22:47:47 EthereumDaemon apachectl[3978]: Action 'start' failed.
Jan 16 22:47:47 EthereumDaemon apachectl[3978]: The Apache error log may have more information.
Jan 16 22:47:47 EthereumDaemon systemd[1]: apache2.service: Control process exited, code=exited status=127
Jan 16 22:47:47 EthereumDaemon systemd[1]: apache2.service: Failed with result 'exit-code'.
Jan 16 22:47:47 EthereumDaemon systemd[1]: Failed to start The Apache HTTP Server.
Processing triggers for ureadahead (0.100.0-20) ...
Processing triggers for systemd (237-3ubuntu10.3) ...
Processing triggers for man-db (2.8.3-2) ...
当运行建议的命令systemctl status apache2.service
以了解详细信息时,我只收到上述错误信息。
我究竟做错了什么?
答案1
你得到答案了吗?我认为你可能从 /usr/sbin/apache 代码中删除目录 = 127 启动服务路径未找到只需执行 ''' ==> sudo apt install -reinstall apache2-bin
''' 它会修复
如果你也同时运行 nginx,那么将/etc/apach2/port.conf
文件中的 apache 端口从 80 更改为你想要的端口,它就会运行