I’m trying to find documentation on setting up Caddy2 (beta 18) as a service on a Windows Server. I’ve tried using sc create "caddy" binPath= "C:\Caddy\caddy2.exe start -config C:\Caddy\Caddyfile" DisplayName= "caddy" and the service will not start up.
The error is “Error 1053: the service did nto respond to the start or control request in a timely fashion”. If I run the command from the prompt it works fine. I have gone as far as changing the logon as in the services from local service, to a user and to a local admin account with no success.
Also tried putting the command into a batch file and using sc to configure the service that way; same result. Does anyone have any knowledge of getting this to work?
Thanks for the response. I think I found an alternative solution by just using Windows Scheduled task to manage things. The task can be set to run every few minutes and running the following PowerShell script which it will either start caddy back up or reload the config if the config file has been modified in less than 5 minutes.