CGI issue running in the new installed CWP with Centos 7

Started by kelyiu3000, June 08, 2017, 06:36:54 AM

Previous topic - Next topic

kelyiu3000

I installed CWP in Centos 7 using minimal install option in VM with 2core and 4GB RAM.

After installation, I enabled the mod_cgid.so in Apache module.
Default it is not enabled.

And I have installed Perl and Perl-CGI in the OS.

I also added this to my /usr/local/apache/conf/httpd.conf
<Directory "/home/*/public_html/">
      AllowOverride All
      Options +ExecCGI
      AddHandler cgi-script .cgi .pl
</Directory>

When I try to execute .cgi, it will show 500 error.
Log said is [cgid:error] End of script output before headers.

It seems the permission issue. but the file is also 755 in permission.

I run in terminal is without any error.

Please advise how I can fix this issue.

kelyiu3000

The code in test.cgi is


#!/usr/bin/perl

print "Content-type: text/html\n\n";

print "Hello, World.";


geolaw

Updated last week and just found out my own cgi scripts weren't working

DOH!

I have these options enabled in httpd.conf

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

and my scripts started working again.
hope this helps.


har0ld

After following the instructions from this link http://wiki.centos-webpanel.com/how-to-run-cgi-scripts-with-apache I am still unable to run CGI scripts. It turns out I also need perl-CGI installed which is not installed by default (CWP version 0.9.8.354)

yum install perl-CGI