Results 1 to 6 of 6
  1. #1

    (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..?

  2. #2
    Join Date
    Nov 2013

    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?

  3. #3
    No the question is how do I manage the log files that will get very large and bring the system to a halt

  4. #4
    Join Date
    Nov 2013
    You might want to take a look at this site

  5. #5
    Join Date
    May 2013
    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.

  6. #6
    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

  1. Rotate Logs
    By ferrarislave in forum Hosting Security and Technology
    Replies: 2
    Last Post: 02-15-2007, 03:04 AM
  2. Rotate Logs
    By varunbihani in forum Hosting Security and Technology
    Replies: 2
    Last Post: 06-08-2005, 04:53 AM
  3. Is there a way to more refinely rotate logs using WHM?
    By GeorgeC in forum Hosting Security and Technology
    Replies: 1
    Last Post: 01-10-2005, 12:42 AM
  4. Script to rotate apache logs at the end of the month
    By JTM in forum Hosting Security and Technology
    Replies: 6
    Last Post: 06-16-2004, 06:56 PM
  5. Webmin Rotate Logs
    By brooky in forum Hosting Software and Control Panels
    Replies: 0
    Last Post: 04-06-2004, 07:52 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts