New in CWP Edge-LatestFree with every CWPpro licenceWebsites up to 300x faster

CWP now includes LSPHP, LSAPI-Cache and CWP Cage at no extra cost with all CWPpro licences. The LSAPI-Cache plugin is integrated into our WordPress and other script installers, and CWP Cage gives every user complete isolation. Available now in the CWP Edge-Latest version.

Get CWPpro ›

How to run perl cgi outside cgi-bin folder ?

Started by sappurit, October 18, 2021, 08:08:50 PM

Previous topic - Next topic

sappurit

/usr/local/apache/conf.d/mod_cgid.conf


LoadModule suexec_module modules/mod_suexec.so
LoadModule cgid_module modules/mod_cgid.so

<IfModule cgid_module>
<Directory /home/*/public_html/cgi-bin/>
Options ExecCGI SymLinksifOwnerMatch
SetHandler cgi-script
AddHandler cgi-script .cgi .pl .py
Require all granted
AllowOverride All
</Directory>
</IfModule>


Work very well. But when I changed to
<Directory /home/*/public_html/>
It crash all accesses even-though .htm

sappurit

#1
Solved now! with the following code:


LoadModule suexec_module modules/mod_suexec.so
LoadModule cgid_module modules/mod_cgid.so

<IfModule cgid_module>
<Directory "/home/*/public_html/">
Options +ExecCGI +Includes +SymLinksIfOwnerMatch
AddHandler cgi-script .cgi .pl
Require all granted
AllowOverride All
</Directory>
</IfModule>



I saw in errorlog and search about:
[cgid:error] [pid 41348:tid 139847045981952] [client 49.237.xx.xxx:24894] End of script output before headers: index.cgi

and found the same problem at
https://stackoverflow.com/questions/28265735/apache-cgi-in-user-directory-end-of-script-output-before-headers

I checked the user public_html folder and found out that group was set to nobody.
Then I chgrp to the user group and chmod to 755.
Then all working.