简体   繁体   English

apache2和supervisor的Docker tutum / wordpress容器问题

[英]Docker tutum/wordpress container issues with apache2 and supervisor

I'm new to Docker and I've been working on a Wordpress site based on the tutum/wordpress image for a couple of months now. 我是Docker的新手,并且已经在基于tutum / wordpress图像的Wordpress网站上工作了几个月。 I had edited the wordpress site as recently as last week; 上周,我编辑了wordpress网站。 however, now when I try to display the website I get nothing. 但是,现在当我尝试显示该网站时,我一无所获。

I haven't changed anything since last week when it was last working. 自上周上次工作以来,我没有进行任何更改。 I can SSH into the Ubuntu server just fine. 我可以通过SSH进入Ubuntu服务器。 I can see the container is running and I can attach to the container. 我可以看到容器正在运行,并且可以连接到容器。 Once in the container I have verified that Apache and MySQL are running. 进入容器后,我已经确认Apache和MySQL正在运行。 I can navigate through the file system and Wordpress is still there. 我可以浏览文件系统,而Wordpress仍然存在。

It's almost as if the container isn't accessible from the web but I'm at a loss as to where to begin troubleshooting. 几乎好像无法从Web上访问该容器,但是我对从哪里开始进行故障排除感到困惑。

UPDATE: It appears to be a problem with supervisord and apache. 更新:似乎是主管和Apache的问题。 The docker logs say apache is in a fatal state due to too many retries; 码头工人的日志说,由于重试过多,apache处于致命状态。 however, using sudo service apache2 status indicates that Apache is running. 但是,使用sudo service apache2 status表示Apache正在运行。 After issuing an /etc/init.d/apache2 stop command Apache is still running. 发出/etc/init.d/apache2停止命令后,Apache仍在运行。 I can't get it to stop. 我无法阻止它。 ps -A doesn't show apache running, only supervisor. ps -A不显示apache正在运行,仅显示主管。 I'm still quite confused. 我还是很困惑。

Docker Port: 80/tcp -> 0.0.0.0:80

Docker Logs: 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

I found and fixed the problem but I don't know how or why it became a problem as I've been running this server and container for a couple of months now. 我发现并解决了该问题,但是由于我已经运行此服务器和容器已有几个月了,所以我不知道它是如何或为什么成为问题。

The issue was that supervisord was configured to run apache2; 问题是,supervisor已配置为运行apache2。 however, there was also an apache2 script in /etc/init.d/ 但是,/ etc / init.d /中也有一个apache2脚本。

I did an "update-rc.d -f apache2 remove" command while in the /etc/init.d folder to remove this script from the init process on startup. 我在/etc/init.d文件夹中执行了“ update-rc.d -f apache2 remove”命令,以便在启动时从init进程中删除此脚本。 I then bounced the server and was back in business. 然后,我弹起了服务器,重新开始营业。

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

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