top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to log access to a specific web application in apache?

+2 votes
257 views

My Apache server host few applications something like :

/var/www/A
/var/www/B

I would like to trace access for a specific application, eg. A. Is it possible?

Or should I use 'LogLevel info' and so log all applications into access.log file (then parsing for specific web page) ?

My config for logging is :

..
ErrorLog /var/log/apache2/error.log
LogLevel info
CustomLog /var/log/apache2/access.log combined
..
posted Jan 26, 2014 by Anderson

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

Yes if they have separate vhosts. Then in the vhost for the app A you can put lets say:

ErrorLog /var/log/apache2/error_A.log
LogLevel info
CustomLog /var/log/apache2/access_A.log combined 
answer Jan 26, 2014 by Deepak Dasgupta
Similar Questions
+1 vote

I'm investigating a problem on an older server, and something strange is going on. Instead of the correct client address being logged in /var/httpd/*log, an apparently random address is logged instead.
E.g. 98.144.147.0, 98.208.248.0, 98.144.141.0

Every client is logged as the same address. If I restart httpd, this address changes.

This is httpd-2.0.63 with php-4.3.9 running on CentOS 4.6. The RPMs for httpd and PHP verify OK, with the exception of httpd.conf and php.ini - i.e., the httpd server and libraries (and also all the dynamic libraries httpd is linked with) appear to be intact.

The address of open connections is returned correctly with netstat.

+1 vote

For my project I need to know that - is there a way to log or capture the cause of android reboot, whether user manually powered off / rebooted the devices or wether system_server got restarted by adb kill or it was watchdog who restarted the device.

+2 votes

Is there a way to force Tomcat to set permissions on log files when they’re created? It seems as though this would be something defined in the logging.properties file, but it doesn’t seem like it’s an option.

I want the permissions of all log files created (on server startup/log rollover) to be 640. The only way I can think of doing this is either adding the command to the startup script, or by running a cron job every hour or so. However, if there is a way to make sure the log files are never more permissive than 640, that would be greatly preferable.

+1 vote

I have got a bash script that has two parts.
1. runs a script as a different user (using su -c )
2. when that part finishes, the script does a copy of the files created to another directory
I want to log the output of the entire script into one file. i.e.: internal script>external script> logfile
Whats the best way to do this?

+1 vote

I have a script-service running on a remote server, listening on a specific port. What i need here is to make this also maintain a log file of ALL incoming connections.

Could someone suggest to me a simple codefunction example to implement that on my main running service?

...