mirror of
https://github.com/caddyserver/website.git
synced 2025-04-20 12:15:08 -04:00
docs: Add tips for permissions errors in tutorials; explain durability
This commit is contained in:
parent
fdabe3dde2
commit
d3a35d67e8
3 changed files with 14 additions and 1 deletions
|
@ -8,7 +8,7 @@ Caddy is configured through an administration endpoint which can be accessed via
|
||||||
|
|
||||||
**Default address: `localhost:2019`**
|
**Default address: `localhost:2019`**
|
||||||
|
|
||||||
The latest configuration will be saved to disk after any changes (unless [disabled](/docs/json/admin/config/)). You can resume the last working config after a restart with [`caddy run --resume`](/docs/command-line#caddy-run).
|
The latest configuration will be saved to disk after any changes (unless [disabled](/docs/json/admin/config/)). You can resume the last working config after a restart with [`caddy run --resume`](/docs/command-line#caddy-run), which guarantees config durability in the event of a power cycle or similar.
|
||||||
|
|
||||||
To get started with the API, try our [API tutorial](/docs/api-tutorial) or, if you only have a minute, our [API quick-start guide](/docs/quick-starts/api).
|
To get started with the API, try our [API tutorial](/docs/api-tutorial) or, if you only have a minute, our [API quick-start guide](/docs/quick-starts/api).
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,10 @@ The first thing you should type is your site's [address](/docs/caddyfile/concept
|
||||||
localhost
|
localhost
|
||||||
```
|
```
|
||||||
|
|
||||||
|
<aside class="tip">
|
||||||
|
If the HTTP and HTTPS ports (80 and 443, respectively) are privileged ports on your OS, you will either need to run with elevated privileges or use a higher port. To use a higher port, just change the address to something like <code>localhost:2015</code>. You'll still get HTTPS unless you turn it off.
|
||||||
|
</aside>
|
||||||
|
|
||||||
Then hit enter and type what you want it to do. For this tutorial, make your Caddyfile look like this:
|
Then hit enter and type what you want it to do. For this tutorial, make your Caddyfile look like this:
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -43,6 +47,10 @@ Save that and run Caddy (since this is a training tutorial, we'll use the `--wat
|
||||||
|
|
||||||
<pre><code class="cmd bash">caddy run --watch</code></pre>
|
<pre><code class="cmd bash">caddy run --watch</code></pre>
|
||||||
|
|
||||||
|
<aside class="tip">
|
||||||
|
If you get permissions errors, try using a higher port in your address, like <code>localhost:2015</code> for example, or run with elevated privileges.
|
||||||
|
</aside>
|
||||||
|
|
||||||
The first time, you'll be asked for your password. This is so Caddy can serve your site over HTTPS.
|
The first time, you'll be asked for your password. This is so Caddy can serve your site over HTTPS.
|
||||||
|
|
||||||
<aside class="tip">Caddy serves all sites over HTTPS by default as long as a host or IP is part of the site's address. <a href="/docs/automatic-https">Automatic HTTPS</a> can be disabled by prefixing the address with <code>http://</code> explicitly.</aside>
|
<aside class="tip">Caddy serves all sites over HTTPS by default as long as a host or IP is part of the site's address. <a href="/docs/automatic-https">Automatic HTTPS</a> can be disabled by prefixing the address with <code>http://</code> explicitly.</aside>
|
||||||
|
|
|
@ -12,6 +12,10 @@ The first thing to type in a Caddyfile is your site's address:
|
||||||
localhost
|
localhost
|
||||||
```
|
```
|
||||||
|
|
||||||
|
<aside class="tip">
|
||||||
|
If the HTTP and HTTPS ports (80 and 443, respectively) are privileged ports on your OS, you will either need to run with elevated privileges or use a higher port. To use a higher port, just change the address to something like <code>localhost:2015</code>. You'll still get HTTPS unless you turn it off.
|
||||||
|
</aside>
|
||||||
|
|
||||||
Then hit enter and type what you want it to do, so it looks like this:
|
Then hit enter and type what you want it to do, so it looks like this:
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -30,6 +34,7 @@ You will probably be asked for your password, because Caddy serves all sites --
|
||||||
For local HTTPS, Caddy automatically generates certificates and unique private keys for you. The root certificate is added to your system's trust store, which is why the password prompt is necessary. It allows you to develop locally over HTTPS without certificate errors.
|
For local HTTPS, Caddy automatically generates certificates and unique private keys for you. The root certificate is added to your system's trust store, which is why the password prompt is necessary. It allows you to develop locally over HTTPS without certificate errors.
|
||||||
</aside>
|
</aside>
|
||||||
|
|
||||||
|
If you get permission errors, you may need to run with elevated privileges or use a higher port; a quick fix is to change your site's address to `localhost:2015` or similar.
|
||||||
|
|
||||||
Either open your browser to [localhost](http://localhost) or `curl` it:
|
Either open your browser to [localhost](http://localhost) or `curl` it:
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue