How do I log visits to a certain subdirectory of my website?

557 views Asked by At

I have a simple apache server (the default installation on Digitalocean). I can view visits to the domain in the /var/log/apache2 directory, but how do I see which subdirectory they viewed? If this isn't something that's logged by default, how should I set it up?

1

There are 1 answers

0
fabiofcferreira On

There is indeed a logfile for all requests the server processed.

RHEL / Red Hat / CentOS / Fedora Linux Apache access file location is:

/var/log/httpd/access_log

Debian / Ubuntu Linux Apache access log file location is:

/var/log/apache2/access.log

FreeBSD Apache access log file location is:

/var/log/httpd-access.log

By default, there you can find the IP address, time, request method, URL the client was using to access your server and browser user agent.

If you want a customized log file you can always visit the official documentation - AccessLog.