Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am trying to disable access logging for domains on my dedicated server for over 10 HOURS. I read over 70 pages while I'm searching. I asked on Parallel's forum, I asked stackoverflow in another way.. still I can't disable access logging for domains.

Server configurations are not my profession, I may be considered as newbie to many people in this field.

Last time, I tried to disable it by adding CustomLog /dev/null plesklog to /var/www/vhosts/xxx.com/conf/vhost.conf and run /usr/local/psa/admin/sbin/websrvmng --reconfigure-vhost --vhost-name=xxx.com (source). But It didn't work.

Please help me.

share|improve this question
    
FYI... A 0% accept rate is considered quite rude on this forum network, especially when there has been a lot of good answers to your questions so far. You should accept them if you want people to answer your questions later. –  Yanick Girouard Feb 24 '12 at 13:15
    
I just didn't want to close the discussions so people can learn more if more people answer my questions. –  nahha Feb 25 '12 at 22:05
    
Also, I didn't get any useful answer to some of my questions. Thanks for the heads up. –  nahha Feb 25 '12 at 22:05
add comment

3 Answers

up vote 1 down vote accepted

You really need to learn how to ask your questions, and stop repeating yourself (you've opened several posts for the same question, each with different details)...

Your question should say "How to disable access logs for all vhosts in Apache controlled by Plesk?"

From what I've read, there's no easy way because of the way Plesk creates/rewrites all apache .conf files everytime you modify something.

What someone did, was to create a shell script that replaces all instances of "CustomLog" by "#CustomLog" in all http.include files for each vhosts, and to add this script to the crontab so it runs every 15 minutes.

See his thread: http://forums.theplanet.com/lofiversion/index.php/t52435.html

I would use Perl to do in-place replacements however, like this. My version also only comments out the CustomLog lines if it's the first keyword on the line, and I made it so httpd only reloads (SIGHUP) instead of trying to start it, so it's better:

#!/bin/bash

for FILE in /home/httpd/vhosts/*
do
    perl -p -i -e "s/^[[:space:]]*CustomLog/#CustomLog/" "$FILE/conf/httpd.include"
done
service httpd reload
exit 0

Make sure this is run as root.

share|improve this answer
add comment

I think my solution is not the correct answer to DISABLE the logging of all domain but maybe you like it because it is a simple solution ;-)

My original job was to mask all IP-Addresses, because of a privacy issue. I have two solutions, depending on your Plesk version. This solutions were tested on apache2 CentOS and Debian.

I overwrite the 'plesklog' directive in the "main" Apache configuration file. The '%h' format is replaced by a fixed local IP address and the Plesk space and traffic calculation will work like before.

On Debian squeeze/sid and Plesk 10.x change the configuration file '/etc/apache2/apache2.conf'. Search for the line: 'Include /etc/apache2/conf.d/' and overwrite the 'plesklog' Variable (i.e. %h => 127.0.0.2). Restart apache2 ... Done

#
# Hack to get rid of the IP Address in the log files, 
# plesklog HAVE TO defined AFTER the Plesk zz... Include!
#
Include /etc/apache2/conf.d/
<IfModule mod_logio.c>
    LogFormat "127.0.0.2 %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" plesklog
</IfModule>
<IfModule !mod_logio.c>
    LogFormat "127.0.0.3 %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" plesklog
</IfModule>

On CentOS with Plesk 9.5.x you can change the format in the file '/etc/httpd/conf.d/zz010_psa_httpd.conf' to the wanted format, see above. This is possible, because Plesk 9 don't reconfigure its main config like Plesk 10.

If you want to have no logging at all, just enter a minus or whatever you want, i.e.

LogFormat "-" plesklog

Everything has to be done as root and it will effect EVERY/ALL plesk domain on this server ;-)

share|improve this answer
add comment

To disable the access log for a particular vhost you will have to locate the relevant CustomLog configuration line and precede it with a # to turn it into a comment.

CustomLog logs/access_log plesklog

becomes

#CustomLog logs/access_log plesklog

Once you've done this restart apache

service httpd restart

In your example, to pipe your log to /dev/null, you would need to define the CusomLog like this

CustomLog   "|/dev/null" plesklog

the pipe | at the beginning is important.

share|improve this answer
    
Now I get this error: (98)Address already in use: make_sock: could not bind to address [::]:80 –  nahha Feb 12 '12 at 17:09
    
That would suggest that apache didn't shut down are you sure you did a restart or that you ran it with sufficient privilege? Try service httpd stop then service httpd start. If it still doesn't start see what the output of netstat -ltnp | grep ':80' says –  Iain Feb 12 '12 at 17:22
    
thanks for your help, but you cause me a terrible terrible 10 minutes :D now the server is okay. now I'm trying your new solution –  nahha Feb 12 '12 at 17:32
    
I tried CustomLog "|/dev/null" plesklog, it caused server to crash again. –  nahha Feb 12 '12 at 17:44
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.