Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What to check for in Apache2, Perl, and FF/IE

Status
Not open for further replies.

CamaroLT

Programmer
Dec 16, 2002
159
CA
I've got KUbuntu running with a fresh install of Apache and Perl. Right now, I'm at the HELLO WORLD stage of getting a script to work through FF and IE.

I have the following in my code:

Code:
#!/usr/bin/perl

print "Content-type: text/html\n\n"; 

print "Hello, PERL!";

No matter what browser I use (FF on XP as well as in KDE) and IE6 (On XP) each browser wants to download the perl script.

For S'n'G, I decided to look at the content of what was downloaded. I noted that on the XP box, it was the same code I had just saved it as. I'm saving the file as a linux based file (Not DOS format).

What do I need to check and verify to get Apache to execute the script, instead of forcing the download?

Just to add, I've checked the permissions on the file within a console, and things still don't work even as 0777 or 0755.

Code:
-rwxrwxrwx 1 smbguest nogroup   96 2007-05-16 20:04 hello.pl

I went online and checked other HELLO WORLD kinds of perl scripts, and none of them want to work. I'm at a loss.

Suggestions?

-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=
NEVER send the boss to do a techs job
 
I also just tried going to the console and running perl.pl and this is what I got:

Code:
root@ubuntu:/var/www# perl hello.pl
Content-type: text/html

<html><h1>Hello!</h1></html>
root@ubuntu:/var/www#

So I know perl is running, I know apache is running since its downloading
Only thing I can think of is that theres something in apache2 config files thats missing. :/

-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=
NEVER send the boss to do a techs job
 
did you put it in cgi-bin?? Usually only perl and such is allowed there and not in your root folder.
 
ask in the apache forum how to setup the server to run scripts.

------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
travs69: perl doesn't exist in /var/www. Its found in the path.

Kevin: Per your request, fired a ? in an apache forum.

-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=
NEVER send the boss to do a techs job
 
I might have confused you.. you have specific folders in apache for specific things. cgi-bin the default folder for all your scripts and stuff. So any perl script should be in the cgi-bin folder and apache should be setup to run it and not print it to the screen.
 
Well, I copied the pl files into the cgi-bin file, and theres only one index.pl that exists anywhere on the file system. FF in KDE still wants to download it as a file, not execute.

So, its a configuration issue with Apache.

-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=
NEVER send the boss to do a techs job
 
Code:
Apache/2.0.55 (Ubuntu) PHP/4.4.2-1.1 mod_perl/2.0.2 Perl/v5.8.8 Server at ubuntu Port 80

Now I am *VERY* confused...

Perl is there, and its running, attached, present, whatever... But I'm still being asked to download the file instead of it being parsed.

-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=
NEVER send the boss to do a techs job
 
You need to setup that directory to have apache execute the perl script and not display it. This is 100% a apache problem. Post over there... them guys will help you out. It's a simple configuration change.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top