I am facing problems in executing cgi programs, on Apache web server, can
any body tell me how i can configure my Apache server so that it can support
CGI and Msql. I also wanted to enable ssl support in the Apache server.
Thanks in advance.
Regards,
Raheel.
Raheel Hassan wrote:
> I am facing problems in executing cgi programs, on Apache web server, can
> any body tell me how i can configure my Apache server so that it can support
> CGI and Msql. I also wanted to enable ssl support in the Apache server.
Yes, this is a better place to ask HTTP questions than the beginners
list. There I posted these two addresses:
http://httpd.apache.org/docs/2.0/howto/cgi.html
http://httpd.apache.org/docs/2.0/ssl/
but you let me know (privately) that your problems remain.
I believe that if you need further help, you'd better be very specific
about what you have tried, which error messages you get etc. These
general guidelines about asking questions on technical lists and
newsgroups may be useful:
http://www.catb.org/~esr/faqs/smart-questions.html
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
The basics are:
1) Configure a directory as your cgi-bin directory*.
2) Create a basic script to excute**
3) Install from cpan DBI and DBD::mysql
When you get up to stage 2, you should post back to the list with what
you have and you should get some help with the rest.
Good luck,
Dp.
* See ~/howto/cgi.html at httpd.apache.org
** perldoc CGI
Configuration of dynamic content is done via the Apache configuration
file. Find your Apache conf file (httpd.conf) and edit it according to
the instructions that you can find here:
http://httpd.apache.org/docs/2.2/howto/cgi.html
Good luck,
Dp.
From: Raheel Hassan [mailto:raheel...@gmail.com]
Sent: 16 April 2009 09:17
To: Dermot Paikkos
Subject: Re: how to add support of Msql and CGI in Apache
Could you please tell me which directory i need to configure and what
changes i need to make in which configuration file so that i can execute
my CGI scripts. I have already created my CGI scripts and i am using
Apache2.2.9.
Kindest Regards,
Raheel.
The basics are:
Good luck,
Dp.
--
To unsubscribe, e-mail: beginners-cg...@perl.org
For additional commands, e-mail: beginners...@perl.org
http://learn.perl.org/
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.
On Thu, Apr 16, 2009 at 3:52 PM, Dermot Paikkos <
Dermot....@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.
>
>
>
>
>
From: Raheel Hassan [mailto:raheel...@gmail.com]
Sent: 21 April 2009 17:32
To: Dermot Paikkos
Cc: beginn...@perl.org
Subject: Re: how to add support of Msql and CGI in Apache
Please see below for my solution.
..
.
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.
Well done :)
mod_cgi is part of the default Apache install, you don't really
un-install it. You can disable it and stop it from loaded, as you can
with any other modules. You disable modules by commenting out the line
in you configuration file that loads them. Look for directives like <If
?Module?> where ?Module? is the mod_cgi or any other module you want to
disable.
I'm sure your aware that your script will NOT run with mod_cgi disabled.
Dp.