Does "CGI Access" for a site not include "ScriptAlias /cgi-bin/ /home/<USER>/public_html/cgi-bin/" anymore in httpd.conf ?

Markif

Well-Known Member
Nov 9, 2016
55
7
133
Toulouse
cPanel Access Level
Root Administrator
Hello,
we have a client that needs
"ScriptAlias /cgi-bin/ /home/<USER>/public_html/cgi-bin/"
in httpd.conf
It seems to me that "in the past" ticking the "CGI Access" in "Modify an Account" had as consequence of adding this in the VirtualHost / ServerName section of the site in httpd.conf.
Apache config:
<IfModule alias_module>
    ScriptAlias /cgi-bin/ /home/<SITE>/public_html/cgi-bin/
</IfModule>
This seems no not to be so anymore?
To solve this I have added it now in
/etc/apache2/conf.d/userdata/ssl/2_4/<USER>/<DOMAIN>/addcgibin.conf
and
/etc/apache2/conf.d/userdata/std/2_4/<USER>/<DOMAIN>/addcgibin.conf
and this solves the problem.
But my question is if ticking the "CGI Access" in "Modify an Account" does not do this anymore ?
Thanks
 
Last edited by a moderator:

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
10,360
1,632
363
cPanel Access Level
Root Administrator
Hey there! I created a version 100 server and the created a cPanel account without ticking the CGI box. This is what the vhost looked like:

Code:
<VirtualHost 10.2.32.104:80>
  ServerName cptest.com
    ServerAlias mail.cptest.com www.cptest.com
  DocumentRoot /home/cptest/public_html
  ServerAdmin [email protected]
  UseCanonicalName Off
  Options -ExecCGI -Includes
  RemoveHandler cgi-script .cgi .pl .plx .ppl .perl
I then created a second account with CGI checked, which is the default setting, and that vhost looks like this:

Code:
<VirtualHost 10.2.32.104:80>
  ServerName cptest2.com
    ServerAlias mail.cptest2.com www.cptest2.com
  DocumentRoot /home/cptest2/public_html
  ServerAdmin [email protected]
  UseCanonicalName Off
so on my end this seems to be working as intended as the "ExecCGI" value is not being excluded on the cptest2 account.

I do also see the ScriptAlias line for the cptest2 user:

Code:
  <IfModule alias_module>
    ScriptAlias /cgi-bin/ /home/cptest2/public_html/cgi-bin/
  </IfModule>
while that is missing from cptest.

Can you let me know what cPanel version you're running where you're seeing this behavior?