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!

php / cgi access

Discussion in 'General Discussion' started by anand, Mar 30, 2004.

  1. anand

    anand Well-Known Member

    Joined:
    Nov 11, 2002
    Messages:
    1,435
    Likes Received:
    1
    Trophy Points:
    168
    Location:
    India
    cPanel Access Level:
    DataCenter Provider
    I searched it on the forums however found no answer for the same.

    I have a customer, he asked me to disable php/ cgi on a particular folder under his user account. Any ideas how to do so ?

    For perl i can remove the cgi-bin from httpd.conf, but i believe perl scripts can still run outside. Anyway to stop that ?

    For php, while posting this message i found this on a website

    <Directory /home/*/public_html>
    php_admin_flag engine off
    </Directory>

    I will check this.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. casey

    casey Well-Known Member

    Joined:
    Jan 17, 2003
    Messages:
    2,303
    Likes Received:
    0
    Trophy Points:
    191
    I don't think you can do anything clean with cgi, but how about setting up a cron job to chmod 644 /* every 5 minutes or so? That would effectively disable it...
     
  3. anand

    anand Well-Known Member

    Joined:
    Nov 11, 2002
    Messages:
    1,435
    Likes Received:
    1
    Trophy Points:
    168
    Location:
    India
    cPanel Access Level:
    DataCenter Provider
    heheh thats nice. :p

    I just thought is there a way to restrict file accessing through .htacces file ?

    1. Remove the cgi-bin for the user
    2. Setup a .htaccess file to disable access to any .cgi / .pl file.

    Any ideas ? I will check this out in a while though.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. anand

    anand Well-Known Member

    Joined:
    Nov 11, 2002
    Messages:
    1,435
    Likes Received:
    1
    Trophy Points:
    168
    Location:
    India
    cPanel Access Level:
    DataCenter Provider
    This seems to be working for me.

    1. cd /home/user/public_html
    2. pico .htaccess

    AddType text/txt .php
    AddType text/txt .cgi
    AddType text/txt .pl

    3. Save and exit.

    Now place any php/cgi/pl inside the directory, it give you to download the file.

    Atleast at present its disabled :)
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. casey

    casey Well-Known Member

    Joined:
    Jan 17, 2003
    Messages:
    2,303
    Likes Received:
    0
    Trophy Points:
    191
    Very cool. :)
     
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