Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > General

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 10th March 2014, 10:27
emanuelebruno emanuelebruno is offline
Member
 
Join Date: Mar 2013
Posts: 33
Thanks: 1
Thanked 0 Times in 0 Posts
Exclamation A website was destroying ispconfig!

Hi to all,
this is an incredible story: my customer's web site (with wordpress inside) had a php internal error (caused by a plugin)... for this reason, the linux operative system had created many error log file of 40 GB, wasting all file system space....

as you know the directory /var/www/clients/client0/web1/log is created by root and the file owner is root so for this reason, the quota setting for the user web1 is not valid...

Does anybody know how to avoid this problem in the future?

PS: I believe that this problem is very serious and should be addressed in the guides that talk about how to install ispconfig
Reply With Quote
Sponsored Links
  #2  
Old 10th March 2014, 10:46
till till is online now
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,958
Thanks: 825
Thanked 5,362 Times in 4,209 Posts
Default

The log directory is not /var/www/clients/client0/web1/log. /var/www/clients/client0/web1/log is just a mount point for asier access to the logs in /var/log/httpd/.... So all log files are in /var/log and its subdirectories, e.g. the access and error logs of the webstes are in /var/log/httpd/domain.tld/ So you can prevent that issue by creating a separate partition for log files on your harddisk.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 10th March 2014, 11:15
emanuelebruno emanuelebruno is offline
Member
 
Join Date: Mar 2013
Posts: 33
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by till View Post
The log directory is not /var/www/clients/client0/web1/log. /var/www/clients/client0/web1/log is just a mount point for asier access to the logs in /var/log/httpd/.... So all log files are in /var/log and its subdirectories, e.g. the access and error logs of the webstes are in /var/log/httpd/domain.tld/ So you can prevent that issue by creating a separate partition for log files on your harddisk.
Suppose that it is not possibile (for now, I can't reinstall my production server), I have found another solution :

What do you think about it?

PS I reccomend to suggest it into your ISPCONFIG GUIDES
Reply With Quote
  #4  
Old 10th March 2014, 12:41
till till is online now
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,958
Thanks: 825
Thanked 5,362 Times in 4,209 Posts
Default

Thats what ispconfig is doing already in the 3.0.5.x releases. The log size is checked every night like logrotate is doing it in the guides you posted above and a new log file gets started when the first one gets too big and the old one gets compressed.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #5  
Old 10th March 2014, 19:43
emanuelebruno emanuelebruno is offline
Member
 
Join Date: Mar 2013
Posts: 33
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by till View Post
Thats what ispconfig is doing already in the 3.0.5.x releases. The log size is checked every night like logrotate is doing it in the guides you posted above and a new log file gets started when the first one gets too big and the old one gets compressed.
Thank you for your reply... you say that "the log size is checked every night"... for this reason in 13 hours "a 40 gb file" has been created after the midnight and I don't want that... (calculating 40gb/13hours=near 74 GB in 24 hours!)

Calculating 10 web site with the same problem = 740 GB !!

An hacker could infect some "cms plugin" to create this problem to logs files...
Reply With Quote
  #6  
Old 10th March 2014, 20:25
till till is online now
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,958
Thanks: 825
Thanked 5,362 Times in 4,209 Posts
Default

Logrotate, which you posted above, is also checking the filesize once every night.

you can use some code from crob_daily.php in ispconfig and run it e.g. once every hour, if you like to have the files checked more often.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #7  
Old 17th March 2014, 16:26
emanuelebruno emanuelebruno is offline
Member
 
Join Date: Mar 2013
Posts: 33
Thanks: 1
Thanked 0 Times in 0 Posts
 
Default

Hi till, looking into /etc/logrotate.d/apache2, can I modify the code so it compress the file when it reaches the 250MB size?

Code:
/var/log/apache2/*.log {
        size 250M
	weekly
	missingok
	rotate 52
	compress
	delaycompress
	notifempty
	create 640 root adm
	sharedscripts
	postrotate
		/etc/init.d/apache2 reload > /dev/null
	endscript
	prerotate
		if [ -d /etc/logrotate.d/httpd-prerotate ]; then \
			run-parts /etc/logrotate.d/httpd-prerotate; \
		fi; \
	endscript
}
Thank you for your reply.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ISPConfig website ip and ssl Florent Installation/Configuration 3 8th May 2013 09:35
ISPConfig can not connect to website ph-tvs Installation/Configuration 1 20th February 2011 23:40
ISPconfig 3: can't send or receive messages zogthegreat Installation/Configuration 6 22nd May 2010 14:45
Hosting multiple websites and webmail dmwcool Installation/Configuration 8 30th March 2010 03:15
ISPConfig 2.3.2-dev released till General 9 4th June 2007 10:46


All times are GMT +2. The time now is 12:02.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.