mirror of
https://github.com/caddyserver/website.git
synced 2025-05-07 12:17:15 -04:00
Polish the Windows Service docs a bit
This commit is contained in:
parent
59468700fa
commit
a1833284c4
1 changed files with 23 additions and 23 deletions
|
@ -136,40 +136,40 @@ Install Caddy as a service on Windows with these instructions.
|
||||||
**Requirements:**
|
**Requirements:**
|
||||||
|
|
||||||
- `caddy.exe` binary that you [downloaded](/download) or [built from source](/docs/build)
|
- `caddy.exe` binary that you [downloaded](/download) or [built from source](/docs/build)
|
||||||
- Any exe from the latest release of the
|
- Any `.exe` from the latest release of the
|
||||||
[WinSW](https://github.com/winsw/winsw/releases/latest) service wrapper (Stay
|
[WinSW](https://github.com/winsw/winsw/releases/latest) service wrapper (the below service config is written for v2.x releases)
|
||||||
on a v2.x release for now)
|
|
||||||
|
|
||||||
Put all files into a service directory. In the following examples, we use `c:\caddy`.
|
Put all files into a service directory. In the following examples, we use `C:\caddy`.
|
||||||
|
|
||||||
Rename the WinSW exe file to `caddy-service.exe`.
|
Rename the `WinSW-x64.exe` file to `caddy-service.exe`.
|
||||||
|
|
||||||
Add a `caddy-service.xml` in the directory:
|
Add a `caddy-service.xml` in the same directory:
|
||||||
|
|
||||||
<pre><code class="cmd"><service>
|
```xml
|
||||||
<id>caddy</id>
|
<service>
|
||||||
<!-- Display name of the service -->
|
<id>caddy</id>
|
||||||
<name>Caddy Web Server (powered by WinSW)</name>
|
<!-- Display name of the service -->
|
||||||
<!-- Service description -->
|
<name>Caddy Web Server (powered by WinSW)</name>
|
||||||
<description>Caddy Web Server (https://caddyserver.com/)</description>
|
<!-- Service description -->
|
||||||
<executable>%BASE%\caddy.exe</executable>
|
<description>Caddy Web Server (https://caddyserver.com/)</description>
|
||||||
<arguments>run</arguments>
|
<executable>%BASE%\caddy.exe</executable>
|
||||||
<log mode="roll-by-time">
|
<arguments>run</arguments>
|
||||||
<pattern>yyyy-MM-dd</pattern>
|
<log mode="roll-by-time">
|
||||||
</log>
|
<pattern>yyyy-MM-dd</pattern>
|
||||||
</service>
|
</log>
|
||||||
</code></pre>
|
</service>
|
||||||
|
```
|
||||||
|
|
||||||
You can now install the service using:
|
You can now install the service using:
|
||||||
<pre><code class="cmd">caddy-service install</code></pre>
|
<pre><code class="cmd bash">caddy-service install</code></pre>
|
||||||
|
|
||||||
You might want to start the Windows Services Console to see if the service is runnnig correctly:
|
You might want to start the Windows Services Console to see if the service is runnnig correctly:
|
||||||
<pre><code class="cmd">services.msc</code></pre>
|
<pre><code class="cmd bash">services.msc</code></pre>
|
||||||
|
|
||||||
Be aware that Windows services cannot be reloaded, so you have to tell caddy directly to relaod:
|
Be aware that Windows services cannot be reloaded, so you have to tell caddy directly to relaod:
|
||||||
<pre><code class="cmd">caddy reload</code></pre>
|
<pre><code class="cmd bash">caddy reload</code></pre>
|
||||||
|
|
||||||
Restarting is possible via the normal Windows services commands.
|
Restarting is possible via the normal Windows services commands, for example via the Task Manager's "Services" tab.
|
||||||
|
|
||||||
For customizing the service wrapper, see the [WinSW documentation](https://github.com/winsw/winsw/tree/master#usage)
|
For customizing the service wrapper, see the [WinSW documentation](https://github.com/winsw/winsw/tree/master#usage)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue