User Tools

Site Tools


apps:lightmeter

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
apps:lightmeter [2020-11-28 19:44] Manuel Freiapps:lightmeter [2020-12-02 10:25] (current) Manuel Frei
Line 17: Line 17:
  
 <code> <code>
-sudo -u lightmeter /usr/local/bin/lightmeter -workspace /home/lightmeter/lightmeter_workspace -watch_dir /var/log+mkdir /var/lib/lightmeter 
 +chown lightmeter:lightmeter /var/lib/lightmeter
 </code> </code>
- 
  
 <code> <code>
 vim /etc/systemd/system/lightmeter.service vim /etc/systemd/system/lightmeter.service
 +</code>
 +
 +<code>
 +[Unit]
 +Description=Lightmeter is a monitoring and analysis system for Postfix mail servers (https://lightmeter.io)
 +After=network.target
 +
 +[Service]
 +Type=simple
 +User=lightmeter
 +;Group=adm
 +Group=lightmeter
 +ExecStart=/usr/local/bin/lightmeter -workspace /var/lib/lightmeter/lightmeter_workspace -watch_dir /var/log/ -listen 127.0.0.1:8085
 +Restart=on-failure
 +
 +; security
 +PrivateDevices=yes
 +PrivateTmp=yes
 +ProtectSystem=full
 +ReadWriteDirectories=/var/log/ /var/lib/lightmeter/ /usr/local/bin/ /tmp/
 +ProtectHome=yes
 +NoNewPrivileges=yes
 +
 +[Install]
 +WantedBy=multi-user.target
 +</code>
 +
 +<code>
 +systemctl daemon-reload
 +systemctl start lightmeter.service
 +</code>
 +
 +<code>
 +vim /etc/apache2/sites-available/lightmeter.example.com.conf
 +</code>
 +
 +<code>
 +<VirtualHost *:80>
 +    ServerName lightmeter.example.com
 +    ServerAdmin hostmaster@example.com
 +    Redirect "/" "https://lightmeter.example.com/"
 +
 +    ErrorLog ${APACHE_LOG_DIR}/lightmeter.example.com-error.log
 +    LogLevel warn
 +    CustomLog ${APACHE_LOG_DIR}/lightmeter.example.com-access.log combined
 +</VirtualHost>
 +
 +<VirtualHost *:443>
 +    ServerName lightmeter.example.com
 +    ServerAdmin hostmaster@example.com
 +
 +    SSLEngine on
 +    SSLCertificateFile      /etc/dehydrated/certs/example.com/fullchain.pem
 +    SSLCertificateKeyFile   /etc/dehydrated/certs/example.com/privkey.pem
 +
 +    <Location "/.well-known/acme-challenge/">
 +        Allow From All
 +        Satisfy Any
 +    </Location>
 +
 +    ProxyPassMatch ^/.well-known !
 +    ProxyPass "/" "http://127.0.0.1:8085/"
 +    ProxyPassReverse "/" "http://127.0.0.1:8085/"
 +
 +    ErrorLog ${APACHE_LOG_DIR}/lightmeter.example.com-error.log
 +    LogLevel warn
 +    CustomLog ${APACHE_LOG_DIR}/lightmeter.example.com-access.log combined
 +</VirtualHost>
 +</code>
 +
 +<code>
 +a2ensite lightmeter.example.com
 +apachectl graceful
 </code> </code>
apps/lightmeter.1606589063.txt.gz · Last modified: 2020-11-28 19:44 by Manuel Frei