The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

logs in a different folder

Discussion in 'General Discussion' started by silvernetuk, Dec 1, 2002.

  1. silvernetuk

    silvernetuk Well-Known Member

    Joined:
    Sep 2, 2002
    Messages:
    311
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    United Kingdom
    Hi,

    Is it possible to get the domlogs for each user to /home/username/logs/ in there own accont as I have had to chmod the domlogs folder to 711 which is hiding all the logs.

    So how would I got about moving the logs from domlogs to /home/username/logs ?

    Regards,
    Garry
     
  2. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Toronto, Ontario Canada
    you could do this.

    You would have to copy each log to their area and then make a symbolic link to the file in the domlogs folder. IE:

    cd /home/user/logs
    mv /usr/local/apache/domlogs/userdomainlog .
    cd /usr/local/apache/domlogs
    ln -s /home/user/logs/userdomainlog userdomainlog

    I'm not sure though if the stats programs will respect this or not though.
     
  3. silvernetuk

    silvernetuk Well-Known Member

    Joined:
    Sep 2, 2002
    Messages:
    311
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    United Kingdom
    Hi,

    Thank you for your reply :)

    I don't want to mess up the web stats, but I am starting to think dedicated ip addresses for each client, as I read somewhere if they have dedicated ip address they only get access to this only logs.

    Unless my other this works http://216.118.116.105/read.php?TID=6142

    Regards,
    Garry
     
  4. silvernetuk

    silvernetuk Well-Known Member

    Joined:
    Sep 2, 2002
    Messages:
    311
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    United Kingdom
    Hi,

    Does anyone know if this will or will not affect the stats programs, I have chmod the domlogs to 711.

    Regards,
    Garry
     
  5. Tom Pyles

    Tom Pyles Well-Known Member

    Joined:
    Apr 26, 2002
    Messages:
    254
    Likes Received:
    0
    Trophy Points:
    16
    We have moved our logs over to a different partition because of their size and the stats programs read them just fine/

    Sometimes your logs are just too big and fill up too fast for the current partition they are on. A simple solution to this is to move them to a different partition. For example, let’s say your /usr partition is over %90 and every time you delete your logs, within a few hours it is back at %90 again. The solution is simple and we will discuss how to do this.

    First thing you need to do is to move your logs. We recommend you shut down the service that uses this log along with the chkservd daemon which checks your services. In this example you would want to shutdown chkservd followed by Apache:

    /etc/rc.d/init.d/chkservd stop

    /etc/rc.d/init.d/httpd stop

    Then you would move the two directories to a different partition. Most people use their /home partition, but if you have a backup drive in your server you may want to use it. I prefer to use my backup drive (for logs, since I don't consider my logs to be critical data) as this takes some of the work off the main drive, so I would create a directory on my backup drive:

    mkdir /backup/usr/

    Then I would move the directories over:

    mv /usr/local/apache/domlogs /backup/usr/

    mv /usr/local/apache/logs /backup/usr/

    That will move the two major log directories from your /usr partition to your /backup partition. The last thing you need to do is create the symbolic links in the ‘old’ locations so that Apache can find where you have moved these logs.

    cd /usr/local/apache/

    ln –s /backup/usr/domlogs/ domlogs

    ln –s /backup/usr/logs/ logs

    This will create the links in the ‘old’ location to point to the ‘new’ location. The last thing to do is restart Apache and chkservd:

    /etc/rc.d/init.d/httpd start

    /etc/rc.d/init.d/chkservd start

    And that’s it! Your logs are now stored on your backup partition and will never hassle your /usr partition again.

    Please note that if you are using a back-up that unmounts, you will need to find another partition to move the logs to.
     
Loading...

Share This Page