Browse Source

Adding scripts for systemd
The documentation is not complete yet!…

Gwyneth Llewelyn 2 years ago
parent
commit
4c48c2d53e

+ 1 - 1
README.md

@@ -71,7 +71,7 @@ Remember to set your URLs on each of the two LSL scripts!
 
 For the standalone server: this will be something like `http://your.server.name:3000/`.
 
-For FastCGI: If your base URL (i.e. pointing to the directory where you have installed `gosl-basics`) is something like `http://your.hosted-server.name/examples` then your URLs will be something like `http://your.hosted-server.name/examples/gosl-basics`. Some providers might force you to add an extension like `.fcgi`, meaning that you will have to remember to add that explicitly every time you compile the application again (or just use a [Makefile](https://www.devroom.io/2015/10/03/a-makefile-for-golang-cli-tools/) for that!).
+For FastCGI: If your base URL (i.e. pointing to the directory where you have installed `gosl-basics`) is something like `http://your.hosted-server.name/examples` then your URLs will be something like `http://your.hosted-server.name/examples/gosl-basics`. Some providers might force you to add an extension like `.fcgi`, meaning that you will have to remember to add that explicitly every time you compile the application again (or just use a [Makefile](https://www.devroom.io/2015/10/03/a-makefile-for-golang-cli-tools/) for that!). Also, if you wish to run it automatically when the server starts, you can take a look at some [quick & dirty instructions](startup-scripts/README-systemd.md) for doing so.
 
 Note that the first time ever the application runs, it will check if the database directory exists, and if not, it will attempt to create it (and panic if it cannot create it, due to permissions — basically, if it can't create a directory, it won't be able to create the database files either). You can define a different location for the database; this might be important when using FastCGI on a shared server, because you might wish to use a private area of your web server, so that it cannot be directly accessed.
 

File diff suppressed because it is too large
+ 10 - 0
startup-scripts/README-systemd.md


+ 17 - 0
startup-scripts/gosl-name2key.service

@@ -0,0 +1,17 @@
+[Unit]
+Description=GoSL name2key service
+After=network.target
+
+[Service]
+Type=simple
+User=www-data
+Group=www-data
+StandardInput=socket
+StandardOutput=null
+StandardError=syslog
+WorkingDirectory=/var/www/html
+Environment=USER=www-data HOME=var/www/html
+ExecStart=/var/www/html/name2key.fcgi
+
+[Install]
+WantedBy=multi-user.target

+ 12 - 0
startup-scripts/gosl-name2key.socket

@@ -0,0 +1,12 @@
+[Unit]
+Description=GoSL name2key Listen Socket
+
+[Socket]
+SocketUser=www-data
+SocketGroup=www-data
+SocketMode=0600
+ListenStream=/var/run/gosl-name2key.sock
+Accept=false
+
+[Install]
+WantedBy=sockets.target

+ 7 - 0
startup-scripts/nginx.conf

@@ -0,0 +1,7 @@
+location /name2key.fcgi {
+			try_files $uri =404;
+			include /etc/nginx/fastcgi.conf;
+			gzip off;
+			fastcgi_param HOME $document_root;
+			fastcgi_pass unix:/var/run/gosl-name2key.sock;
+}

Some files were not shown because too many files changed in this diff