Last active
August 29, 2015 14:07
-
-
Save spuder/22ed92099f3cfe82316b to your computer and use it in GitHub Desktop.
Gitlab + Logstalgia
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The client must have an x11 window running (for the graphics) | |
ssh foo@192.0.2.0 tail -f /home/foo/logstalgia.log | logstalgia --sync | |
Verify that the logstalgia-client can ssh to the logstalgia-server without passwords by setting up ssh key access |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# On the logstalia server, make sure the logstalgia-client can access with ssh keys | |
Verify that there is a file in ~/logstalgia.log | |
Theoretically you could link the logstalgia-client directly to the web-server, however this is less secure since the client could be compromised. By using a logstalgia server, if the client is compromised an attacker could only recover some logs. | |
It also gives us the advantage of sending multiple webservers to one logstalia log file. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# On the web server, tail the logs like so: | |
#!/usr/bin/env bash | |
tail -f /var/log/nginx/gitlab_access.log -f /var/log/nginx/gitlab_error.log -f /var/log/nginx/access.log -f /var/log/nginx/error.log | ssh foo@192.0.2.0 " cat >> logstalgia.log" | |
Also setup ssh key access from gitlab-server to logstalgia log server | |
ssh-copy-id -i ~/.ssh/id_rsa.pub foo@logstalgia-server | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment