Apache CGI support

Can someone suggest how to enable CGI support in Apache24?

In httpd.conf there is:

Code:
<IfModule !mpm_prefork_module>
        #LoadModule cgid_module libexec/apache24/mod_cgid.so
</IfModule>
<IfModule mpm_prefork_module>
        #LoadModule cgi_module libexec/apache24/mod_cgi.so
</IfModule>

Should I uncomment both statements?
 
Last edited by a moderator:
Can someone suggest how to enable CGI support in Apache24?

In httpd.conf there is:

Code:
<IfModule !mpm_prefork_module>
        #LoadModule cgid_module libexec/apache24/mod_cgid.so
</IfModule>
<IfModule mpm_prefork_module>
        #LoadModule cgi_module libexec/apache24/mod_cgi.so
</IfModule>

Should I uncomment both statements?
There are three different ways to run CGI in Apache24. If you uncomment
Code:
<IfModule mpm_prefork_module>

        #LoadModule cgi_module libexec/apache24/mod_cgi.so

</IfModule>

you will use build in CGI module. You can also run CGI scripts using FastCGI or mod_perl. Each of these three different methods has pros and cons. If you are new to Perl you should stick with CGI module and just uncomment the line I told you about.
 
I have uncommented the lines in httpd.conf but the CGI scripts still don't run. I suspect it has something to do with permissions...
 
If the permissions are OK but you see Perl scripts as a text files application can't find Perl on FreeBSD machine. Unfortunately these days lots of applications expect Ubuntu under the hood or at best Linux.Create symbolic links.
 
I think there is something wrong with the permissions. I get a Forbidden error, rather than unformatted text.
 
Then you should check Apache's logfiles.
 
It looks as though I have an Apache configuration problem...

Code:
[Wed Jun 01 14:50:59.281923 2016] [cgi:error] [pid 83966] [client 82.37.215.2
18:8745] AH02812: attempt to invoke directory as script: /usr/local/mailman/cgi-bin/
 
It looks as though I have an Apache configuration problem...

Code:
[Wed Jun 01 14:50:59.281923 2016] [cgi:error] [pid 83966] [client 82.37.215.2
18:8745] AH02812: attempt to invoke directory as script: /usr/local/mailman/cgi-bin/

Mailman is a Python script. I thought we were troubleshooting Perl. Personally for Python I use uWSGI and Nginx. I have never used Python on Apache. The only reason I got into discussion was that I recently set Foswiki which is true Perl application on FreeBSD so my memory was still fresh.
 
Back
Top