Docker tutum / wordpress容器问题与apache2和主管

时间:2016-05-12 20:21:18

标签: wordpress apache docker supervisord tutum

我是Docker的新手,我现在已经在基于tutum / wordpress图像的Wordpress网站上工作了几个月。我最近在上周编辑了wordpress网站;但是,现在当我尝试显示网站时,我什么都没得到。

自上周上次工作以来,我没有改变任何事情。我可以很好地SSH到Ubuntu服务器。我可以看到容器正在运行,我可以连接到容器。进入容器后,我已经验证Apache和MySQL正在运行。我可以浏览文件系统,Wordpress仍在那里。

这几乎就像容器无法通过网络访问,但我不知道从何处开始进行故障排除。

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

Docker Port: 80/tcp -> 0.0.0.0:80

Docker日志:

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

1 个答案:

答案 0 :(得分:0)

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

问题是supervisord配置为运行apache2;但是,/ etc / init.d /

中还有一个apache2脚本

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