Provide a log
Provide log by http
In a linux system, you may use a tool capable of providing a simple log to whoever wants to see.
We do this by copying an excerpt of a file of this log.
Normally these files are located in areas not accessible to the web server, so you have to find a tool to expose these paths to our users: developers in General.
The tool
I devised this solution that committed to provide a log lets me decide what to expose with trivial filters. We write a shell command as follows
While true; do tail-n 100/var/log/apache2/sito.com-error.log >/var/www/sito.com/web/pippo_tutto.txt; sleep 2; done
to run it and leave it in memory, you can use many ways … the choice is yours.
- nohup
- screen
- make a batch to run in the background
So it will be fine even save the command in a bath with our default shell, type bash. So that it runs without too many worries.
Sources
Some sources and articles that may interest you on the net are https://www.rackaid.com/blog/linux-screen-tutorial-and-how-to/ where you find an old but still valid article showing the basics of what I have written and https://www.guru99.com/kali-linux-tutorial.html where you can find interesting ideas about less conventional uses of the operating system.