Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CGI/SSI On Apache Question

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I've searched everywhere on the net, and the apache website. I found some info on how to get CGI and SSI to work, the problem is it still won't work. I inserted the tags that apache said but CGI and SSI still won't work. I made a small test page but it still won't work. Could some one please give a link to any place that could help me, or could you give me some tips on what to do. All i want is to CGI, to insert polls and stuff, and i want SSI so i can insert a news page into a main page... any help would be helpful, thanks...
 
Hi Bhishma
What OS are you running? If you are running linux, in most cases you just have to edit httpd.conf. If you are running windows, you will have to install and test perl. In either case it's not a bad idea to make sure perl is working. Then edit httpd.conf to make sure you at least have the following directives:

ScriptAlias /cgi-bin/ "/var/
<Directory &quot;/var/ AllowOverride None
Options ExecCGI
Order allow,deny
Allow from all
</Directory>

AddHandler cgi-script .cgi .pl

If this doesn't get you working, you may have to load some modules.
 
Hi,

Both mod_cgi and mod_include are in the base part of the apache distribution so you should have all the code - its just a matter of configuring httpd.conf .

For SSI you need the following directives :

LoadModule includes_module modules/mod_include.so

AddModule mod_include.c

AddType text/html .shtml

AddHandler server-parsed .shtml


You also need to have the 'Includes' option set on either globally of in the relevant context, e.g. Directory container, etc.

Options Includes

For cgi, it's as per RhythmAce's advice above but you should verify that the following are also in place within httpd.conf :

LoadModule cgi_module modules/mod_cgi.so

AddModule mod_cgi.c


(They are probably there by default)

Again you need an 'options' directive for the directory container as illustrated in RhythmAce's post .... For both cgi + ssi you'd need that to read :

Options Includes ExecCGI

Remember you need the scripts to be readable by the Apache process owner and (if linux/unix) you must mark them as executable - e.g. 'chmod +x mycgiscript.pl'

What kind of errors are you getting ??

Regards


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top