Commit f2a977fa authored by Luc Didry's avatar Luc Didry

Add doc and templates for systemctl and sysvinit

parent 7b0dcfb2
......@@ -24,18 +24,49 @@ git clone https://git.framasoft.org/luc/lstu.git
cd lstu
carton install
cp lstu.conf.template lstu.conf
vi lstu.conf
```
The configuration file is self-documented.
## Usage
### Launch manually
This is good for test, not for production.
```
carton exec hypnotoad script/lstu
# stop it
carton exec hypnotoad -s script/lstu
```
Yup, that's all, it will listen at "http://127.0.0.1:8080".
For more options (interfaces, user, etc.), change the configuration in `lstu.conf` (have a look at http://mojolicio.us/perldoc/Mojo/Server/Hypnotoad#SETTINGS for the available options).
### Systemd
```
sudo su
cp utilities/lstu.service /etc/systemd/system/
vi /etc/systemd/system/lstu.service
systemctl daemon-reload
systemctl enable lstu.service
systemctl start lstu.service
```
### SysVinit
```
sudo su
cp utilities/lstu.default /etc/default/lstu
vi /etc/default/lstu
cp utilities/lstu.init /etc/init.d/lstu
update-rc.d lstu defaults
service lstu start
```
## Other options
There is the `contact` option (mandatory), where you have to put some way for the users to contact you, and the `secret` where you have to put a random string in order to protect your Mojolicious cookies (not really useful and optional).
......
# LDIR is the path where you installed Lutim
# It has to end with a final /
LDIR=/var/lstu/
LDIR=/var/www/lstu/
[Unit]
Description=Shortened URLs service
After=systemd-user-sessions.service
[Service]
User=www-data
WorkingDirectory=/var/www/lstu/
ExecStart=/usr/local/bin/carton exec hypnotoad -f script/lstu
ExecReload=/usr/local/bin/carton exec hypnotoad script/lstu
Restart=always
[Install]
WantedBy=multi-user.target
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment