var sidebar_align = 'right';
var content_container_margin = parseInt('350px');
var sidebar_width = parseInt('330px');
Can I only log php file on apache access_log?
I have 2G access_log file everyday. And the server will freeze a while during log rotate every morning.
So I want to reduce the size of the log file. I see most of the content in the log file are .jpg, .js, .gif. And I don't these log is necessary.
Can I log only php file?
You can log the .php files only as follows in a different file.
If you are using cpanel, use an Include file.
For this you need mod_setenif and mod_rewrite
You can check if this is present by the following command.
Add the following code to the httpd.conf file
/usr/local/apache/bin/httpd | grep setenvif
/usr/local/apache/bin/httpd | grep rewrite
Make sure you touch the file /usr/local/apache/logs/php-requests.log
SetEnvIf Request_URI \.php$ php-log
CustomLog /usr/local/apache/logs/php-requests.log common env=php-log
After this is done, comment the line below in httpf.conf file
CustomLog "logs/access_log" common
It works! Thank you very much!
By placebo in forum Hosting Security and Technology
Last Post: 07-06-2008, 08:45 AM
By realrena in forum Hosting Security and Technology
Last Post: 06-30-2007, 05:57 PM
By linux2man in forum Hosting Security and Technology
Last Post: 07-27-2006, 05:39 AM
By Serverplan in forum Hosting Security and Technology
Last Post: 03-07-2004, 10:44 AM
By boroon in forum Hosting Security and Technology
Last Post: 10-11-2002, 06:25 AM