 |
|
 |
|
Next: Prompt to download
|
| Author |
Message |
External

Since: Dec 16, 2003 Posts: 5
|
(Msg. 1) Posted: Tue Dec 16, 2003 4:32 am
Post subject: What about perl on linux apache? Archived from groups: alt>apache>configuration (more info?)
|
|
|
Hi.
I see that some Win2K folks (of which I'm one) are having a problem with
perl on apache. I am having a problem on RH Linux 9.0; I finally got
httpd configured, so I think, but my perl scripts display their code.
This has happened more than once to me, but I can't find the answer at
redhat.com or perl.com or elsewhere on the web. Any pointers, please?
Thanks,
-jc >> Stay informed about: What about perl on linux apache? |
|
| Back to top |
|
 |  |
External

Since: Jun 30, 2003 Posts: 154
|
(Msg. 2) Posted: Tue Dec 16, 2003 6:44 am
Post subject: Re: What about perl on linux apache? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
> I see that some Win2K folks (of which I'm one) are having a problem with
> perl on apache. I am having a problem on RH Linux 9.0; I finally got
> httpd configured, so I think, but my perl scripts display their code.
>
> This has happened more than once to me, but I can't find the answer at
> redhat.com or perl.com or elsewhere on the web. Any pointers, please?
put them in a directory with a ScriptAlias directive or use AddHandler
cgi-script .pl...
joachim<!-- ~MESSAGE_AFTER~ --> >> Stay informed about: What about perl on linux apache? |
|
| Back to top |
|
 |  |
External

Since: Dec 16, 2003 Posts: 5
|
(Msg. 3) Posted: Tue Dec 16, 2003 6:44 pm
Post subject: Re: What about perl on linux apache? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
> > but my perl scripts display their code.
> put them in a directory with a ScriptAlias directive or use AddHandler
> cgi-script .pl...
Thanks for the suggestions. I uncommented the first line and added the
second line, below, in /etc/httpd/conf, but things still don't work; my
script still gets printed, not executed. Execution is OK from command
line, though (perl -w test.cgi). I'm always sure to restart httpd.
AddHandler cgi-script .cgi
AddHandler cgi-script .pl
My test.cgi is pretty simple, but the code gets displayed in my browser:
--------
#!/usr/bin/perl
print "Content-type:text/html\n\n";
print "\nHello, World.\n\n";
exit;
--------
This is really irritating. In the Win2k world, I can run circles around
most folks, and I can even keep myself afloat in linux, but I can't make
apache work correctly. Maybe my next step should be to buy Apache For
Dummies.
-jc
>>I see that some Win2K folks (of which I'm one) are having a problem with
>>perl on apache. I am having a problem on RH Linux 9.0; I finally got
>>httpd configured, so I think, but my perl scripts display their code.
>>
>>This has happened more than once to me, but I can't find the answer at
>>redhat.com or perl.com or elsewhere on the web. Any pointers, please?
>
><!-- ~MESSAGE_AFTER~ --> >> Stay informed about: What about perl on linux apache? |
|
| Back to top |
|
 |  |
External

Since: Dec 16, 2003 Posts: 2
|
(Msg. 4) Posted: Tue Dec 16, 2003 10:40 pm
Post subject: Re: What about perl on linux apache? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Do ...
chmod +x yourcgi.pl
../yourcgi.pl
# that makes sure it works. Using "perl -w yourcgi.pl" will use the perl in
your path.
Then add
<Directory /location/to/cgi-bin>
Options +ExecCGI
</Directory>
Hopefully that works.
Regards
Matt
"JC" <gymus.RemoveThis@yahoo.com> wrote in message
news:GLFDb.1425$p8.1181@nwrdny03.gnilink.net...
> > > but my perl scripts display their code.
> > put them in a directory with a ScriptAlias directive or use AddHandler
> > cgi-script .pl...
>
> Thanks for the suggestions. I uncommented the first line and added the
> second line, below, in /etc/httpd/conf, but things still don't work; my
> script still gets printed, not executed. Execution is OK from command
> line, though (perl -w test.cgi). I'm always sure to restart httpd.
>
> AddHandler cgi-script .cgi
> AddHandler cgi-script .pl
>
>
> My test.cgi is pretty simple, but the code gets displayed in my browser:
> --------
> #!/usr/bin/perl
> print "Content-type:text/html\n\n";
> print "\nHello, World.\n\n";
> exit;
> --------
>
> This is really irritating. In the Win2k world, I can run circles around
> most folks, and I can even keep myself afloat in linux, but I can't make
> apache work correctly. Maybe my next step should be to buy Apache For
> Dummies.
>
> -jc
>
> >>I see that some Win2K folks (of which I'm one) are having a problem with
> >>perl on apache. I am having a problem on RH Linux 9.0; I finally got
> >>httpd configured, so I think, but my perl scripts display their code.
> >>
> >>This has happened more than once to me, but I can't find the answer at
> >>redhat.com or perl.com or elsewhere on the web. Any pointers, please?
> >
> >
><!-- ~MESSAGE_AFTER~ --> >> Stay informed about: What about perl on linux apache? |
|
| Back to top |
|
 |  |
External

Since: Dec 16, 2003 Posts: 5
|
(Msg. 5) Posted: Tue Dec 16, 2003 11:28 pm
Post subject: Re: What about perl on linux apache? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Hey, thanks for the suggestion. I wish it were that easy, though.
In httpd.conf there's already:
<Directory "/var/www/cgi-bin">
Options ExecCGI
AllowOverride None
Allow from from all
Order allow,deny
</Directory>
but I added:
<Directory "/var/www/cgi-bin/dt">
Options +ExecCGI
</Directory>
which is where my script is. That didn't work, and there was certainly
a problem when I added an Order allow,deny line. I think I've
configured well enough, such that /var/www/cgi-bin/dt is where I
actually point when Mozilla loads <a style='text-decoration: underline;' href="http://192.168.100.1/test.cgi" target="_blank">http://192.168.100.1/test.cgi</a>
The permissions have always included x:
-rwxr-xr-x 1 root root 116 Dec 16 14:48 test.cgi*
Now, although
perl -w test.cgi
works,
../test.cgi
doesn't work,
: bad interpreter: No such file or directory
but,
perl: /usr/bin/perl /usr/share/man/man1/perl.1.gz
and my first line is,
#!/usr/bin/perl
So, I sit here feeling like an idiot, which may not be far from the
truth, but I'd like it not to be that way.
Again, thanks.
-jc
Matt wrote:
> Do ...
>
> chmod +x yourcgi.pl
> ./yourcgi.pl
>
> # that makes sure it works. Using "perl -w yourcgi.pl" will use the perl in
> your path.
>
> Then add
>
> <Directory /location/to/cgi-bin>
> Options +ExecCGI
> </Directory>
>
> Hopefully that works.
>
> Regards
> Matt
>
> "JC" <gymus.DeleteThis@yahoo.com> wrote in message
> news:GLFDb.1425$p8.1181@nwrdny03.gnilink.net...
>
>>>>but my perl scripts display their code.
>>
>> > put them in a directory with a ScriptAlias directive or use AddHandler
>> > cgi-script .pl...
>>
>>Thanks for the suggestions. I uncommented the first line and added the
>>second line, below, in /etc/httpd/conf, but things still don't work; my
>>script still gets printed, not executed. Execution is OK from command
>>line, though (perl -w test.cgi). I'm always sure to restart httpd.
>>
>>AddHandler cgi-script .cgi
>>AddHandler cgi-script .pl
>>
>>
>>My test.cgi is pretty simple, but the code gets displayed in my browser:
>>--------
>>#!/usr/bin/perl
>>print "Content-type:text/html\n\n";
>>print "\nHello, World.\n\n";
>>exit;
>>--------<!-- ~MESSAGE_AFTER~ --> >> Stay informed about: What about perl on linux apache? |
|
| Back to top |
|
 |  |
External

Since: Dec 16, 2003 Posts: 2
|
(Msg. 6) Posted: Tue Dec 16, 2003 11:47 pm
Post subject: Re: What about perl on linux apache? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Make sure you perl file doesn't have any dos carriage returns in it. It got
me again earlier today, its the #! line thats important.
in vi do
:set ff=unix
:wq
or use dos2unix if you haveit.
Regards
Matt
"JC" <gymus DeleteThis @yahoo.com> wrote in message
news:2WJDb.342$LS.67@nwrdny01.gnilink.net...
> Hey, thanks for the suggestion. I wish it were that easy, though.
> In httpd.conf there's already:
> <Directory "/var/www/cgi-bin">
> Options ExecCGI
>
> AllowOverride None
> Allow from from all
> Order allow,deny
> </Directory>
>
>
> but I added:
> <Directory "/var/www/cgi-bin/dt">
> Options +ExecCGI
> </Directory>
>
>
> which is where my script is. That didn't work, and there was certainly
> a problem when I added an Order allow,deny line. I think I've
> configured well enough, such that /var/www/cgi-bin/dt is where I
<font color=purple> > actually point when Mozilla loads <a style='text-decoration: underline;' href="http://192.168.100.1/test.cgi</font" target="_blank">http://192.168.100.1/test.cgi</font</a>>
>
> The permissions have always included x:
> -rwxr-xr-x 1 root root 116 Dec 16 14:48 test.cgi*
>
> Now, although
> perl -w test.cgi
> works,
> ./test.cgi
> doesn't work,
> : bad interpreter: No such file or directory
> but,
> perl: /usr/bin/perl /usr/share/man/man1/perl.1.gz
> and my first line is,
> #!/usr/bin/perl
>
> So, I sit here feeling like an idiot, which may not be far from the
> truth, but I'd like it not to be that way.
>
> Again, thanks.
> -jc
>
> Matt wrote:
> > Do ...
> >
> > chmod +x yourcgi.pl
> > ./yourcgi.pl
> >
> > # that makes sure it works. Using "perl -w yourcgi.pl" will use the perl
in
> > your path.
> >
> > Then add
> >
> > <Directory /location/to/cgi-bin>
> > Options +ExecCGI
> > </Directory>
> >
> > Hopefully that works.
> >
> > Regards
> > Matt
> >
> > "JC" <gymus DeleteThis @yahoo.com> wrote in message
> > news:GLFDb.1425$p8.1181@nwrdny03.gnilink.net...
> >
> >>>>but my perl scripts display their code.
> >>
> >> > put them in a directory with a ScriptAlias directive or use
AddHandler
> >> > cgi-script .pl...
> >>
> >>Thanks for the suggestions. I uncommented the first line and added the
> >>second line, below, in /etc/httpd/conf, but things still don't work; my
> >>script still gets printed, not executed. Execution is OK from command
> >>line, though (perl -w test.cgi). I'm always sure to restart httpd.
> >>
> >>AddHandler cgi-script .cgi
> >>AddHandler cgi-script .pl
> >>
> >>
> >>My test.cgi is pretty simple, but the code gets displayed in my browser:
> >>--------
> >>#!/usr/bin/perl
> >>print "Content-type:text/html\n\n";
> >>print "\nHello, World.\n\n";
> >>exit;
> >>--------
><!-- ~MESSAGE_AFTER~ --> >> Stay informed about: What about perl on linux apache? |
|
| Back to top |
|
 |  |
External

Since: Dec 16, 2003 Posts: 5
|
(Msg. 7) Posted: Wed Dec 17, 2003 12:28 am
Post subject: Re: What about perl on linux apache? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
|
|
| Back to top |
|
 |  |
External

Since: Dec 16, 2003 Posts: 5
|
(Msg. 8) Posted: Wed Dec 17, 2003 1:02 am
Post subject: Re: What about perl on linux apache? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Hey.
I finally tried a ScriptAlias--Joachim suggested it, but I tried only
his suggestion of an AddHandler directive--and that made my test.cgi work:
ScriptAlias / "/var/www/cgi-bin/dt/"
Now I need to find a similar solution for my other scripts. Sorry for
jerking you guys around, but thanks for the pointers.
-jc >> Stay informed about: What about perl on linux apache? |
|
| Back to top |
|
 |  |
| Related Topics: | autostart apache in linux - hello! i`ve installed apache2 on my suse linux 8.2 box and it works correctly the only problem is that i`ve to start it from the command line because i don`t know how to add it into the boot progress so it starts while booting the system up maybe..
Apache with RedHat Linux 9 - I see in the Server Settings a place to administer SSL / encryption. However, I am failing to understand how to make it work. Could you point me to a step-by-step on how to use the settings in the GUI Server settings of RH9 for Apache? I can get Apache t...
apache installation on linux - Hi All, I'm new to Apache. I've been trying to find instructions for installing Apache on my Red Hat Linux box. However, I haven't had any luck at all. I've navigated over to www.apache.org, but no luck there either. Plus, I don't know what version of..
rewritelog empty (Apache/1.3.29 @ linux 2.4.24) - Hello. I'm running numerious apache's of different versions and platforms, and this is first time I meet such a strange problem: rewrite log seems to be empty all the time (though mod_rewrite is being used widely). What I used: RewriteLog..
Apache on Linux and Tomcat in Windows - Hello, my problem is to configure a apache webserver so, that it is using a tomcat servlet engine, that runs on an other machine wihich has windows as its os. Apache by itself runs under linux. Can anyone please help me. I am an newbie in this sector bu... |
|
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|
 |
|
|