Skip to content

[BUG] Custom Wordpress Location - Error establishing a database connection #544

Open
@linkthepirate

Description

@linkthepirate

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Site loads not secure with : Error establishing a database connection

Expected Behavior

Site should load

Steps To Reproduce

I have a docker-compose.yaml which contains my entire stack and network. I have everything in the one directory so all configs are:

./service_name/config:/config

I have used swag since it was called letsencrypt so my folder says that, anyway.

I have wordpress working with the local ip and can access no problem with the actual database connection, edit and publish pages, the works.

I followed this guide: https://docs.linuxserver.io/general/swag/#hosting-a-wordpress-site

I have this volume:

/home/my_admin/apps:/apps

I noticed that when this is declared:

root /config/sites/mydomain.tld/www

the index file is directly under that, it's not the case with my wordpress instance so I modified the root to be:

root /apps/wordpress/var/www/html;

This is after I tried to get around this by using symbolic link. I saw issue 137 but the op never replied. Maybe they did something else entirely, idk.

Environment

- OS: Debian 11 Bullseye
- How docker service was installed: https://docs.docker.com/compose/install/linux/

CPU architecture

x86-64

Docker creation

wordpress:
    container_name: wordpress
    hostname: wordpress
    image: wordpress:6.7-php8.3-apache
    restart: unless-stopped
    environment:
      PUID: $PUID
      PGID: $PGID
      WORDPRESS_DB_HOST: wordpress-db
      WORDPRESS_DB_USER: wordpress
      WORDPRESS_DB_PASSWORD: $WORDPRESS_DF_DB_PASSWORD
      WORDPRESS_DB_NAME: wordpress
    volumes:
      - ./wordpress/var/www/html:/var/www/html
    networks:
      - gate
    ports:
      - 8888:80
    depends_on:
      - wordpress-db
  wordpress-db:  
    container_name: wordpress-db
    image: mariadb:10.6
    restart: unless-stopped
    environment:
      MYSQL_ROOT_PASSWORD: $WORDPRESS_DF_DB_PASSWORD
      MYSQL_DATABASE: wordpress
      MYSQL_USER: wordpress
      MYSQL_PASSWORD: $WORDPRESS_DF_DB_PASSWORD
    volumes:
      - ./wordpress-db/var/lib/mysql:/var/lib/mysql
    networks:
      - gate

Container logs

To support the app dev(s) visit:
Certbot: https://supporters.eff.org/donate/support-work-on-certbot

To support LSIO projects visit:
https://www.linuxserver.io/donate/

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    1000
User GID:    1000
───────────────────────────────────────
Linuxserver.io version: 3.1.0-ls360
Build-date: 2025-01-25T03:21:46+00:00
───────────────────────────────────────

using keys found in /config/keys
**** The following active confs have different version dates than the samples that are shipped. ****
**** This may be due to user customization or an update to the samples. ****
**** You should compare the following files to the samples in the same folder and update them. ****
**** Use the link at the top of the file to view the changelog. ****
┌────────────┬────────────┬────────────────────────────────────────────────────────────────────────┐
│  old date  │  new date  │ path                                                                   │
├────────────┼────────────┼────────────────────────────────────────────────────────────────────────┤
│ 2023-08-13 │ 2024-12-06 │ /config/nginx/ssl.conf                                                 │
│ 2020-05-23 │ 2024-03-14 │ /config/nginx/authelia-location.conf                                   │
│ 2018-08-10 │ 2022-08-20 │ /config/nginx/ldap-server.conf                                         │
│ 2020-05-23 │ 2024-03-16 │ /config/nginx/authelia-server.conf                                     │
│ 2023-06-05 │ 2024-12-17 │ /config/nginx/site-confs/default.conf                                  │
│ 2023-04-13 │ 2024-12-17 │ /config/nginx/nginx.conf                                               │
└────────────┴────────────┴────────────────────────────────────────────────────────────────────────┘
**** The following site-confs have extensions other than .conf ****
**** This may be due to user customization. ****
**** You should review the files and rename them to use the .conf extension or remove them. ****
**** nginx.conf will only include site-confs with the .conf extension. ****
/config/nginx/site-confs/default.conf.old
Variables set:
PUID=1000
PGID=1000
TZ=$TIMEZONE
URL=domain1.tld
SUBDOMAINS=wildcard
EXTRA_DOMAINS=domain2.tld
ONLY_SUBDOMAINS=false
VALIDATION=dns
CERTPROVIDER=
DNSPLUGIN=$PROVIDER
EMAIL=
STAGING=

Using Let's Encrypt as the cert provider
SUBDOMAINS entered, processing
Wildcard cert for domain1.tld will be requested
EXTRA_DOMAINS entered, processing
Extra domains processed are: domain2.tld
No e-mail address entered or address invalid
dns validation via digitalocean plugin is selected
Certificate exists; parameters unchanged; starting nginx
The cert does not expire within the next day. Letting the cron script handle the renewal attempts overnight (2:08am).
/config/nginx/geoip2.conf exists.
        Please migrate to https://github.com/linuxserver/docker-mods/tree/swag-maxmind
/config/nginx/ldap.conf exists.
        Please apply any customizations to /config/nginx/ldap-server.conf
        Ensure your configs are updated and remove /config/nginx/ldap.conf
        If you do not use this config, simply remove it.
[custom-init] No custom files found, skipping...
[ls.io-init] done.
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/site-confs/default.conf:15
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/site-confs/default.conf:16
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/proxy-confs/airsonic.subdomain.conf:7
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/proxy-confs/airsonic.subdomain.conf:8
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/proxy-confs/audiobookshelf.subdomain.conf:12
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/proxy-confs/audiobookshelf.subdomain.conf:13
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/proxy-confs/bookstack.subdomain.conf:15
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/proxy-confs/bookstack.subdomain.conf:16
2025/02/05 17:17:06 [warn] 791#791: protocol options redefined for 0.0.0.0:443 in /config/nginx/proxy-confs/calibre-web.subdomain.conf:13
2025/02/05 17:17:06 [warn] 791#791: protocol options redefined for [::]:443 in /config/nginx/proxy-confs/calibre-web.subdomain.conf:14
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/proxy-confs/emby.subdomain.conf:11
2025/02/05 17:17:06 [warn] 791#791: protocol options redefined for 0.0.0.0:443 in /config/nginx/proxy-confs/emby.subdomain.conf:11
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/proxy-confs/emby.subdomain.conf:12
2025/02/05 17:17:06 [warn] 791#791: protocol options redefined for [::]:443 in /config/nginx/proxy-confs/emby.subdomain.conf:12
2025/02/05 17:17:06 [warn] 791#791: protocol options redefined for 0.0.0.0:443 in /config/nginx/proxy-confs/filebrowser.subdomain.conf:11
2025/02/05 17:17:06 [warn] 791#791: protocol options redefined for [::]:443 in /config/nginx/proxy-confs/filebrowser.subdomain.conf:12
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/proxy-confs/grocy.subdomain.conf:6
2025/02/05 17:17:06 [warn] 791#791: protocol options redefined for 0.0.0.0:443 in /config/nginx/proxy-confs/grocy.subdomain.conf:6
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/proxy-confs/grocy.subdomain.conf:7
2025/02/05 17:17:06 [warn] 791#791: protocol options redefined for [::]:443 in /config/nginx/proxy-confs/grocy.subdomain.conf:7
2025/02/05 17:17:06 [warn] 791#791: protocol options redefined for 0.0.0.0:443 in /config/nginx/proxy-confs/guacamole.subdomain.conf:11
2025/02/05 17:17:06 [warn] 791#791: protocol options redefined for [::]:443 in /config/nginx/proxy-confs/guacamole.subdomain.conf:12
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/proxy-confs/navidrome.subdomain.conf:14
2025/02/05 17:17:06 [warn] 791#791: protocol options redefined for 0.0.0.0:443 in /config/nginx/proxy-confs/navidrome.subdomain.conf:14
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/proxy-confs/navidrome.subdomain.conf:15
2025/02/05 17:17:06 [warn] 791#791: protocol options redefined for [::]:443 in /config/nginx/proxy-confs/navidrome.subdomain.conf:15
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/proxy-confs/nextcloud.subdomain.conf:18
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/proxy-confs/nextcloud.subdomain.conf:19
2025/02/05 17:17:06 [warn] 791#791: protocol options redefined for 0.0.0.0:443 in /config/nginx/proxy-confs/ombi.subdomain.conf:10
2025/02/05 17:17:06 [warn] 791#791: protocol options redefined for [::]:443 in /config/nginx/proxy-confs/ombi.subdomain.conf:11
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/proxy-confs/organizr.subdomain.conf:6
2025/02/05 17:17:06 [warn] 791#791: protocol options redefined for 0.0.0.0:443 in /config/nginx/proxy-confs/organizr.subdomain.conf:6
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/proxy-confs/organizr.subdomain.conf:7
2025/02/05 17:17:06 [warn] 791#791: protocol options redefined for [::]:443 in /config/nginx/proxy-confs/organizr.subdomain.conf:7
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/proxy-confs/photoprism.subdomain.conf:11
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/proxy-confs/photoprism.subdomain.conf:12
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/proxy-confs/photoprismprv.subdomain.conf:11
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/proxy-confs/photoprismprv.subdomain.conf:12
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/proxy-confs/photoview.subdomain.conf:12
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/proxy-confs/photoview.subdomain.conf:13
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/proxy-confs/plex.subdomain.conf:10
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/proxy-confs/plex.subdomain.conf:11
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/proxy-confs/podgrab.subdomain.conf:6
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/proxy-confs/podgrab.subdomain.conf:7
2025/02/05 17:17:06 [warn] 791#791: protocol options redefined for 0.0.0.0:443 in /config/nginx/proxy-confs/tautulli.subdomain.conf:6
2025/02/05 17:17:06 [warn] 791#791: protocol options redefined for [::]:443 in /config/nginx/proxy-confs/tautulli.subdomain.conf:7
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/proxy-confs/wizarr.subdomain.conf:6
2025/02/05 17:17:06 [warn] 791#791: protocol options redefined for 0.0.0.0:443 in /config/nginx/proxy-confs/wizarr.subdomain.conf:6
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/proxy-confs/wizarr.subdomain.conf:7
2025/02/05 17:17:06 [warn] 791#791: protocol options redefined for [::]:443 in /config/nginx/proxy-confs/wizarr.subdomain.conf:7
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/site-confs/domain2.tld.conf:15
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/site-confs/domain2.tld.conf:16
2025/02/05 17:17:06 [warn] 791#791: conflicting server name "media.*" on 0.0.0.0:80, ignored
2025/02/05 17:17:06 [warn] 791#791: conflicting server name "" on 0.0.0.0:80, ignored
2025/02/05 17:17:06 [warn] 791#791: conflicting server name "media.*" on [::]:80, ignored
2025/02/05 17:17:06 [warn] 791#791: conflicting server name "" on [::]:80, ignored

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    • Status

      Issues

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions