Skip to content

Commit d533368

Browse files
committed
updating with suggestions
1 parent 1706997 commit d533368

File tree

1 file changed

+24
-11
lines changed

1 file changed

+24
-11
lines changed

examples/web-server/apache/README.md

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,17 @@
22

33
## Requirements
44

5-
1. Start a Coder deployment with a wildcard subdomain. See [this guide](https://coder.com/docs/v2/latest/admin/configure#wildcard-access-url) for more information.
5+
1. Start a Coder deployment and be sure to set the following [configuration values](https://coder.com/docs/v2/latest/admin/configure):
66

7-
2. Configure your DNS provider to point your YOUR_SUBDOMAIN and \*.YOUR_SUBDOMAIN to your server's public ip.
7+
```console
8+
CODER_HTTP_ADDRESS=127.0.0.1:3000
9+
CODER_ACCESS_URL=https://coder.example.com
10+
CODER_WILDCARD_ACCESS_URL=*coder.example.com
11+
```
12+
13+
Throughout the guide, be sure to replace `coder.example.com` with the domain you intend to use with Coder.
14+
15+
2. Configure your DNS provider to point your coder.example.com and \*.coder.example.com to your server's public IP address.
816

917
> For example, to use `coder.example.com` as your subdomain, configure `coder.example.com` and `*.coder.example.com` to point to your server's public ip. This can be done by adding A records in your DNS provider's dashboard.
1018
@@ -32,7 +40,7 @@
3240

3341
## Install and configure LetsEncrypt Certbot
3442

35-
1. Install LetsEncrypt Certbot: Refer to the [CertBot documentation](https://certbot.eff.org/instructions?ws=other&os=pip&tab=wildcard)
43+
1. Install LetsEncrypt Certbot: Refer to the [CertBot documentation](https://certbot.eff.org/instructions?ws=apache&os=ubuntufocal&tab=wildcard). Be sure to pick the wildcard tab and select your DNS provider for instructions to install the necessary DNS plugin.
3644

3745
## Create DNS provider credentials
3846

@@ -46,6 +54,12 @@
4654
dns_cloudflare_api_token = YOUR_API_TOKEN
4755
```
4856

57+
```console
58+
mkdir -p ~/.secrets/certbot
59+
touch ~/.secrets/certbot/cloudflare.ini
60+
nano ~/.secrets/certbot/cloudflare.ini
61+
```
62+
4963
3. Set the correct permissions:
5064

5165
```console
@@ -62,7 +76,7 @@
6276

6377
## Configure Apache
6478

65-
> This example assumes Coder is running locally on `127.0.0.1:3000` for the subdomain `YOUR_SUBDOMAIN` e.g. `coder.example.com`.
79+
> This example assumes Coder is running locally on `127.0.0.1:3000` and that you're using `coder.example.com` as your subdomain.
6680
6781
1. Create Apache configuration for Coder:
6882

@@ -74,8 +88,8 @@
7488

7589
```apache
7690
<VirtualHost *:443>
77-
ServerName dev.dietstyler.com
78-
ServerAlias *.dev.dietstyler.com
91+
ServerName coder.example.com
92+
ServerAlias *.coder.example.com
7993
ErrorLog ${APACHE_LOG_DIR}/error.log
8094
CustomLog ${APACHE_LOG_DIR}/access.log combined
8195
@@ -89,13 +103,12 @@
89103
RewriteCond %{HTTP:Upgrade} websocket [NC]
90104
RewriteRule /(.*) ws://127.0.0.1:3000/$1 [P,L]
91105
92-
SSLCertificateFile /etc/letsencrypt/live/dev.dietstyler.com/fullchain.pem
93-
SSLCertificateKeyFile /etc/letsencrypt/live/dev.dietstyler.com/privkey.pem
106+
SSLCertificateFile /etc/letsencrypt/live/coder.example.com/fullchain.pem
107+
SSLCertificateKeyFile /etc/letsencrypt/live/coder.example.com/privkey.pem
94108
</VirtualHost>
95109
```
96110

97-
> Don't forget to change:
98-
> `YOUR_SUBDOMAIN` by your (sub)domain e.g. `coder.example.com`
111+
> Don't forget to change: `coder.example.com` by your (sub)domain
99112
100113
3. Enable the site:
101114

@@ -130,4 +143,4 @@
130143
sudo certbot renew -q
131144
```
132145

133-
And that's it, you should now be able to access Coder at `https://YOUR_SUBDOMAIN`!
146+
And that's it, you should now be able to access Coder at your sub(domain) e.g. `https://coder.example.com`.

0 commit comments

Comments
 (0)