Using a symlinked Perl script
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,
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:
(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?
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:
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?
Please sign in to leave a comment.
Comments
0 comments