0

我是 Docker 新手,几个月来我一直在基于 tutum/wordpress 图像开发一个 Wordpress 网站。就在上周,我编辑了 wordpress 网站;但是,现在当我尝试显示该网站时,我什么也得不到。

自上周上次工作以来,我没有改变任何东西。我可以通过 SSH 连接到 Ubuntu 服务器。我可以看到容器正在运行,并且可以附加到容器。进入容器后,我已验证 Apache 和 MySQL 正在运行。我可以浏览文件系统并且 Wordpress 仍然存在。

几乎就像无法从 Web 访问容器一样,但我不知道从哪里开始进行故障排除。

更新:supervisord 和 apache 似乎有问题。docker 日志说 apache 由于重试次数过多而处于致命状态;但是,使用 sudo service apache2 status 表示 Apache 正在运行。发出 /etc/init.d/apache2 停止命令后,Apache 仍在运行。我不能让它停下来。ps -A 不显示 apache 正在运行,只有主管。我还是很困惑。

Docker Port: 80/tcp -> 0.0.0.0:80

码头工人日志:

2016-05-12 20:01:39,534 INFO waiting for mysqld to die
=> Using an existing volume of MySQL
/usr/lib/python2.7/dist-packages/supervisor/options.py:295: UserWarning: Supervisord is running as root and it is searching for its configuration file in default locations (including its current working directory); you probably want to specify a "-c" argument specifying an absolute path to a configuration file for improved security.
  'Supervisord is running as root and it is searching '
2016-05-12 20:02:16,501 CRIT Supervisor running as root (no user in config file)
2016-05-12 20:02:16,501 WARN Included extra file "/etc/supervisor/conf.d/supervisord-mysqld.conf" during parsing
2016-05-12 20:02:16,501 WARN Included extra file "/etc/supervisor/conf.d/supervisord-apache2.conf" during parsing
Unlinking stale socket /var/run/supervisor.sock
2016-05-12 20:02:16,839 INFO RPC interface 'supervisor' initialized
2016-05-12 20:02:16,839 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2016-05-12 20:02:16,839 INFO supervisord started with pid 1
2016-05-12 20:02:17,847 INFO spawned: 'mysqld' with pid 9
2016-05-12 20:02:17,853 INFO spawned: 'apache2' with pid 10
2016-05-12 20:02:17,957 INFO exited: apache2 (exit status 0; not expected)
2016-05-12 20:02:19,303 INFO success: mysqld entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2016-05-12 20:02:19,308 INFO spawned: 'apache2' with pid 392
2016-05-12 20:02:19,396 INFO exited: apache2 (exit status 0; not expected)
2016-05-12 20:02:21,404 INFO spawned: 'apache2' with pid 394
2016-05-12 20:02:21,491 INFO exited: apache2 (exit status 0; not expected)
2016-05-12 20:02:24,500 INFO spawned: 'apache2' with pid 395
2016-05-12 20:02:24,586 INFO exited: apache2 (exit status 0; not expected)
2016-05-12 20:02:25,588 INFO gave up: apache2 entered FATAL state, too many start retries too quickly
4

1 回答 1

0

我发现并解决了这个问题,但我不知道它是如何或为什么成为问题的,因为我已经运行这个服务器和容器几个月了。

问题是supervisord被配置为运行apache2;但是,/etc/init.d/ 中还有一个 apache2 脚本

我在 /etc/init.d 文件夹中执行了“update-rc.d -f apache2 remove”命令,以便在启动时从 init 进程中删除此脚本。然后我反弹了服务器并恢复了业务。

于 2016-05-12T22:42:35.687 回答