RE: Unable to run cgi script

2002-11-12 Thread Kelvin McWha
Got it, after spending two days on just this problem I have found the
answer with the help of David T_G and David Kirol and others, many
thanks.

And the answer was

Setting ScriptAlias /cgi-bin   /home/kelvin/cgi-bin/

Means that I still need http://localhost/

But I don't now need /home/Kelvin

So the final path is http://localhost/cgi-bin/myscript.cgi

Simple eh!

thanks again

Kelvin

Ps just spotted that Scott suggested this within one of his answers
yesterday

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:Linux@;onion.perl.org] On Behalf Of
> zentara
> Sent: 12 November 2002 14:15
> To: [EMAIL PROTECTED]
> Subject: Re: Unable to run cgi script
> 
> On Mon, 11 Nov 2002 12:27:25 -, [EMAIL PROTECTED]
(Kelvin
> McWha) wrote:
> 
> >System is
> >SuSe 8.1 stand-a-lone
> >Apache 1.3
> >
> >Have got Apache running OK and tested it in standalone mode using
> >http://localhost
> >which shows the appropriate test page
> 
> Can you get http://localhost/~kevin to run?
> 
> In SuSE 8.1 you need to enabled user home dirs.
> 
> Look at /etc/sysconfig/apache  and see if you have home directories
> enabled.
> 
> 
> 
> 
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Unable to run cgi script

2002-11-12 Thread zentara
On Mon, 11 Nov 2002 12:27:25 -, [EMAIL PROTECTED] (Kelvin
McWha) wrote:

>System is
>SuSe 8.1 stand-a-lone
>Apache 1.3
>
>Have got Apache running OK and tested it in standalone mode using
>http://localhost
>which shows the appropriate test page

Can you get http://localhost/~kevin to run?

In SuSE 8.1 you need to enabled user home dirs.

Look at /etc/sysconfig/apache  and see if you have home directories
enabled.




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Unable to run cgi script

2002-11-11 Thread Kelvin McWha
David

Still no joy, the script now just hangs as if searching for about 10
secs

I have tried the following shell script which gives for the most part no
result. I wander whether this has any bearing or points anyone in the
right direction

#!/bin/sh
# disable filename globbing
set -f
echo Content-type: text/plain
echo
echo CGI/1.0 test script report:
echo
echo argc is $#. argv is "$*".
echo
echo SERVER_SOFTWARE = $SERVER_SOFTWARE
echo SERVER_NAME = $SERVER_NAME
echo GATEWAY_INTERFACE = $GATEWAY_INTERFACE
echo SERVER_PROTOCOL = $SERVER_PROTOCOL
echo SERVER_PORT = $SERVER_PORT
echo REQUEST_METHOD = $REQUEST_METHOD
echo HTTP_ACCEPT = "$HTTP_ACCEPT"
echo PATH_INFO = "$PATH_INFO"
echo PATH_TRANSLATED = "$PATH_TRANSLATED"
echo SCRIPT_NAME = "$SCRIPT_NAME"
echo QUERY_STRING = "$QUERY_STRING"
echo REMOTE_HOST = $REMOTE_HOST
echo REMOTE_ADDR = $REMOTE_ADDR
echo REMOTE_USER = $REMOTE_USER
echo AUTH_TYPE = $AUTH_TYPE
echo CONTENT_TYPE = $CONTENT_TYPE
echo CONTENT_LENGTH = $CONTENT_LENGTH
echo "Perl="`which perl`


-results in


Content-type: text/plain

CGI/1.0 test script report:

argc is 0. argv is .

SERVER_SOFTWARE =
SERVER_NAME =
GATEWAY_INTERFACE =
SERVER_PROTOCOL =
SERVER_PORT =
REQUEST_METHOD =
HTTP_ACCEPT =
PATH_INFO =
PATH_TRANSLATED =
SCRIPT_NAME =
QUERY_STRING =
REMOTE_HOST =
REMOTE_ADDR =
REMOTE_USER =
AUTH_TYPE =
CONTENT_TYPE =
CONTENT_LENGTH =
Perl=/usr/bin/perl

> -Original Message-
> From: David Kirol [mailto:d.kirol@;attbi.com]
> Sent: 11 November 2002 20:32
> To: Kelvin McWha
> Subject: RE: Unable to run cgi script
> 
> Kevin,
>   the below is from your attachment - 2 modifications indicated by
> +
> # my changes
> #
> ScriptAlias /cgi-bin/  /home/kelvin/cgi-bin/
> #
> #
> 
> #   ++you are closing
this
> below, remove it here
> #
> # "/srv/www/cgi-bin" should be changed to whatever your
ScriptAliased
> # CGI directory exists, if you have that configured.
> #
> 
> AllowOverride None
> Options ExecCGI
>  ADD THIS HERE
> Order allow,deny
> Allow from all
> 
> 
> 
> 
> 
> Let me know how you make out. Are you doing much with PHP?
> David




--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Unable to run cgi script

2002-11-11 Thread Kelvin McWha
So I have tried the method below ie



and the server was unable to find the file? 
I have tried commenting out the other alias which was pointing somewhere
else for the cgi-bin
I have removed the file associations with each pl/cgi file this then
brings up the open with dialog box

So my guess is somehow Apache isn't opening the cgi files. Apache is
running I proved it with the localhost page

And another thing running the script by the command line just produces
the script, by that I mean, where I would have thought it would have run
the html bit it doesn't. It prints all the tags as well. Or am I
misunderstanding what should happen?

Any other suggestions please

Kelvin

> -Original Message-
> From: Scot Robnett [mailto:scot@;insiteful.tv]
> Sent: 11 November 2002 14:44
> To: David T-G; perl beginners cgi
> Cc: Kelvin McWha
> Subject: RE: Unable to run cgi script
> 
> I don't think that's it; with the ScriptAlias set it should call the
> script
> through a relative or full path as easily as it does via that full
HTTP
> call. I'm curious what the document root is...if it is /home/kelvin,
then
> technically you *should* just be able to write it as  action="/cgi-bin/myscript.cgi">. Or, if you want to try the HTTP call,
>  action="http://localhost/cgi-bin/myscript.cgi";>.
> 
> It sounds to me like .cgi or .pl may already have file associations
with
> an
> external application (since the scripts are opening in your editor),
and
> for
> some reason those are overriding your AddHandler directive in Apache.
Did
> you try troubleshooting it by using an either/or approach? By this I
mean
> simply adding a handler for either .cgi or .pl but not both, and
trying it
> that way.
> 
> What are the results you get when you run the script via the command
line
> or
> run a perl -c on it?
> 
> Another quick question: I noticed that you called the configuration
file
> httpd.config. Since its actual name is httpd.conf, I wonder if it's as
> simple as renaming your configuration file? If you already have it
named
> httpd.conf, then never mind this question. :)
> 
> -
> Scot Robnett
> inSite Internet Solutions
> Square West Center
> 454 West Jackson Street
> Woodstock, IL 60098
> (815)206-2907 office
> (815)342-6480 mobile
> [EMAIL PROTECTED]
> http://www.insiteful.tv
> 
> 
> -Original Message-
> From: David T-G [mailto:davidtg-perl-beginners@;justpickone.org]
> Sent: Monday, November 11, 2002 7:58 AM
> To: perl beginners cgi
> Cc: Kelvin McWha
> Subject: Re: Unable to run cgi script
> 
> 
> Kelvin --
> 
> and then Kelvin McWha said...
> %
> 
> % 
> 
> I *think* you have to qualify this, as
> 
>   action="http://localhost/home/kelvin/cgi-bin/myscript.cgi";>
> 
> Certainly worth a try...
> 
> 
> HTH & HAND
> 
> :-D
> --
> David T-G  * There is too much animal courage in
> (play) [EMAIL PROTECTED] * society and not sufficient moral
courage.
> (work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and
> Health"
> http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl
> Npg!
> 
> 
> 
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Unable to run cgi script

2002-11-11 Thread Scot Robnett
I don't think that's it; with the ScriptAlias set it should call the script
through a relative or full path as easily as it does via that full HTTP
call. I'm curious what the document root is...if it is /home/kelvin, then
technically you *should* just be able to write it as . Or, if you want to try the HTTP call, http://localhost/cgi-bin/myscript.cgi";>.

It sounds to me like .cgi or .pl may already have file associations with an
external application (since the scripts are opening in your editor), and for
some reason those are overriding your AddHandler directive in Apache. Did
you try troubleshooting it by using an either/or approach? By this I mean
simply adding a handler for either .cgi or .pl but not both, and trying it
that way.

What are the results you get when you run the script via the command line or
run a perl -c on it?

Another quick question: I noticed that you called the configuration file
httpd.config. Since its actual name is httpd.conf, I wonder if it's as
simple as renaming your configuration file? If you already have it named
httpd.conf, then never mind this question. :)

-
Scot Robnett
inSite Internet Solutions
Square West Center
454 West Jackson Street
Woodstock, IL 60098
(815)206-2907 office
(815)342-6480 mobile
[EMAIL PROTECTED]
http://www.insiteful.tv


-Original Message-
From: David T-G [mailto:davidtg-perl-beginners@;justpickone.org]
Sent: Monday, November 11, 2002 7:58 AM
To: perl beginners cgi
Cc: Kelvin McWha
Subject: Re: Unable to run cgi script


Kelvin --

and then Kelvin McWha said...
%

% 

I *think* you have to qualify this, as

  action="http://localhost/home/kelvin/cgi-bin/myscript.cgi";>

Certainly worth a try...


HTH & HAND

:-D
--
David T-G  * There is too much animal courage in
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Unable to run cgi script

2002-11-11 Thread Kelvin McWha
Thanks David that seems to have taken me a step further. Running the
html script now comes up with the error Not Found
The requested URL /home/Kelvin/cgi-bin/myscript.cgi was not found on
this server

The browser is pointing to
http://localhost/home/kelvin/cgi-bin/myscript.cgi
I have tried it with several other scripts each time with the same
result

What next please?

Kelvin

