Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Member
    Join Date
    Apr 2003
    Posts
    555

    Default Create symbolic link from user directory to apache log

    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. #2
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,495

    Default

    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
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

  3. #3
    Member
    Join Date
    Apr 2003
    Posts
    555

    Default

    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. #4
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,495

    Default

    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
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

  5. #5
    Member
    Join Date
    Apr 2003
    Posts
    555

    Default

    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. #6
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,495

    Default

    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
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

Similar Threads & Tags
Similar threads

  1. Symbolic link to libmysqlclient.so.14
    By flash7 in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 08-03-2006, 11:33 AM
  2. Urchin symbolic link messed up
    By mooony in forum cPanel and WHM Discussions
    Replies: 6
    Last Post: 12-12-2005, 01:41 PM
  3. symbolic link disappears ???
    By wsenter in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 12-13-2004, 05:01 PM
  4. Webalizer symbolic link
    By billau in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 07-30-2004, 12:17 PM
  5. Is there is a problem adding a symbolic link in a users home directory?
    By DWHS.net in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 05-12-2004, 08:07 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube