Home  |  Linux  | Mysql  | PHP  | XML
From:Raheel Hassan Date:Tue Apr 21 16:31:31 2009
Subject:Re: how to add support of Msql and CGI in Apache
Please see below for my solution.


On Thu, Apr 16, 2009 at 3:52 PM, Dermot Paikkos <
Dermot.Paikkos@sciencephoto.co.uk> wrote:

> I am following these instructions,
>
> http://www.ubuntugeek.com/how-to-install-apache2-webserver-with-phpcgi-a
> nd-perl-support-in-ubuntu-server.html<http://www.ubuntugeek.com/how-to-install-apache2-webserver-with-phpcgi-a%0And-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.


OK

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

This is my link,
http://localhost/cgi-bin/perltest.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/


As i have installed Apache 2.2.9 so it does not have the above mentioned
path, so i added
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ and now it is working


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


for me it was /usr/lib/cgi-bin/

>
>
> 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).

OK fine thanks it works now, but if i need to install and uninstall mod_cgi
how i will do it in future. IS there any other module that i have to install
for CGI.

>
>
>
> Good luck,
>
> Dp.
>
>
>
>
>

Navigate in group perl.beginners.cgi at sever nntp.perl.org
Previous Next


Your recent visits
Re: 2 off in array count and index
Re: Getting forward slashes and hyphins past the taint check
Perl CGI advise/feedback please ...
Re: CGI ap on NetworkSolutions host
how to add support of Msql and CGI in Apache



  
© No Copyright
You are free to use Anything, but please consult your advocate before doing so as this website
also list content from other sources which may be copyrighted.
Site Maintained by Zareef Ahmed
Powered By PHP Consultants