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!

Directory Structure? CGI-BIN location?

Discussion in 'General Discussion' started by gallilaw, Apr 6, 2005.

  1. gallilaw

    gallilaw Registered

    Joined:
    Apr 6, 2005
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    151
    I am switching from a pretty logical system which had this form of path to vhosts

    /home/webadmin/site1.com/html/index.html
    /home/webadmin/site1.com/cgi-bin

    /home/webadmin/site2.com/html/index.html
    /home/webadmin/site2.com/cgi-bin


    Having just opened up Cpanel on Linux for the first time, I see my path looks like this

    /home/username/public_html/
    /home/username/public_html/cgi-bin

    This looks pretty strange -- defaulting a cgi-bin file into a public html directory, and no cgi-bin outside the public html directory.

    Can someone explain what's going on?
     
  2. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    4
    Trophy Points:
    343
    Location:
    ON, Canada
    The cgi-bin is just placed inside the websites directory. It makes it simple. Since the websites directory is public_html and the cgi-bin is inside it, any cgi scripts would be domain.com/cgi-bin/script.pl.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. gallilaw

    gallilaw Registered

    Joined:
    Apr 6, 2005
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    151
    I thought there was a security problem when the cgi-bin directory was located within a public html directory...

    Anyway, all the path statements in the shopping carts and other scripts I have to move point to a cgi-bin outside the public directory.

    It's going to take a lot of work to reconfigure the scirpts.
     
  4. RickG

    RickG Well-Known Member

    Joined:
    Feb 28, 2005
    Messages:
    238
    Likes Received:
    2
    Trophy Points:
    168
    Location:
    North Carolina
    It is easy enough to change this location in /usr/local/apache/conf/httpd.conf for a particular domain (or the default).

    Look for the ScriptAlias /cgi-bin/ line under the VirtualHost container for the domain in question and change it from

    ScriptAlias /cgi-bin/ /home/AccountName/public_html/cgi-bin/
    to
    ScriptAlias /cgi-bin/ /home/AccountName/cgi-bin/

    (if that's what you want)

    You'll have to manually create the new directory

    I recently switched to Cpanel from an Ensim box and the /cgi-bin/ directory was outside of the public_html area. I also preferred this setup if I had to give clients access to the general html directory. With /cgi-bin one level above I could be assured they were not going to play around with any scripts.

    Hope this helps.
     
  5. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,460
    Likes Received:
    21
    Trophy Points:
    463
    Location:
    Go on, have a guess
    Only if it isn't protected by a ScriptAlias in the VirtualHost container, which it is.

    There's nothing wrong with doing it either way, it's different on a cPanel server, so you simply need to adapt :)
     
    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