Skip to content

Instantly share code, notes, and snippets.

@hugsbrugs
Last active February 28, 2016 14:53
Show Gist options
  • Save hugsbrugs/1dfd91e5e3c1a8ba89db to your computer and use it in GitHub Desktop.
Save hugsbrugs/1dfd91e5e3c1a8ba89db to your computer and use it in GitHub Desktop.
Display Logs in Browser with tailon
# Install tailon
pip install tailon
# start tailon
tailon -f /var/log/apache2/{access,error}.log
tailon -f /var/log/apache2/{access,error}.log -b 127.0.0.1:8080 -d
# SECURE INSTALLATION
# Create a domain or subdomain like tailon.mydomain.com
# Create an apache virtual host
<VirtualHost *:80>
ProxyPreserveHost On
ProxyRequests Off
ServerName tailon.mydomain.com
ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/
<Proxy *>
Order deny,allow
Allow from all
AuthType Basic
AuthName "Dev Server"
AuthUserFile "/var/www/tailon/.htpasswd"
Require valid-user
</Proxy>
</VirtualHost>
# Create according folder and file : /var/www/tailon/.htpasswd
# Create config file : tailon.yaml
bind: 127.0.0.1:7575 # address and port to bind on
allow-transfers: true # allow file downloads
#relative-root: /tailon/ # web app root path (default: '')
commands: [tail, grep, awk] # allowed commands
files:
- '/var/log/apache2/{access,error}.log'
- '/home/hugo/supervisord.log'
- 'cron':
- '/var/log/cron*'
# Automate script with supervisor
[program:tailon]
command=bash -c "tailon -c /home/user/tailon.yaml"
process_name=tailon
numprocs=1
autostart=true
autorestart=true
user=www-data
stdout_logfile=/var/www/supervisor-tailon-info.log
stdout_logfile_maxbytes=1MB
stderr_logfile=/var/www/supervisor-tailon-error.log
stderr_logfile_maxbytes=1MB
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment