Results 1 to 6 of 6
-
12-19-2013, 06:44 AM #1Newbie
- Join Date
- Mar 2010
- Posts
- 10
(HELP) Need To Rotate Logs From Virtual Hosts on Ubuntu VPS
I have a 1gb VPS running ubuntu that I have installed Apache, Mysql and PHP.
I have 3 sites all in my home directory that are using name based virtual hosting. I have created three separate files in /etc/apache2/sites-available and enabled them via a2ensite there is also the default site in /var/www as well.
Now my concern is that each one of these sites is running about 10,000 cron jobs per day. How do make sure the logs of each of these do not grow to big and eat all the memory..?
How would I configure the log rotate and how often would one need to perform this task with 1gb of ram..?
-
12-19-2013, 07:44 AM #2Temporarily Suspended
- Join Date
- Nov 2013
- Posts
- 97
Hi,
The question in here is how often the cronjob will run. How fast the cronjob will terminate the job? There are multiple cronjobs which are running simultaneously? Do they take alot of time to complete?
-
12-19-2013, 08:29 AM #3Newbie
- Join Date
- Mar 2010
- Posts
- 10
No the question is how do I manage the log files that will get very large and bring the system to a halt
-
12-19-2013, 08:34 AM #4Temporarily Suspended
- Join Date
- Nov 2013
- Posts
- 97
You might want to take a look at this site
-
12-19-2013, 09:00 AM #5Temporarily Suspended
- Join Date
- May 2013
- Location
- India
- Posts
- 747
Firstly make sure logrotate package is installed on your server. Normally /var/log/cron is where the cron jobs are logged into. By default rotate to this log is added to the system ( in /etc/logrotate.d/syslog ). Check if that file is present in your system and see whether /var/log/cron is listed in that. If it is listed in that, it is good.
-
12-19-2013, 01:59 PM #6Newbie
- Join Date
- Mar 2010
- Posts
- 10
I figured out how to do it.
For anyone else who may have a similar problem...
I opened the /etc/logrotate.d/apache2 file in nano and just copied the block of code and pasted it below changing the path to the wildcard path to all my log files
/var/log/*.log {....} /mydir/pathtomysites/*/log/*.log {....}
and then ran the logrotate command in verbose mode to check that it was working!
Similar Threads
-
Rotate Logs
By ferrarislave in forum Hosting Security and TechnologyReplies: 2Last Post: 02-15-2007, 03:04 AM -
Rotate Logs
By varunbihani in forum Hosting Security and TechnologyReplies: 2Last Post: 06-08-2005, 04:53 AM -
Is there a way to more refinely rotate logs using WHM?
By GeorgeC in forum Hosting Security and TechnologyReplies: 1Last Post: 01-10-2005, 12:42 AM -
Script to rotate apache logs at the end of the month
By JTM in forum Hosting Security and TechnologyReplies: 6Last Post: 06-16-2004, 06:56 PM -
Webmin Rotate Logs
By brooky in forum Hosting Software and Control PanelsReplies: 0Last Post: 04-06-2004, 07:52 AM