mirror of
				https://github.com/caddyserver/caddy.git
				synced 2025-11-04 03:27:23 -05:00 
			
		
		
		
	Merge pull request #705 from DenBeke/upstart-conf
dist/init: caddy.conf for upstart
This commit is contained in:
		
						commit
						8a2f2f8d37
					
				
							
								
								
									
										13
									
								
								dist/init/linux-upstart/README.md
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								dist/init/linux-upstart/README.md
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,13 @@
 | 
			
		||||
Upstart conf for Caddy
 | 
			
		||||
=====================
 | 
			
		||||
 | 
			
		||||
Usage
 | 
			
		||||
-----
 | 
			
		||||
 | 
			
		||||
Usage in this blogpost: [Running Caddy Server as a service with Upstart](https://denbeke.be/blog/servers/running-caddy-server-as-a-service/).
 | 
			
		||||
Short recap:
 | 
			
		||||
 | 
			
		||||
* Download Caddy in `/usr/bin/caddy` and execute `sudo setcap cap_net_bind_service=+ep /usr/bin/caddy`.
 | 
			
		||||
* Save the upstart config file in `/etc/init/caddy.conf`.
 | 
			
		||||
* Create a Caddyfile in `/etc/caddy/Caddyfile`.
 | 
			
		||||
* Now you can use `sudo service caddy start|stop|restart`.
 | 
			
		||||
							
								
								
									
										18
									
								
								dist/init/linux-upstart/caddy.conf
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								dist/init/linux-upstart/caddy.conf
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,18 @@
 | 
			
		||||
description "Caddy startup script"
 | 
			
		||||
author "Mathias Beke"
 | 
			
		||||
 | 
			
		||||
start on runlevel [2345]
 | 
			
		||||
stop on runlevel [016]
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
setuid www-data
 | 
			
		||||
setgid www-data
 | 
			
		||||
 | 
			
		||||
respawn
 | 
			
		||||
respawn limit 10 5
 | 
			
		||||
 | 
			
		||||
limit nofile 4096 4096
 | 
			
		||||
 | 
			
		||||
script
 | 
			
		||||
	exec /usr/bin/caddy -agree=true -conf=/etc/caddy/Caddyfile
 | 
			
		||||
end script
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user