【问题标题】:apache2 not responding in terminalapache2在终端没有响应
【发布时间】:2015-05-03 23:59:15
【问题描述】:

我在 Ubuntu 中遇到了 apache2 的一些问题,因此决定卸载并重新安装它。现在的问题是,当我尝试

which apache2

甚至

sudo service apache2 start

我完全没有得到任何回应。我尝试检查我的一个 PHP 脚本的元素,Failed to load resource: net::ERR_CONNECTION_REFUSED 出现在日志中。似乎有效的一个命令是

whereis apache2

返回 apache2:/etc/apache2 /usr/share/apache2

有没有办法解决这个问题?

【问题讨论】:

  • 您需要至少包含您正在使用的操作系统/发行版作为标签,以便知道 disto 的人可以提供一些帮助。
  • 抱歉,添加了更改
  • 如果这是服务器的情况,您的服务器可能已被入侵并可能包含 rootkit。我有一个类似的情况,rsync 没有出现在 which 命令中。解决方案是恢复您的重要文件并启动新服务器
  • 很抱歉,我该如何恢复我的重要文件?

标签: ubuntu apache2


【解决方案1】:

你确定你尝试了以下(也有以下顺序)?

首先卸载 Apache

sudo apt-get --purge remove apache2
sudo apt-get autoremove

然后,正常安装...

sudo apt-get install apache2
sudo /etc/init.d/apache2 restart

然后转到终端并检查(就像我在终端中所做的那样):

andreas@ubuntu:~/Desktop$ ps -ALL |grep apache2
1564  1564 ?        00:00:00 apache2
...

最后从您的浏览器中检查:

http://localhost

【讨论】:

  • 好的,我尝试再次执行命令并按照您的步骤操作,但 ps -ALL |grep apache2 和 localhost 没有响应
  • 你试过sudo apt-get update然后重启吗?
  • 是的,还是没有回应
  • 我担心您的系统上仍有旧 apache2 安装的文件。你知道如何在与默认端口(80)不同的端口(比如 8080)中设置 apache 吗?
  • 我找到了这个答案 (stackoverflow.com/questions/3940909/…) 但我没有 httpd.conf。我检查了 apache2.conf 并且 listen 80 也不存在。会不会是别的地方?
猜你喜欢
  • 1970-01-01
  • 2021-12-05
  • 2013-11-17
  • 2020-08-19
  • 1970-01-01
  • 2015-09-29
  • 1970-01-01
  • 2021-01-30
相关资源
最近更新 更多