Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Using a symlinked Perl script

Discussion in 'General Discussion' started by GoWilkes, May 13, 2019.

  1. GoWilkes

    GoWilkes Well-Known Member

    Joined:
    Sep 26, 2006
    Messages:
    425
    Likes Received:
    7
    Trophy Points:
    168
    cPanel Access Level:
    Root Administrator
    I have several accounts on my server that belong to me. I'm running WHM / cPanel v. 76.0.20 on a CentOS 6.10 xen hvm machine, and Perl v. 5.10.1.

    (I know, I need to upgrade, but it's a huge pain so I'm procrastinating).

    In 2014, I set up a lot of my smaller sites to use Perl .lib files on my main account, so that I wouldn't have to duplicate everything. To do so, I set up a symlink on the smaller account to the main account; eg,

    Code:
    ln -s /home/main_account/public_html/cgi-bin/libs/ /home/new_account/public_html/
    On the main account, the permissions to those libraries are:

    -rwxr-xr-x

    Owner / Group
    main_account / main_account

    And on the smaller account, the permissions for the symlink are:

    lrwxrwxrwx

    Owner / Group
    root / root

    Somewhere along the way, though, the scripts on the smaller sites started to throw an error:

    Code:
    Can't locate /home/new_account/www/cgi-bin/libs/example.lib in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at libs/variables.lib line 24.
    (where variables.lib exists at /home/new_account/cgi-bin/libs/, and line 24 is "require '/home/new_account/www/cgi-bin/libs/example.lib';")

    I have no idea when this started; those smaller sites are so small that I never pay them any attention, but someone just reported the error a few days ago. So it could have been recent, or it might have started 5 years ago.

    Can you guys suggest how I can make these symlinks work the way they used to?
     
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,335
    Likes Received:
    2,162
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello @GoWilkes,

    Using symbolic links in the method you described should be avoided if possible. I recommend using Git if you need to duplicate/sync a master set of files to multiple accounts. We provide a guide on using Git and the "Git Version Control" feature at:

    Guide to Git - cPanel Knowledge Base - cPanel Documentation

    Is this a solution you are open to exploring? If so, feel free to let me know if you have any questions or concerns. I'm happy to help guide you through the setup process.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice