Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

After a PCI scan identified guestbook.cgi as a risk, I want to disable the cgi-scripts installed by WHM (v11, running on CentOS5). I would like to do this "properly" using the WHM Web interface if possible (so this configuration survives an update and is easily reproduced).

Things I've tried so far that aren't satisfactory:

  1. chmod 0 /usr/local/cpanel/base/cgi-sys/guestbook.cgi

    chattr +i /usr/local/cpanel/base/cgi/guestbook.cgi

    = throws a 500 Internal Server Error when visiting example.com/cgi-sys/guestbook.cgi and may interfere with automatic updates

  2. WHM | Packages | Feature Manager | Edit a Feature List

    Disabled CGI Center

    Disabled Email Scripts (cgiemail,formmail)

    Disabled Simple Guestbook

    Disabled Advanced Guestbook

    = no change when visiting example.com/cgi-sys/guestbook.cgi (HTTP200 No Username given)

I've search forums.cpanel.net, which are usually pretty good but I can't find an answer that doesn't have undesirable side effects.

share|improve this question

2 Answers 2

up vote 0 down vote accepted

I tried using WHM's 'Include Editor' (for httpd.conf edits that survive an update) but settled on using a .htaccess file in /usr/local/cpanel/cgi-sys/ instead. I'm sure there's a probably a better way to do it but this works for me:

# cat /usr/local/cpanel/cgi-sys/.htaccess
RewriteEngine On
RewriteRule ^guestbook.cgi$ [G,L]

# chattr +i /usr/local/cpanel/cgi-sys/.htaccess
share|improve this answer
    
if there's a proper way to do it I'd like to hear suggestions, please? –  agtb Oct 18 '11 at 19:00

To disable cPanel's "CGI Center" scripts via WHM for all accounts or a specific plan:

  1. After logging into WHM navigate to Packages > Feature Manager
  2. Select the feature list your plans are using under Edit a Feature List (to check edit the plan under Packages > Edit a Package)
  3. Uncheck CGI Center, click Save

To disable for a specific account (per cPanel), see https://forums.cpanel.net/f5/one-more-immutable-files-preventing-cpanel-whm-updating-your-serve-214301-p2.html#post1017292

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.