echo>&2 "Complete! WordPress has been successfully copied to $PWD"
if[!-e .htaccess ];then
# NOTE: The "Indexes" option is disabled in the php:apache base image
cat> .htaccess <<-'EOF'
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
EOF
chown"$user:$group" .htaccess
fi
fi
# TODO handle WordPress upgrades magically in the same way, but only if wp-includes/version.php's $wp_version is less than /usr/src/wordpress/wp-includes/version.php's $wp_version
# allow any of these "Authentication Unique Keys and Salts." to be specified via
# environment variables with a "WORDPRESS_" prefix (ie, "WORDPRESS_AUTH_KEY")
# now that we're definitely done writing configuration, let's clear out the relevant envrionment variables (so that stray "phpinfo()" calls don't leak secrets from our code)
Docker compose installation of a single site Wordpress instance using Nginx as the web server and MariaDB as the database.
...
...
@@ -31,7 +61,7 @@ $ cd wordpress-nginx-docker/
If you plan to run your WordPress site over http on port 80, then do the following.
1. Change the name of `nginx/wordpress.conf.example` to `nginx/wordpress.conf`
1. Change the name of `nginx/wordpress.conf.example` to `nginx/wordpress.conf`
2. Update the `DOMAIN_NAME` in `nginx/wordpress.conf` to be that of your domain
3. Run `$ docker-compose up -d`
4. Navigate to [http://DOMAIN_NAME]() in a browser where `DOMAIN_NAME` is the name of your site
...
...
@@ -45,9 +75,9 @@ If you plan to run your WordPress site over https on port 443, then do the follo
- **Let's Encrypt**
If you plan on using SSL certificates from [Let's Encrypt](https://letsencrypt.org) it is important that your public domain is already registered and reachable.
Run: `./letsencrypt/letsencrypt-init.sh DOMAIN_NAME`, where `DOMAIN_NAME` is the publicly registered domain name of your host.
```
$ ./letsencrypt-init.sh example.com
mysql uses an image, skipping
...
...
@@ -64,7 +94,7 @@ If you plan to run your WordPress site over https on port 443, then do the follo
Would you be willing to share your email address with the Electronic Frontier
Foundation, a founding partner of the Let's Encrypt project and the non-profit
...
...
@@ -87,7 +117,7 @@ If you plan to run your WordPress site over https on port 443, then do the follo
Using the webroot path /data/letsencrypt for all unmatched domains.
Waiting for verification...
Cleaning up challenges
IMPORTANT NOTES:
ssl on;
- Congratulations! Your certificate and chain have been saved at:
...
...
@@ -104,10 +134,10 @@ If you plan to run your WordPress site over https on port 443, then do the follo
also contain certificates and private keys obtained by Certbot so
making regular backups of this folder is ideal.
- If you like Certbot, please consider supporting our work by:
Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate
Donating to EFF: https://eff.org/donate-le
Stopping nginx ... done
Stopping wordpress ... done
Stopping mysql ... done
...
...
@@ -125,7 +155,7 @@ If you plan to run your WordPress site over https on port 443, then do the follo
- **Self signed**
If you plan on using self signed SSL certificates, run: `./letsencrypt/self-signed-init.sh DOMAIN_NAME`, where `DOMAIN_NAME` is the `CN` you want to assign to the host (commonly `localhost`).
```
$ cd letsencrypt/
$ ./self-signed-init.sh localhost
...
...
@@ -149,7 +179,7 @@ If you plan to run your WordPress site over https on port 443, then do the follo
**Finally**
1. Change the name of `nginx/wordpress_ssl.conf.example` to `nginx/wordpress_ssl.conf`
1. Change the name of `nginx/wordpress_ssl.conf.example` to `nginx/wordpress_ssl.conf`
2. Update the `DOMAIN_NAME` in `nginx/wordpress_ssl.conf` to be that of your domain
3. Run `$ docker-compose up -d`
4. Navigate to [https://DOMAIN_NAME]() in a browser where `DOMAIN_NAME` is the name of your site