> -Original Message-
> From: David T-G [mailto:davidtg-perl-beginners@;justpickone.org]
> Sent: 11 November 2002 13:58
> To: perl beginners cgi
> Cc: Kelvin McWha
> Subject: Re: Unable to run cgi script
> 
> Kelvin --
> 
> ...and then Kelvin McWha said...
> %
> ...
> % 
> 
> I *think* you have to qualify this, as
> 
>   action="http://localhost/home/kelvin/cgi-bin/myscript.cgi";>
> 
> Certainly worth a try...
> 
> 
> HTH & HAND
> 
> :-D
> --
> David T-G  * There is too much animal courage in
> (play) [EMAIL PROTECTED] * society and not sufficient moral
courage.
> (work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and
> Health"
> http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl
> Npg!




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Unable to run cgi script

2002-11-11 Thread David T-G
Kelvin --

...and then Kelvin McWha said...
% 
...
% 

I *think* you have to qualify this, as

  action="http://localhost/home/kelvin/cgi-bin/myscript.cgi";>

Certainly worth a try...


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg06869/pgp0.pgp
Description: PGP signature


RE: Unable to run cgi script

2002-11-11 Thread Kelvin McWha
mmm. to be honest Robert I picked this script up on the web and I have
used it as an example to show that my system will not run cgi scripts,
it also does not show any errors but opens them for editing instead. I
don't think I'm anywhere near looking at cgi.pm yet I am simply trying
to teach myself the basics so I need to get up and running first.

Thanks

Kelvin

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:ROBERT_MCCAMMON@;denso-
> diam.com]
> Sent: 11 November 2002 13:31
> To: Kelvin McWha
> Subject: Re: Unable to run cgi script
> 
> 
> 
> If I may ask, why are you using  when using CGI.  On the CGI.PM
> help page
> it shows the the use of param().  This is much simpler to receive your
> enviromental variables.
> 
> This will be done completely inside the script.  It save considerable
> typing.
> Below shows the header.
> 
> #!/usr/bin/perl
> use CGI qv(standard);
> use strict;
> 
> 
> 
> I am trying to set my system up as a Webserver
> for testing purposes
> System is
> SuSe 8.1 stand-a-lone
> Apache 1.3
> 
> Have got Apache running OK and tested it in standalone mode using
> http://localhost
> which shows the appropriate test page
> 
> I have configured httpd.config to point to my directories as follows
> ScriptAlias /cgi-bin/??home/kelvin/cgi-bin/
> 
>   Options +ExecCGI
>  AddHandler cgi-script cgi pl
>  
> 
> I am now trying to run simple html & perl scripts as shown below
> 
> My test page
> 
> 
> 
>  First Name  SIZE=15>
>  Last Name   SIZE=20>
>  E-Mail Addr SIZE=35>
>
>
> 
> 
> 
> #!/usr/bin/perl
> use CGI;
> read(STDIN,$temp,$ENV{'CONTENT_LENGTH'});
> @pairs=split(/&/,$temp);
> foreach $item(@pairs)
> {
> ($key,$content)=split(/=/,$item,2);
> $content=~tr/+/ /;
> $content=~s/%(..)/pack("c",hex($1))/ge;
> $fields{$key}=$content;
> }
> print "Content-type: text/html\n\n";
> print "\n";
> print "\n";
> print "\n";
> print "Thank You\n";
> print "$fields{fname} $fields{lname}";
> print "I will write\n";
> print "you at\n";
> print "$fields{email}\n";
> print "\n";
> print "";
> 
> What happens when I run the html code and click send, is that instead
of
> running the perl script it attempts to open it. I have tried a number
of
> scripts and they all do the same. I am sure it is something simple but
> it's got me beat.
> 
> Thanking you in anticipation
> Kelvin
> 




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Unable to run cgi script

2002-11-11 Thread Kelvin McWha
I am trying to set my system up as a Webserver
for testing purposes
System is
SuSe 8.1 stand-a-lone
Apache 1.3

Have got Apache running OK and tested it in standalone mode using
http://localhost
which shows the appropriate test page

I have configured httpd.config to point to my directories as follows
ScriptAlias /cgi-bin/  /home/kelvin/cgi-bin/

  Options +ExecCGI
 AddHandler cgi-script cgi pl 
 

I am now trying to run simple html & perl scripts as shown below

My test page



First Name  
Last Name   
E-Mail Addr 





#!/usr/bin/perl
use CGI;
read(STDIN,$temp,$ENV{'CONTENT_LENGTH'});
@pairs=split(/&/,$temp);
foreach $item(@pairs)
{
($key,$content)=split(/=/,$item,2);
$content=~tr/+/ /;
$content=~s/%(..)/pack("c",hex($1))/ge;
$fields{$key}=$content;
}
print "Content-type: text/html\n\n";
print "\n";
print "\n";
print "\n";
print "Thank You\n";
print "$fields{fname} $fields{lname}";
print "I will write\n";
print "you at\n";
print "$fields{email}\n";
print "\n";
print "";

What happens when I run the html code and click send, is that instead of
running the perl script it attempts to open it. I have tried a number of
scripts and they all do the same. I am sure it is something simple but
it's got me beat. 

Thanking you in anticipation
Kelvin



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]