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.

Create symbolic link from user directory to apache log

Discussion in 'EasyApache' started by Jeff75, Jun 12, 2004.

  1. Jeff75

    Jeff75 Well-Known Member

    Joined:
    Apr 11, 2003
    Messages:
    555
    Likes Received:
    0
    Trophy Points:
    16
    One of my clients would like access to their entire apache log in the domlogs directory. I tried creating a symbolic link in a "logs" directory in their root directory but it's showing 0 bytes. Does anybody know of a way to give clients access to their log file without having to make a copy of it each time they would like it?

    Is there also a way to keep it from being included in their disk space on their account?
     
  2. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Wouldn't it just be easier to use the built-in cPanel options that already provide exactly this:

    cPanel > Raw Log File
    cPanel > Raw Log Manager
     
  3. Jeff75

    Jeff75 Well-Known Member

    Joined:
    Apr 11, 2003
    Messages:
    555
    Likes Received:
    0
    Trophy Points:
    16
    I wasn't wanting to make an archive at the end of the month, but make it so the user can see his entire log file for the month, all throughout the month. IF you have any ideas how to do this please let me know.

    I'd like to be able to just make a link to the log in /usr/local/apache/domlogs/domain.com instead of having to make a copy of it and take up twice the spac.e
     
  4. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    But that's what "cPanel > Raw Log File" gives you - it's a gzipped copy of the current apache log file for the domain.

    If you want to symlink to it (which gives you the exact same data as the cPanel option above), then you need to create a hardlink to the file, so:

    cd /home/username/
    ln /etc/httpd/domlogs/domain.com access_log
     
  5. Jeff75

    Jeff75 Well-Known Member

    Joined:
    Apr 11, 2003
    Messages:
    555
    Likes Received:
    0
    Trophy Points:
    16
    I created the link like you suggested and it seemed to have worked that time except I could not view it when logging in via FTP. I chowned the file to the user's login. Do you know if this is going to screw anything up since it's not owned by root (besides count the space against their account)?

    Do you know why it linked the file without including the "-s" in the link and didn't do it properly when including it? That's what I usually enter when creating symbolic links.
     
  6. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    It's probably down to the FTP server configuration not following symlinks. Creating a hardlink basically puts the same inode of the real file into the directory file for where you're creating it instead of creating a new one and linking that to the real file.

    I didn't need to change the file ownership, but if it works for you ;)

    I don't think changing the ownership will be a problem since the original file in /etc/httpd/logs/domain.com should still have the original ownership of root:username
     
Loading...
Similar Threads - Create symbolic link
  1. nikomaxia
    Replies:
    5
    Views:
    355

Share This Page