Giter Site home page Giter Site logo

wordpress-nginx-docker's Introduction

WordPress (FPM Edition) - Docker

Notes on deploying a single site WordPress FPM Edition instance as a docker deployment orchestrated by Docker Compose.

  • Use the FPM version of WordPress (v5-fpm)
  • Use MySQL as the database (v8)
  • Use Nginx as the web server (v1)
  • Use Adminer as the database management tool (v4)
  • Include self-signed SSL certificate (Let's Encrypt localhost format)

DISCLAIMER: The code herein may not be up to date nor compliant with the most recent package and/or security notices. The frequency at which this code is reviewed and updated is based solely on the lifecycle of the project for which it was written to support, and is not actively maintained outside of that scope. Use at your own risk.

Table of contents

Overview

WordPress is a free and open source blogging tool and a content management system (CMS) based on PHP and MySQL, which runs on a web hosting service. Features include a plugin architecture and a template system.

This variant contains PHP-FPM, which is a FastCGI implementation for PHP.

  • See the PHP-FPM website for more information about PHP-FPM.
  • In order to use this image variant, some kind of reverse proxy (such as NGINX, Apache, or other tool which speaks the FastCGI protocol) will be required.

Host requirements

Both Docker and Docker Compose are required on the host to run this code

Configuration

Copy the env.template file as .env and populate according to your environment

# docker-compose environment file
#
# When you set the same environment variable in multiple files,
# here’s the priority used by Compose to choose which value to use:
#
#  1. Compose file
#  2. Shell environment variables
#  3. Environment file
#  4. Dockerfile
#  5. Variable is not defined

# Wordpress Settings
export WORDPRESS_LOCAL_HOME=./wordpress
export WORDPRESS_UPLOADS_CONFIG=./config/uploads.ini
export WORDPRESS_DB_HOST=database:3306
export WORDPRESS_DB_NAME=wordpress
export WORDPRESS_DB_USER=wordpress
export WORDPRESS_DB_PASSWORD=password123!

# MySQL Settings
export MYSQL_LOCAL_HOME=./dbdata
export MYSQL_DATABASE=${WORDPRESS_DB_NAME}
export MYSQL_USER=${WORDPRESS_DB_USER}
export MYSQL_PASSWORD=${WORDPRESS_DB_PASSWORD}
export MYSQL_ROOT_PASSWORD=rootpassword123!

# Nginx Settings
export NGINX_CONF=./nginx/default.conf
export NGINX_SSL_CERTS=./ssl
export NGINX_LOGS=./logs/nginx

# User Settings
# TBD

Modify nginx/default.conf and replace $host and 8443 with your Domain Name and exposed HTTPS Port throughout the file

# default.conf
# redirect to HTTPS
server {
    listen 80;
    listen [::]:80;
    server_name $host;
    location / {
        # update port as needed for host mapped https
        rewrite ^ https://$host:8443$request_uri? permanent;
    }
}

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name $host;
    index index.php index.html index.htm;
    root /var/www/html;
    server_tokens off;
    client_max_body_size 75M;

    # update ssl files as required by your deployment
    ssl_certificate /etc/ssl/fullchain.pem;
    ssl_certificate_key /etc/ssl/privkey.pem;

    # logging
    access_log /var/log/nginx/wordpress.access.log;
    error_log /var/log/nginx/wordpress.error.log;

    # some security headers ( optional )
    add_header X-Frame-Options "SAMEORIGIN" always;
    add_header X-XSS-Protection "1; mode=block" always;
    add_header X-Content-Type-Options "nosniff" always;
    add_header Referrer-Policy "no-referrer-when-downgrade" always;
    add_header Content-Security-Policy "default-src * data: 'unsafe-eval' 'unsafe-inline'" always;

    location / {
        try_files $uri $uri/ /index.php$is_args$args;
    }

    location ~ \.php$ {
        try_files $uri = 404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass wordpress:9000;
        fastcgi_index index.php;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_path_info;
    }

    location ~ /\.ht {
        deny all;
    }

    location = /favicon.ico {
        log_not_found off; access_log off;
    }

    location = /favicon.svg {
        log_not_found off; access_log off;
    }

    location = /robots.txt {
        log_not_found off; access_log off; allow all;
    }

    location ~* \.(css|gif|ico|jpeg|jpg|js|png)$ {
        expires max;
        log_not_found off;
    }
}

