How-to
I assume you've prepare everything needed to access your website globally via apache and cloudflare. In this tutorial, I setup a symlink on the /var/www
directory to my home directory.
Take a look on the official documentation for the rest of tutorial
Overall steps are:
- enable the
mod_remoteip
module - change LogFormat
- restart apache
Additional notes
The command a2blabla
is expected to be unavailable on non-Debian-based distributions.
if you encounter any 403 error, try to ensure the http
user have correct permission:
sudo -u http ls -lah path-to-symlink
clear apache log by Tom O'Connor:
:>/var/log/httpd/the_file
Bonus
if you want to know how much machine visit your home, you can identify the machine based on IP address (assuming each machine only assigned one IP address):
awk '{print $1}' /var/log/httpd/access_log | sort | uniq
What next?
Log the client IP is useful if:
- Your app need the client IP, well.. it's obvious reason.
- You just simply want to observe who visit your home :3
See more about log format on Apache website