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.

Need to run a shared Perl script

Discussion in 'General Discussion' started by soundguy, Jan 30, 2008.

  1. soundguy

    soundguy Well-Known Member
    PartnerNOC

    Joined:
    Oct 29, 2003
    Messages:
    52
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    seattle
    I need to provide all users access to a series of Perl scripts in some kind of shared location but I cannot find a way to work around suexec. I found a couple of mentions on the forum but they are all OLD and didn't seem to resolve anything to anyone's satisfaction. Here's one from 3 years ago:

    http://forums.cpanel.net/showthread.php?t=35360&highlight=shared+perl+script

    I'm running Release on CentOS 4.5 and 5 with a fairly "cPanel stock" Apache 1.3.3.6 with mod_auth_mysql added. I'm willing to give the configuration in the above post a shot, but I'm wondering if it is still valid in CP11? There doesn't seem to be anyone but root in the wheel group these days, probably for good reason. Do I need to create a whole new user for this?

    I'd also like to know if aliasing a directory to another directory negates the ability to run scripts in the original one, like mounting another file system over an existing directory full of files. (I want to have the option of overriding the shared copy with a local copy on one or two accounts so I can do prototyping and to accommodate special mods) Since these are all working store systems, I want to make sure that creating the alias isn't going to kill all the current local copies.

    These scripts currently have individual copies in each user's "cgi" folder (not cgi-bin) and I want to run them all from /home/cgi so I can update them all at once instead of doing each one individually. (there are hundreds of users) I love suexec because I can see exactly which account my Perl scripts are running on but it sure makes this shared thing a pain :)
     
  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
    IIRC, you should be able to do this using an Alias in httpd.conf pointing to a shared directory owned by root:wheel - this is how cPanel achieves this with their cgi-sys shared scripts in /usr/local/cpanel/cgi-sys/
     
  3. soundguy

    soundguy Well-Known Member
    PartnerNOC

    Joined:
    Oct 29, 2003
    Messages:
    52
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    seattle
    I don't think they do it that way anymore. There is only one user in the wheel group by default now - root. For testing purposes, I added one user to the wheel group and I'm working from that hosting space. I've tried this over and over with all kinds of permissions for both the directory and the script - 0711, 0755, 4711, 4755, 6711, 6755

    If I have indexes on, I can "see" the script in the aliased directory in a web browser pointed at the user's domain, but with root:wheel ownership on either/both the directory & file, clicking the file name throws a 500 error. If I chown both directory and file to user:user, it runs as expected from the alias

    I don't have user shells enabled on my servers so I can't test it from the command line as the user, but I wouldn't be surprised if it works fine as root:wheel. The issue seems to be apache and suexec.
     
Loading...

Share This Page