Modify the config/uploads.ini file if the preset values are not to your liking (defaults shown below)

file_uploads = On
memory_limit = 256M
upload_max_filesize = 75M
post_max_size = 75M
max_execution_time = 600

Included uploads.ini file allows for Maximum upload file size: 75 MB

Deploy

Once configured the containers can be brought up using Docker Compose

  1. Set the environment variables and pull the images

    source .env
    docker-compose pull
  2. Bring up the Database and allow it a moment to create the WordPress user and database tables

    docker-compose up -d database

    You will know it's ready when you see something like this in the docker logs

    $ docker-compose logs database
    wp-database  | 2022-01-28 13:40:18+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.28-1debian10 started.
    wp-database  | 2022-01-28 13:40:18+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
    wp-database  | 2022-01-28 13:40:18+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.28-1debian10 started.
    wp-database  | 2022-01-28 13:40:18+00:00 [Note] [Entrypoint]: Initializing database files
    ...
    wp-database  | 2022-01-28 13:40:28+00:00 [Note] [Entrypoint]: Creating database wordpress
    wp-database  | 2022-01-28 13:40:28+00:00 [Note] [Entrypoint]: Creating user wordpress
    wp-database  | 2022-01-28 13:40:28+00:00 [Note] [Entrypoint]: Giving user wordpress access to schema wordpress
    wp-database  |
    wp-database  | 2022-01-28 13:40:28+00:00 [Note] [Entrypoint]: Stopping temporary server
    wp-database  | 2022-01-28T13:40:29.002886Z 13 [System] [MY-013172] [Server] Received SHUTDOWN from user root. Shutting down mysqld (Version: 8.0.28).
    wp-database  | 2022-01-28T13:40:30.226306Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.28)  MySQL Community Server - GPL.
    wp-database  | 2022-01-28 13:40:31+00:00 [Note] [Entrypoint]: Temporary server stopped
    wp-database  |
    wp-database  | 2022-01-28 13:40:31+00:00 [Note] [Entrypoint]: MySQL init process done. Ready for start up.
    wp-database  |
    ...
    wp-database  | 2022-01-28T13:40:32.061642Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /var/run/mysqld/mysqlx.sock
    wp-database  | 2022-01-28T13:40:32.061790Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.28'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  MySQL Community Server - GPL.
  3. Bring up the WordPress and Nginx containers

    docker-compose up -d wordpress nginx

    After a few moments the containers should be observed as running

    $ docker-compose ps
    NAME                COMMAND                  SERVICE             STATUS              PORTS
    wp-database         "docker-entrypoint.s…"   database            running             33060/tcp
    wp-nginx            "/docker-entrypoint.…"   nginx               running             0.0.0.0:8080->80/tcp, 0.0.0.0:8443->443/tcp
    wp-wordpress        "docker-entrypoint.s…"   wordpress           running             9000/tcp

The WordPress application can be reached at the designated host and port (e.g. https://127.0.0.1:8443).

  • NOTE: you will likely have to acknowledge the security risk if using the included self-signed certificate.

Complete the initial WordPress installation process, and when completed you should see something similar to this.

Adminer

An Adminer configuration has been included in the docker-compose.yml definition file, but commented out. Since it bypasses Nginx it is recommended to only use Adminer as needed, and to not let it run continuously.

Expose Adminer by uncommenting the adminer section of the docker-compose.yml file

...
  # adminer - bring up only as needed - bypasses nginx
  adminer:
    # default port 8080
    image: adminer:4
    container_name: wp-adminer
    restart: unless-stopped
    networks:
      - wordpress
    depends_on:
      - database
    ports:
      - "9000:8080"
...

And run the adminer container

$ docker-compose up -d adminer
[+] Running 2/2
 ⠿ Container wp-database  Running                                                                                                      0.0s
 ⠿ Container wp-adminer   Started                                                                                                      0.9s

Since Adminer is bypassing our Nginx configuration it will be running over HTTP in plain text on port 9000 (e.g. http://127.0.0.1:9000/)

Enter the connection information for your Database and you should see something similar to image below.

Example connection information:

  • System: MySQL

  • Server: database

  • Username: wordpress

  • Password: password123!

  • Database: wordpress

    NOTE: Since adminer is defined in the same docker-compose file as the MySQL Database it will "understand" the Server reference as database, otherwise this would need to be a formal URL reference

When finished, stop and remove the adminer container.

$ docker-compose stop adminer
[+] Running 1/1
 ⠿ Container wp-adminer  Stopped                                                                                                       0.1s
$ docker-compose rm -fv adminer
Going to remove wp-adminer
[+] Running 1/0
 ⠿ Container wp-adminer  Removed                                                                                                       0.0s

Teardown

For a complete teardown all containers must be stopped and removed along with the volumes and network that were created for the application containers

Commands

docker-compose stop
docker-compose rm -fv
docker-network rm wp-wordpress
# removal calls may require sudo rights depending on file permissions
rm -rf ./wordpress
rm -rf ./dbdata
rm -rf ./logs

Expected output

$ docker-compose stop
[+] Running 3/3
 ⠿ Container wp-nginx      Stopped                                                                                                     0.3s
 ⠿ Container wp-wordpress  Stopped                                                                                                     0.2s
 ⠿ Container wp-database   Stopped                                                                                                     0.8s
$ docker-compose rm -fv
Going to remove wp-nginx, wp-wordpress, wp-database
[+] Running 3/0
 ⠿ Container wp-nginx      Removed                                                                                                     0.0s
 ⠿ Container wp-database   Removed                                                                                                     0.0s
 ⠿ Container wp-wordpress  Removed                                                                                                     0.0s
$ docker network rm wp-wordpress
wp-wordpress
$ rm -rf ./wordpress
$ rm -rf ./dbdata
$ rm -rf ./logs

References


Notes

General information regarding standard Docker deployment of WordPress for reference purposes

Let's Encrypt SSL Certificate

Use: https://github.com/RENCI-NRIG/ez-letsencrypt - A shell script to obtain and renew Let's Encrypt certificates using Certbot's --webroot method of certificate issuance.

Error establishing database connection

This can happen when the wordpress container attempts to reach the database container prior to it being ready for a connection.

This will sometimes resolve itself once the database fully spins up, but generally it's advised to start the database first and ensure it's created all of its user and wordpress tables and then start the WordPress service.

Port Mapping

Neither the wordpress container nor the database container have publicly exposed ports. They are running on the host using a docker defined network which provides the containers with access to each others ports, but not from the host.

If you wish to expose the ports to the host, you'd need to alter the stanzas for each in the docker-compose.yml file.

For the database stanza, add

    ports:
      - "3306:3306"

For the wordpress stanza, add

    ports:
      - "9000:9000"

wordpress-nginx-docker's People

Contributors

afolarin avatar czuli avatar jodumont avatar kentokento avatar mjstealey avatar sillynotations avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wordpress-nginx-docker's Issues

error when trying docker-compose up

docker-compose up
Creating mysql ... done
Creating wordpress ... done
Creating nginx ... error

ERROR: for nginx Cannot start service nginx: OCI runtime create failed: container_linux.go:348: starting container process caused "process_linux.go:402: container init caused "rootfs_linux.go:58: mounting \"/home/ronald/wordpress-nginx-docker/nginx/default.conf\" to rootfs \"/var/lib/docker/overlay2/4b4fca93f43c32cf4c1a1efd29697fdc6ed112fd2e0fa2d1a6b8f1397fa91cb6/merged\" at \"/var/lib/docker/overlay2/4b4fca93f43c32cf4c1a1efd29697fdc6ed112fd2e0fa2d1a6b8f1397fa91cb6/merged/etc/nginx/conf.d/default.conf\" caused \"not a directory\""": unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type

ERROR: for nginx Cannot start service nginx: OCI runtime create failed: container_linux.go:348: starting container process caused "process_linux.go:402: container init caused "rootfs_linux.go:58: mounting \"/home/ronald/wordpress-nginx-docker/nginx/default.conf\" to rootfs \"/var/lib/docker/overlay2/4b4fca93f43c32cf4c1a1efd29697fdc6ed112fd2e0fa2d1a6b8f1397fa91cb6/merged\" at \"/var/lib/docker/overlay2/4b4fca93f43c32cf4c1a1efd29697fdc6ed112fd2e0fa2d1a6b8f1397fa91cb6/merged/etc/nginx/conf.d/default.conf\" caused \"not a directory\""": unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type
ERROR: Encountered errors while bringing up the project.

I am not aware of any wrong doing. Just followed the Readme.

Warn about EVERYTHING actually being EVERYTHING

I've been playing around with this for about 15 minutes now, looks nice. I just skimmed through the README and started testing things. I fucked up about 5 minutes in and I couldn't get WP running without recloning the repo. I did it again soon enough, but this time I noticed the stop-everything-and-remove.sh script, and I ran it.

Do you really want to stop and remove EVERYTHING?

I've just installed a new machine, and I transferred some docker volumes on it, that I haven't used, yet. When I ran the script, I noticed it pruned unused volumes, literally ALL of them. If restoring them wouldn't take about 5 seconds, I would've had a minor heart attack.

I know it says EVERYTHING but I didn't expect it to wipe every volume I have. This is literally the first thing I'm running on docker on this new machine 😂

I probably should've checked what the script does before actually running it but it's late and I might've had a few drinks.

Maybe you could add a few more words to the warning, like "literally every volume that isn't used by a container"?

Cannot switch to 443 from 8443

After changed the port to 443 in nginx/default.conf and docker-compose.yml, https://127.0.0.1 become not unreachable and http://127.0.0.1 still redirect to https://127.0.0.1:8443. Why is that?
Anywhere else I missed updating?

server {
    listen 80;
    listen [::]:80;
    server_name $host;
    location / {
        # update port as needed for host mapped https
        rewrite ^ https://127.0.0.1:443$request_uri? permanent;
    }
}
  nginx:
    # default ports 80, 443 - expose mapping as needed to host
    image: nginx:1
    container_name: wp-nginx
    env_file:
      - .env
    restart: unless-stopped
    networks:
      - wordpress
    depends_on:
      - wordpress
    ports:
      - "80:80"    # http
      - "443:443"   # https
    volumes:
      - ${WORDPRESS_LOCAL_HOME}:/var/www/html
      - ${NGINX_CONF}:/etc/nginx/conf.d/default.conf
      - ${NGINX_SSL_CERTS}:/etc/ssl:ro
      - ${NGINX_LOGS}:/var/log/nginx

php.ini

Doesn't matter what I try some how I cant set parameter for upload_max_filesize i trie docekr-composer file tried into the config folder ... nothing works out

Cron jobs don't work, either can modify files. Internal networking problem

I'm having a problem, my Wordpress site cannot connect to itself when using cron jobs. I'm using the plugin WP Crontrol to test it, and the post call to my own site doesn't work. I get this error:

cURL error 7: Failed to connect to 127.0.0.1 port 80: Connection refused

And the same error occurs with port 447 when I'm using SSL (self-signed).

I found this solution and it worked the first time I tried it, but later I deleted my containers, re deployed them and I can't get it working again, I guess i'm editing the host file incorrectly (inside the nginx container), I don't understand what does that solution do exactly and how it should be applied.

Also, I cannot edit files from the theme/plugin editor, It says that the site couldn't connect and I should upload the files using SFTP. Again, the site cannot connect to itself.

I'm using the default compose.yml, no changes applied.

Logging issues with docker

Please be advised that these lines on logging in the proposed configuration should be removed/changed:

logging

access_log /var/log/nginx/wordpress.access.log;
error_log /var/log/nginx/wordpress.error.log;

Let me explain the reasons behind.
a) it overrides the default logging format of dockerized nginx which means "$http_x_forwarded_for" is not logged
b) give the false impression that log files are saved to disk when in fact they are just sent to docker due to the way the nginx container is set up

Proposal: remove these lines or add at least the word main to the accesslog line:
access_log /var/log/nginx/wordpress.access.log main;

letsencrypt-renew.sh

Thanks for creating this, very useful!

Just a quick question, I assume I should be running letsencrypt-renew.sh? Maybe should be added to the README.

404 Error when fetching asset files from /wp-content

Hey!

I've used your setup and it was working great.

Don't know why when I tried setting it up on other computers some assets weren't being server properly.

Any asset files inside plugins/themes folder isn't being loaded, the network tab shows a 404 error, seems like it never finds the file referenced. I checked in the wp container and all files are there.

This is what the wordpress.error.log file looks like:

2023/02/06 14:58:56 [error] 28#28: *2 directory index of "/var/www/html/" is forbidden, client: 172.19.0.1, server: hostname request: "GET / HTTP/2.0", host: "hostname:8443"

I think it's probably an issue with the nginx server not "finding" those files. Could anyone help me with that?

"ssl" directive is deprecated

nginx: [warn] the "ssl" directive is deprecated, use the "listen ... ssl" directive instead in /etc/nginx/conf.d/wordpress_ssl.conf:21

#ssl       on;

seems to resolve it

selfsigned chain.pem

Hi,

Cheers for making this, just wondering is there any way I can generate the chain.pem when I am doing selfsigned? Basically I have setup a host record for my.dev and self-signed that url, which has made fullchan.pem and privatekey.pem however nginx is failing to start because it's expecting chain.pem

Active Http

Hello,

At the execution of letsencrypt-init.shI have this error:

   Domain: MY_DOMAIN
   Type:   unauthorized
   Detail: Invalid response from
   http://MY_DOMAIN/.well-known/acme-challenge/ofzV3Ho4o2jQmwdsaJ9XAeVyl9bufnXaGrrC2sB3VSs:
   "<html>\r\n<head><title>404 Not
   Found</title></head>\r\n<body>\r\n<center><h1>404 Not
   Found</h1></center>\r\n<hr><center>nginx/1.15.7</ce"

   To fix these errors, please make sure that your domain name was
   DNS A/AAAA record(s) for that domain
   contain (s) the right IP address.

The ip address of my server is well associated with my name of domain, I access very well in http.

Multiple WordPress instances

Hi, this is going to sound silly but how do I configure nginx to listen to listen to multiple WordPress containers?

I just want to serve wordpress1:443 and wordpress2:443 over a single IP, but different ports. Will then use haproxy from a different server to point to ip:wordpress1port and ip:wordpress2port. I've tried creating an additional wordpress2_ssl.conf but it's showing the wordpress1 instance.

Thanks!

Edit: Seems like traefik is a solution for this. I'll look into that instead.

mysql error - compose version 2.0

@Behinam - migrating your issue to it's own issue thread (will remove from other thread that is reserved for internal documentation)


Hello
when i run i get this error:

wordpress | MySQL Connection Error: (2002) Connection refused
wordpress |
wordpress | Warning: mysqli::__construct(): (HY000/2002): Connection refused in Standard input code on line 22

my yml file

`version: '2'
services:
nginx:
image: nginx:latest
container_name: nginx
ports:
- '80:80'
- '443:443'
volumes:
- ./nginx:/etc/nginx/conf.d
- ./logs/nginx:/var/log/nginx
- ./wordpress:/var/www/html
- ./certs:/etc/letsencrypt
- ./certs-data:/data/letsencrypt
links:
- wordpress
restart: always

mysql:
image: mariadb
container_name: mysql
ports:
- '3306:3306'
volumes:
- ./mysql:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=123456789
restart: always

wordpress:
image: wordpress:php7.2-fpm
container_name: wordpress
volumes:
- ./wordpress:/var/www/html
environment:
- WORDPRESS_DB_NAME=wordpress
- WORDPRESS_TABLE_PREFIX=wp_
- WORDPRESS_DB_HOST=mysql
- WORDPRESS_DB_USER=uwp
- WORDPRESS_DB_PASSWORD=123456
links:
- mysql
restart: always`

Add phpmyadmin

Would it be possible to add phpmyadmin to docker-compose ?

Bad Gateway sometimes (502)

Hello,

I have a problem with my wordpress, sometimes there are some 502 bad gateway, access.log :

X.X.X.X - - [25/Jan/2019:22:49:05 +0000] "POST /wp-json/alids/v1/extension HTTP/1.1" 200 66 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36 OPR/57.0.3098.116"
X.X.X.X  - - [25/Jan/2019:22:49:07 +0000] "POST /wp-json/alids/v1/extension HTTP/1.1" 502 559 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36 OPR/57.0.3098.116

In the error.log :

2019/01/25 22:49:07 [error] 6#6: *102 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 10.255.0.2, server: 178.0.0.1 (hide), request: "POST /wp-json/alids/v1/extension HTTP/1.1", upstream: "fastcgi://10.0.39.2:9000", host: "178.0.0.1 (hide)"

I also noticed that on the fpm logs, /usr/local/sbin/php-fpm :

[25-Jan-2019 22:44:40] NOTICE: Failed implicitly binding to ::, retrying with 0.0.0.0
[25-Jan-2019 22:44:40] ERROR: unable to bind listening socket for address '9000': Address in use (98)
[25-Jan-2019 22:44:40] ERROR: FPM initialization failed

Can you please help me ?

Wordpress version: wordpress:php7.2-fpm-alpine

413 Request Entity Too Large

hey there, if i try to upload an plugin zip file i run into the following message: 413 Request Entity Too Large

Can someone please help?

thank you very much

Unable to renew certificates

Hi there,

I have been using your project for a Wordpress site I have and it is amazing, thanks so much!

However, when it comes to renew my certificates, I get an unauthorized error. I think the file never gets created and so then the acme challenge gets a 404 response.

Here you can see the script I'm launching for testing purposes (dry-run):

docker run -t --rm -v /docker/sa-wp-nginx-docker/data/certs:/etc/letsencrypt -v /docker/sa-wp-nginx-docker/data/certs-data:/data/letsencrypt certbot/certbot renew --dry-run --webroot --webroot-path=/data/letsencrypt

And the output:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Processing /etc/letsencrypt/renewal/staging.mydomain.es.conf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Cert not due for renewal, but simulating renewal for dry run
Plugins selected: Authenticator webroot, Installer None
Renewing an existing certificate
Performing the following challenges:
http-01 challenge for staging.mydomain.es
Using the webroot path /data/letsencrypt for all unmatched domains.
Waiting for verification...
Challenge failed for domain staging.mydomain.es
http-01 challenge for staging.mydomain.es
Cleaning up challenges
Attempting to renew cert (staging.mydomain.es) from /etc/letsencrypt/renewal/staging.mydomain.es.conf produced an unexpected error: Some challenges have failed.. Skipping.
All renewal attempts failed. The following certs could not be renewed:
  /etc/letsencrypt/live/staging.mydomain.es/fullchain.pem (failure)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
** DRY RUN: simulating 'certbot renew' close to cert expiry
**          (The test certificates below have not been saved.)

All renewal attempts failed. The following certs could not be renewed:
  /etc/letsencrypt/live/staging.mydomain.es/fullchain.pem (failure)
** DRY RUN: simulating 'certbot renew' close to cert expiry
**          (The test certificates above have not been saved.)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1 renew failure(s), 0 parse failure(s)

IMPORTANT NOTES:
 - The following errors were reported by the server:

   Domain: staging.mydomain.es
   Type:   unauthorized
   Detail: Invalid response from
   https://staging.mydomain.es/.well-known/acme-challenge/AyxV-c2jeHKDWQlEfnzxTWSfkRXdt4GiPilSeF4xstM
   [2606:4700:30::681b:86fc]: "<!doctype html>\n<html
   lang=\"es\">\n<head>\n\t<meta charset=\"UTF-8\" />\n\t<meta
   name=\"viewport\" content=\"width=device-width, initial-sc"

   To fix these errors, please make sure that your domain name was
   entered correctly and the DNS A/AAAA record(s) for that domain
   contain(s) the right IP address.

