... | ... | @@ -12,4 +12,116 @@ cp lutim.conf.template lutim.conf |
|
|
vi lutim.conf
|
|
|
```
|
|
|
|
|
|
You can now go to the [configuration page](configuration) or go back to [wiki's homepage](home). |
|
|
\ No newline at end of file |
|
|
You can go to the [configuration page](configuration) or just read the self-documented configuration file.
|
|
|
|
|
|
After configuring Lutim, you can start it from command line:
|
|
|
|
|
|
```
|
|
|
carton exec hypnotoad script/lutim
|
|
|
```
|
|
|
|
|
|
But it's easier to use your system's init.
|
|
|
|
|
|
## Init files
|
|
|
|
|
|
### InitV
|
|
|
|
|
|
```
|
|
|
cp utilities/lutim.init /etc/init.d/lutim
|
|
|
cp utilities/lutim.default /etc/default/lutim
|
|
|
chown root:root /etc/init.d/lutim /etc/default/lutim
|
|
|
vim /etc/default/lutim
|
|
|
```
|
|
|
|
|
|
You need to change `LDIR` and `USER` in `/etc/default/lutim` to fit your installation. Then:
|
|
|
|
|
|
```
|
|
|
/etc/init.d/lutim start
|
|
|
```
|
|
|
|
|
|
### Systemd
|
|
|
|
|
|
```
|
|
|
cp utilities/lutim.service /etc/systemd/system/
|
|
|
vim /etc/systemd/system/lutim.service
|
|
|
```
|
|
|
|
|
|
You need to change `User`, `WorkingDirectory` and `PIDFile` in `/etc/systemd/system/lutim.service` to fit your installation. Then:
|
|
|
|
|
|
```
|
|
|
systemctl daemon-reload
|
|
|
systemctl start lutim.service
|
|
|
```
|
|
|
|
|
|
### Upstart
|
|
|
|
|
|
```
|
|
|
cp utilities/lutim_upstart.conf /etc/init/lutim.conf
|
|
|
cp utilities/lutim.default /etc/default/lutim
|
|
|
vim /etc/default/lutim
|
|
|
```
|
|
|
|
|
|
You need to change `LDIR` and `USER` in `/etc/default/lutim` to fit your installation. Then:
|
|
|
|
|
|
```
|
|
|
start lutim
|
|
|
```
|
|
|
|
|
|
## Putting Lutim behind Nginx
|
|
|
|
|
|
Lutim is served by `hypnotoad`, a production-ready web server, but there's a lot of chances that you want to serve other web sites on your server. Your best shot is to use Nginx.
|
|
|
|
|
|
Here's a valid *Nginx* configuration:
|
|
|
```
|
|
|
server {
|
|
|
listen 80;
|
|
|
root /var/www/lutim/public;
|
|
|
|
|
|
# This is important for user's privacy !
|
|
|
access_log off;
|
|
|
error_log /var/log/nginx/lutim.error.log;
|
|
|
|
|
|
# This is important ! Make it OK with your Lutim configuration
|
|
|
client_max_body_size 40M;
|
|
|
|
|
|
location ~* ^/(img|css|font|js)/ {
|
|
|
try_files $uri @lutim;
|
|
|
add_header Expires "Thu, 31 Dec 2037 23:55:55 GMT";
|
|
|
add_header Cache-Control "public, max-age=315360000";
|
|
|
|
|
|
# HTTPS only header, improves security
|
|
|
#add_header Strict-Transport-Security "max-age=15768000";
|
|
|
}
|
|
|
|
|
|
location / {
|
|
|
try_files $uri @lutim;
|
|
|
|
|
|
# HTTPS only header, improves security
|
|
|
#add_header Strict-Transport-Security "max-age=15768000";
|
|
|
}
|
|
|
|
|
|
location @lutim {
|
|
|
# Adapt this to your configuration
|
|
|
# My advice: put a varnish between nginx and Lutim, it's really useful when images are widely viewed
|
|
|
proxy_pass http://127.0.0.1:8080;
|
|
|
|
|
|
proxy_set_header Host $host;
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
|
|
# If you want to log the remote port of the image senders, you'll need that
|
|
|
proxy_set_header X-Remote-Port $remote_port;
|
|
|
|
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
|
|
|
|
# We expect the downsteam servers to redirect to the right hostname, so don't do any rewrites here.
|
|
|
proxy_redirect off;
|
|
|
}
|
|
|
}
|
|
|
```
|
|
|
|
|
|
If you use Lutim under a subdirectory like `/lutim/`, change the `prefix` configuration option and prefix the nginx locations with `/lutim` (or whatever you choose).
|
|
|
|
|
|
-------
|
|
|
|
|
|
You can now go to the [cron jobs page](cron-jobs) or go back to [wiki's homepage](home). |