I am following these instructions,

http://www.ubuntugeek.com/how-to-install-apache2-webserver-with-phpcgi-a
nd-perl-support-in-ubuntu-server.html

but when i type, http://localhost it prompts to open the CGI script that
i set at the location in text editor. It does not execute..... I have
seen the link http://httpd.apache.org/docs/2.2/howto/cgi.html which you
have given but on these pages it has not been showed step by step what
files to configure and how to configure. Can you please provide me any
web site or tutorial that explains Apache2 from the basics and how to
make it compatible with CGI, MySql and SSL support.


Regards,



First I should point out a few customs on the mailing list; 1) Always
include the list so that others might learn/add to the thread; 2) Bottom
post, it makes it easier for others to follow.

 

What was the url you tried? This is what I would have expected it to be
http://localhost/cgi-bin/yourscript.pl  

 

Yes if your browser is prompting you to open/save the file then you have
not configured the directory to execute scripts.  

 

The Apache documentation say that you can configure a directory to
execute cgi scripts with this line in your apache config.

 

ScriptAlias /cgi-bin/ /usr/local/apache2/cgi-bin/

 

The default location for your Apache config is
"/etc/apache2/apache2.conf".

Have a look for a line like the one above. The line basically say "When
someone requests a file from the http://localhost/cgi-bin/, execute it"

It maps the url /cgi-bin to the local directory
/usr/local/apache2/cgi-bin.

 

The Apache docs also show that you can enable any number of directories
with a stanza like this:

<Directory /usr/local/apache2/htdocs/somedir>
    Options +ExecCGI
</Directory>

 

The +ExecCGI means execute files found in
/usr/local/apache2/htdocs/somedir

This is another way to get scripts to execute.

 

That is all your missing at the moment. You need to tell apache to
execute/run files in the cgi-bin. Also ensure that you have set the
executable bit on the file (chmod +x yourscript.pl).

 

Good luck,

Dp.

 


Reply via email to