Upstream proxy?

I want to perform penetration testing against some plugins related to a security bug bounty program, and I need to force all network traffic to go through Burp suite proxy.

How do I do that?

How can I use multisite?

I was asked to use Wordpress with multisite setup.
I know, that it needs to add to wp-config.php:

/* Multisite */
define( 'WP_ALLOW_MULTISITE', true );

However, how do I get the ssl certificates for these sites into the system?

SSL Problem with ez-letsencrypt

There is a problem with ez-letsencrypt.
When I tried to run ez-letsencrypt,
it runs like this with ssl files
ssl_certificate /etc/letsencrypt/live/$le_hostname/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/$le_hostname/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/$le_hostname/chain.pem;

However, this project has ssl files on ssl folder. That doesn't make work well
Please help me!

mysql errors are coming

Here is log detail:

mysql | 2021-06-09 09:31:51+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql' mysql | 2021-06-09 09:31:51+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.5.10+maria~focal started. mysql | 2021-06-09 09:31:51+00:00 [Note] [Entrypoint]: Initializing database files mysql | 2021-06-09 9:31:51 0 [ERROR] mysqld: File '/var/lib/mysql/aria_log_control' not found (Errcode: 13 "Permission denied") mysql | 2021-06-09 9:31:51 0 [ERROR] mysqld: Got error 'Can't open file' when trying to use aria control file '/var/lib/mysql/aria_log_control' mysql | 2021-06-09 9:31:51 0 [ERROR] Plugin 'Aria' init function returned error. mysql | 2021-06-09 9:31:51 0 [ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed. mysql | 2021-06-09 9:31:51 0 [ERROR] InnoDB: The innodb_system data file 'ibdata1' must be writable mysql | 2021-06-09 9:31:51 0 [ERROR] InnoDB: The innodb_system data file 'ibdata1' must be writable mysql | 2021-06-09 9:31:51 0 [ERROR] Plugin 'InnoDB' init function returned error. mysql | 2021-06-09 9:31:51 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. mysql | 2021-06-09 9:31:51 0 [ERROR] Failed to initialize plugins. mysql | 2021-06-09 9:31:51 0 [ERROR] Aborting mysql | mysql | Installation of system tables failed! Examine the logs in mysql | /var/lib/mysql/ for more information. mysql | mysql | The problem could be conflicting information in an external mysql | my.cnf files. You can ignore these by doing: mysql | mysql | shell> /usr/bin/mysql_install_db --defaults-file=~/.my.cnf mysql | mysql | You can also try to start the mysqld daemon with: mysql | mysql | shell> /usr/sbin/mysqld --skip-grant-tables --general-log & mysql | mysql | and use the command line tool /usr/bin/mysql mysql | to connect to the mysql database and look at the grant tables: mysql | mysql | shell> /usr/bin/mysql -u root mysql mysql | mysql> show tables; mysql | mysql | Try 'mysqld --help' if you have problems with paths. Using mysql | --general-log gives you a log in /var/lib/mysql/ that may be helpful. mysql | mysql | The latest information about mysql_install_db is available at mysql | https://mariadb.com/kb/en/installing-system-tables-mysql_install_db mysql | You can find the latest source at https://downloads.mariadb.org and mysql | the maria-discuss email list at https://launchpad.net/~maria-discuss mysql | mysql | Please check all of the above before submitting a bug report mysql | at https://mariadb.org/jira mysql | mysql exited with code 1

Whether can provide a PHP template of the conf

wordpress:
image: wordpress:${WORDPRESS_VERSION:-php7.3-fpm}
container_name: wordpress
volumes:
- ./config/php.conf.ini:/usr/local/etc/php/conf.d/conf.ini

I want to edit the php.conf.Ini
can provide an example

thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.