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.

how to move logs out of /usr ?

Discussion in 'General Discussion' started by Radio_Head, Oct 21, 2003.

  1. Radio_Head

    Radio_Head Well-Known Member

    Joined:
    Feb 15, 2002
    Messages:
    2,051
    Likes Received:
    1
    Trophy Points:
    38
    Hello

    I need/wish to move logs

    [/usr/local/apache/domlogs]
    and
    [/usr/local/apache/logs]

    out of /usr for example on /home/apachelogs/

    any way to do that ?

    THANK YOU
    (long time ago I read something on this forum but now I cannot find the post)
     
  2. Radio_Head

    Radio_Head Well-Known Member

    Joined:
    Feb 15, 2002
    Messages:
    2,051
    Likes Received:
    1
    Trophy Points:
    38
    I was thinking to do this


    ======================
    mkdir /home/apache/logs/
    chmod 755 /home/apache/logs

    mkdir /home/apache/domlogs
    chmod 755 /home/apache/domlogs


    mv /usr/local/apache/logs/* /home/apache/logs
    mv /usr/local/apache/domlogs/* /home/apache/domlogs


    rmdir /usr/local/apache/logs
    rmdir /usr/local/apache/domlogs

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

    ln -s /home/apache/logs /usr/local/apache/logs
    ln -s /home/apache/domlogs /usr/local/apache/domlogs

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

    ======================


    What do you think , it will work fine ?
     
    #2 Radio_Head, Oct 21, 2003
    Last edited: Oct 21, 2003
  3. Radio_Head

    Radio_Head Well-Known Member

    Joined:
    Feb 15, 2002
    Messages:
    2,051
    Likes Received:
    1
    Trophy Points:
    38
    Hello

    I executed the procedure above , ok worked fine
    :p

    If apache doesn't update logs try
    to stop and restart again apache.
     
  4. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    Could've shortened it too.

    ======================
    mkdir /home/apache/

    mv /usr/local/apache/logs /home/apache
    mv /usr/local/apache/domlogs /home/apache

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

    ln -s /home/apache/logs /usr/local/apache/logs
    ln -s /home/apache/domlogs /usr/local/apache/domlogs

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

    ======================

    That would do the same thing. With mkdir, permissions are already 755, and when moving an entire directory, it's not necessary to create it's new location first. :)
     
Loading...

Share This Page