You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We require you use the a domain (`yourhost.com` or `www.yourhost.com`). This will ensure that everything is correctly auto configured on your behalf. For example, if you set `www.yourhost.com` NGINX will set it a server as `www.yourhost.com`.
69
+
We require you use the a domain (`yourhost.com` or `www.yourhost.com`). This will ensure that everything is correctly auto configured on your behalf. For example, if you set `www.yourhost.com` NGINX will set it a server as `www.yourhost.com`. The domain `yourhost.com` is a placeholder, an example, Do not blindly use `yourhost.com`!! It seems obvious, but not to everyone.
67
70
68
-
If you decide not to set DNS via `USERDATA` go to **Step 3**.
71
+
Remember, if you decide not to set DNS via `USERDATA` go to **Step 3**. You will need to manually configure SSL. We will install self-signed SSL certs as a temporary solution until you can configure everything according to the process outlined in Step 3.
69
72
70
73
### IMPORTANT
71
74
Make sure your IP (x.x.x.x) points to a DNS A Record uses the domain you set via USERDATA ( `yourhost.com` or `www.yourhost.com` ).
@@ -96,6 +99,7 @@ If you want to log into the `wp-admin` console, you need to get your password. T
96
99
97
100
You can also get it from AWS console by looking at the `Get System Logs` and scrolling for `WORDPRESS_ADMIN_PASSWORD`. You can also SSH into your instance and get the creds.
98
101
102
+
99
103
# Step 3: Manual Setup of SSL
100
104
Did you setup DNS via `USERDATA`? No, then you need to set your domain name and get your SSL setup. If you do not set your host via AMI `USERDATA` we will install self-signed SSL certificates. This will be enough to get you up and running. The following section describes how you can manually set your server host and install SSL certificates.
101
105
@@ -111,7 +115,7 @@ You will certainly want to change these.
111
115
To keep things organized we default to using [`letsencrypt`](https://letsencrypt.org/) for SSL certificates/keys, paths and naming conventions. Even if you are using your own certs, follow the naming conventions detailed below.
112
116
113
117
In keeping with the `letsencrypt` conventions make sure your certs are using the same naming scheme:
Even if you are not using letsencrypt simple repurpose the path above.
129
133
130
134
## Using `certbot` for `letsencrypt` SSL certs
131
-
On your **host**, not in the Docker image, we pre-installed `certbot`. The install process looks something like this if you need to rerun it yourself:
135
+
On your **host**, not in the Docker image, we pre-installed the `certbot` Docker image.
136
+
137
+
First, make sure your `NGINX` is not running. You need to do this because `cerbot` needs to have post 80 and 443 open. If `NGINX` is running, there will be a port conflict. This will gracefully close down everything:
132
138
133
-
If your run into an errors with certbot, trying running these commands:
/usr/local/bin/docker-compose -f /home/ec2-user/wordpress.yml down --remove-orphans
150
141
```
151
142
152
-
## Mount your certs
153
-
If you when down the path of using USERDATA, this has been done for you. For reference, we mount your certs directory on the host to: `/etc/letsencrypt/live/<yourdomain>`. If you need to set SSL certs manually, then read on.
Lastly, add everything to cron via `cat /tmp/crontab.conf | crontab - && crontab -l`
166
+
167
+
We have also installed ACME.sh (https://github.com/Neilpang/acme.sh). If you prefer, you can use this as your client for Lets Encrypt!
168
+
169
+
## Do you already have SSL certs?
170
+
For reference, we mount SSL certs to a directory on the host: `/etc/letsencrypt/live/<yourdomain>`.
171
+
172
+
If you need to set SSL certs manually because you have them already via some other third party, then read on.
154
173
155
174
### Edit `wordpress.yml`
156
-
This assumes you already have the certs on your host here`/etc/letsencrypt/live/<yourdomain>`.
175
+
First, make sure you place your certs on the host in this path:`/etc/letsencrypt/live/<yourdomain>`.
157
176
158
-
Next, we want to add the paths to the Docker compose file under the `nginx` block. Here is the where you can find the file: `/home/ec2-user/wordpress.yml`
177
+
Next, we want to add the path to your certs into the Docker compose file. In the compose yml file see the SSL certs under the `nginx` block.
159
178
160
-
You will already see `- wordpress_data:/usr/share/nginx/html` present. You want to add the following into the compose file. Remember to put use the actual domain you used with certbot:
179
+
Here is the where you can find the file on the host: `/home/ec2-user/wordpress.yml`
161
180
162
-
```docker
181
+
You will already see `- wordpress_data:/usr/share/nginx/html` present. You want to add the following into the compose file. Remember to put use the actual domain you want to use in place of `<yourdomain>`:
/usr/local/bin/docker-compose -f /home/ec2-user/wordpress.yml up -d --remove-orphans
183
200
```
184
-
Lastly, add everything to cron via `cat /tmp/crontab.conf | crontab - && crontab -l`
185
201
186
-
We have also installed ACME.sh (https://github.com/Neilpang/acme.sh). If you prefer, you can use this as your client for Lets Encrypt!
187
202
188
203
# Docker Configuration
189
204
190
-
## Configuring your Docker container
205
+
206
+
## Starting and Stopping Your Docker Services
207
+
208
+
If you want to `start` all your services, the command is:
209
+
```bash
210
+
/usr/local/bin/docker-compose -f /home/ec2-user/wordpress.yml up -d --remove-orphans
211
+
```
212
+
If you want to `stop` all your services, the command is:
213
+
```bash
214
+
/usr/local/bin/docker-compose -f /home/ec2-user/wordpress.yml down --remove-orphans
215
+
```
216
+
217
+
## Advanced Configuration
191
218
When you SSH into your server go to your `HOME` directory. In there you will see a `wordpress.env` file that was created for you. This is used by your Docker containers to initialize various container settings.
192
219
193
220
Here is what is resident in the file:
@@ -237,7 +264,7 @@ The default username is set via `WORDPRESS_ADMIN` and is `admin`.
237
264
238
265
As always, keep your ENV file safe and secure.
239
266
240
-
### Advanced configuration
267
+
### Only change if you know what you are doing
241
268
Don't change any of the defaults for these unless you are a pro and understand what you are doing:
242
269
243
270
*`NGINX_DOCROOT` sets the default www directory. The containers default to `/usr/share/nginx/html` so it is best left unchanged.
@@ -292,10 +319,18 @@ You will likely want to dispatch logs to a service like Amazon Cloudwatch. This
292
319
| latest | ami-deb3eea1 | 1.0.2 | 3.8 |
293
320
| latest | ami-deb3eea1 | 1.0.1 | 3.8 |
294
321
322
+
323
+
# Bad Gateway
324
+
325
+
If you happen to see a bad gateway error, hard reload your browser. It is possible you have something in your browser cache that is causing this:
326
+
327
+

328
+
295
329
# Issues
296
330
297
331
If you have any problems with or questions about this image, please contact us through a GitHub issue.
298
332
333
+
299
334
# Contributing
300
335
301
336
You are invited to contribute new features, fixes, or updates, large or small; we are always thrilled to receive pull requests, and do our best to process them as fast as we can.
0 commit comments