最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

apache - Wordpress docker with empty responses to HTTP requests

programmeradmin1浏览0评论

I originally posted this on Stack Overflow but felt it would be better here.

I've got a Wordpress docker container that isn't really responding. Trying to access it from the browser results in an empty page. No 404 or anything. Trying curl from either a computer on the network, or the server itself returns an empty response as well.

I've done a docker exec -ti container bash into it to try and run curl from within, and it's also empty. /var/www/html is populated, and the single entry in /etc/apache2/sites-enabled is pointing to the /var/www/html directory.

There are no errors in /var/log/apache2/errors to speak of, which isn't helpful.

I've done the usual netstat -tlpn to verify that the server is listening on the correct port, and it is. I've also changed the addresses in the wp database to localhost, to see if that was causing the issue, but that didn't change anything.

Here's my docker-compose.yml, which is very simple

version: '3.3'

services:
   db:
     image: mysql:5.7
     volumes:
       - db_data:/var/lib/mysql
     restart: always
     environment:
       MYSQL_ROOT_PASSWORD: PASSWORD
       MYSQL_DATABASE: DBNAME
       MYSQL_USER: USERNAME
       MYSQL_PASSWORD: PASSWORD

   wordpress:
     depends_on:
       - db
     image: wordpress:latest
     volumes:
       - ./upload.ini:/usr/local/etc/php/conf.d/uploads.ini
     ports:
       - "80:80"
     restart: always
     environment:
       WORDPRESS_DB_HOST: db:PORT
       WORDPRESS_DB_USER: USERNAME
       WORDPRESS_DB_PASSWORD: PASSWORD
       WORDPRESS_DB_NAME: DBNAME
volumes:
    db_data: {}

I'm at a loss as to what to check next, and am hoping to find ideas here.

I originally posted this on Stack Overflow but felt it would be better here.

I've got a Wordpress docker container that isn't really responding. Trying to access it from the browser results in an empty page. No 404 or anything. Trying curl from either a computer on the network, or the server itself returns an empty response as well.

I've done a docker exec -ti container bash into it to try and run curl from within, and it's also empty. /var/www/html is populated, and the single entry in /etc/apache2/sites-enabled is pointing to the /var/www/html directory.

There are no errors in /var/log/apache2/errors to speak of, which isn't helpful.

I've done the usual netstat -tlpn to verify that the server is listening on the correct port, and it is. I've also changed the addresses in the wp database to localhost, to see if that was causing the issue, but that didn't change anything.

Here's my docker-compose.yml, which is very simple

version: '3.3'

services:
   db:
     image: mysql:5.7
     volumes:
       - db_data:/var/lib/mysql
     restart: always
     environment:
       MYSQL_ROOT_PASSWORD: PASSWORD
       MYSQL_DATABASE: DBNAME
       MYSQL_USER: USERNAME
       MYSQL_PASSWORD: PASSWORD

   wordpress:
     depends_on:
       - db
     image: wordpress:latest
     volumes:
       - ./upload.ini:/usr/local/etc/php/conf.d/uploads.ini
     ports:
       - "80:80"
     restart: always
     environment:
       WORDPRESS_DB_HOST: db:PORT
       WORDPRESS_DB_USER: USERNAME
       WORDPRESS_DB_PASSWORD: PASSWORD
       WORDPRESS_DB_NAME: DBNAME
volumes:
    db_data: {}

I'm at a loss as to what to check next, and am hoping to find ideas here.

Share Improve this question asked Feb 24, 2021 at 11:17 Ross WardrupRoss Wardrup 1374 bronze badges 9
  • The WP container should have a license.txt and readme.html in /var/www/html, can you access them through browser/curl? – kero Commented Feb 24, 2021 at 11:24
  • I cannot. Tried both files to no avail. – Ross Wardrup Commented Feb 24, 2021 at 11:26
  • I take that back. In my early morning stupor, I reversed the extensions. The files are loadable. – Ross Wardrup Commented Feb 24, 2021 at 11:36
  • I've verified that it's loading PHP files with a phpinfo() test. – Ross Wardrup Commented Feb 24, 2021 at 11:47
  • So the server is running, PHP is working. Only WordPress itself is making problems? – kero Commented Feb 24, 2021 at 11:49
 |  Show 4 more comments

1 Answer 1

Reset to default 1

I believe the answer was a messed up entry in either site_url or home within the MySQL database. I changed those settings and the issue was resolved.

发布评论

评论列表(0)

  1. 暂无评论