Author Topic: CGI issue running in the new installed CWP with Centos 7  (Read 10144 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
CGI issue running in the new installed CWP with Centos 7
« on: June 08, 2017, 06:36:54 AM »
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.
« Last Edit: June 08, 2017, 07:16:28 AM by kelyiu3000 »

Offline
*
Re: CGI issue running in the new installed CWP with Centos 7
« Reply #1 on: June 08, 2017, 08:27:51 AM »
The code in test.cgi is

Code: [Select]
#!/usr/bin/perl

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

print "Hello, World.";

Offline
*
Re: CGI issue running in the new installed CWP with Centos 7
« Reply #2 on: June 27, 2017, 01:57:34 PM »
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.


Offline
*
Re: CGI issue running in the new installed CWP with Centos 7
« Reply #3 on: September 10, 2017, 08:38:12 AM »
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)

Code: [Select]
yum install perl-CGI