Installation of Lstu
git clone https://framagit.org/luc/lstu.git cd lstu
If you don't want to use the cache system (it uses
memcached), add the following argument to the commands below:
If you don't want to use the LDAP authentication system, add the following argument to the commands below:
If you don't want to use the htpasswd authentication system, add the following argument to the commands below:
If you want to use SQLite:
carton install --deployment --without=test --without=postgresql --without=mysql
If you want to use PostgreSQL:
carton install --deployment --without=test --without=sqlite --without=mysql
If you want to use MySQL:
carton install --deployment --without=test --without=sqlite --without=postgresql
cp lstu.conf.template lstu.conf # Edit the configuration file vi lstu.conf
The configuration file is full of options and self-documented.
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).
To use the cache system, configure
memcached_servers setting like this (use the URL of your memcached server, of course):
memcached_servers => ['127.0.0.1:11211'],
This is good for test, not for production.
# start it carton exec hypnotoad script/lstu # reload it while running (yep, same command) 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).
Heavily used instances
If your instance of Lstu is heavily used, you should take a look at the
minion option: instead of updating the URL's counter right after a visit, this update is enqueued in Minion.
After enabling the use of Minion in
lstu.conf, you'll need to start the queue processing daemon.
You can start it manually with
make minion, but it's better to start it as a service.
Unfortunately for SysVinit users, I only created a systemd service file:
sudo su cp utilities/lstu-minion@.service /etc/systemd/system/ vi /etc/systemd/system/lstu-minion@.service systemctl daemon-reload systemctl enable email@example.com systemctl start firstname.lastname@example.org
You can see that this is a template unit file: you can start more than one minion worker with the same unit file.
You only need to enable it with an other name (
The more minion worker you will start, the quicker the job queue will be processed.
But be careful! As Lstu uses a SQLite database, too much workers will only lead to failures due to an
already locked database.
Start with one worker, and add one if it's not enough to process the queue quick enough.
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
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
For Nginx, use
utilities/lstu.nginx as a template for your virtualhost configuration.
For Apache, use
utilities/lstu.apache as a template for your virtualhost configuration.
Please note that this Apache template comes from the community and that there is no official support for Apache.
Go back to wiki's homepage.