Configure apache to run with perl ... while running from browser it asks to save .pl


 
Thread Tools Search this Thread
Operating Systems Linux Configure apache to run with perl ... while running from browser it asks to save .pl
# 1  
Old 09-04-2008
Configure apache to run with perl ... while running from browser it asks to save .pl

I have installed fedora 9 and trying to run .pl (perl files) from browser.

I have below RPM installed:
----------------------------------
httpd-2.2.8-3.i386
mod_perl-2.0.3-21.i386

$cat /etc/httpd/conf.d/perl.conf
LoadModule perl_module modules/mod_perl.so

Alias /perl /var/www/perl
<Directory /var/www/perl>
SetHandler perl-script
PerlResponseHandler ModPerl::Registry
PerlOptions +ParseHeaders
Options +ExecCGI
</Directory>


<Location /perl-status>
SetHandler perl-script
PerlResponseHandler Apache2::Status
Order deny,allow
#Deny from all
Allow from all
</Location>

in my /etc/httpd/conf/httpd.conf i have below line
Include conf.d/*.conf

Now i have put a test.pl perl file in /var/www/perl

[root@linux perl]# more test.pl
#!/usr/bin/perl
Content-type: text/html; (tried with and without)
print 'Hello world.';
[root@linux perl]#


In my browser i user http://hostname/test.pl

It asks me to save rather than show the out put ... please advise
# 2  
Old 09-09-2008
# 3  
Old 09-09-2008
i think the solution lies in the line starting with addhandler in the following

<Location /perl>
allow from all
SetHandler perl-script
AddHandler cgi-script .cgi .pl
#PerlHandler Apache::Registry
#PerlHandler Apache::PerlRun
PerlResponseHandler ModPerl::PerlRun
Options +ExecCGI
PerlSendHeader On
</Location>

tryout and post the results ...

-Regards
AJ
# 4  
Old 09-09-2008
You need essentially "AddHandler cgi-script .cgi .pl", as mentioned in the above post, it means - execute what's inside the script, and whatever the script / file holds, instead of falling into "octet-stream" mode, and suggest download or display.
# 5  
Old 09-13-2008
Thanks to all , Mod_perl rocks !
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. SCO

How to Launch Apache Web Browser?

This should be trivial, but it's not. I have Apache installed and running on my SCO UNIX OpenServer 5.0.7 system; Apache says its enabled and started. But I cannot for the life of me figure out how to launch it from a command line or from X-Windows! Maybe JTG or someone else knows the answer.... (2 Replies)
Discussion started by: Transpower
2 Replies

2. AIX

Can I run this thing in a web browser?

Old AS/400 guy here now administering an AIX system. We have an application that runs on 3151 emulator. Is it possible via an program or other to run a 3151 session in a web browser? I would like to have some of my user be able to work from home without having to install an emulation program, and... (1 Reply)
Discussion started by: jeveretts
1 Replies

3. IP Networking

configure apache to work with ssl

Hi, I need help to configure the apache to work with ssl. I have managed to create self-signed certificate according to the instruction in the following link. So I have the crt file and the key file. however when I add: <Virtualhost *:443> SSLEngine on ... (1 Reply)
Discussion started by: programAngel
1 Replies

4. UNIX for Dummies Questions & Answers

Running Putty from Browser

Hey All, My first posting around here, So please be patient with me. I dont have any rights on a computer that Im using right now & I was wondering if I can run putty session from the browser itself without downloading it. I looked up all over the web & I couldnt really see a place... (1 Reply)
Discussion started by: Fanxinu
1 Replies

5. Shell Programming and Scripting

Save cURL verbose output to file or do it like browser "save as.."

hi there ! i have exactly the same problem like this guy here https://www.unix.com/shell-programming-scripting/127668-getting-curl-output-verbose-file.html i am not able to save the curl verbose output.. the sollution in this thread (redirecting stderr to a file) does not work for me.... (0 Replies)
Discussion started by: crabmeat
0 Replies

6. Solaris

Apache 2 configure not recognizing options

Hello all. I am trying to compile Apache 2 (again!) and the configure script keeps telling me it does not recognize the options. Everything I am including is in the --help list. For example: --enable-so. First I will put in the LD flags, then configure with the --enable-so option. ... (2 Replies)
Discussion started by: RobertSubnet
2 Replies

7. UNIX for Dummies Questions & Answers

run shell script from browser

my shell script is to reset user menu: #!/bin/ksh echo "Type in login id: \c" read username if then echo "....." echo "You have not entered any INPUT value." echo "...Goodbye..." sleep 10 exit else echo $username rm -f... (3 Replies)
Discussion started by: tjmannonline
3 Replies

8. Linux

Configure apache prefork MPM

Hello, i want to know the basics to configure prefork.c module to high Apache performance and i think it's depends on the server hardware details (RAM and Processors) Thanks :) (0 Replies)
Discussion started by: LinuxCommandos
0 Replies

9. UNIX for Advanced & Expert Users

configure php with postgresql and apache

Hi, I'm trying to configure php4 to run alongside postgresql and apache. Postgres and apache are already installed and running, but I am getting an error when doing: host84:~/php-4.4.9#./configure --with-apache=/usr/local/apache --with-postgresql=/usr/local/pgsql loading cache ./config.cache... (5 Replies)
Discussion started by: sdbeng
5 Replies

10. Cybersecurity

Run browser over VPN

Dear All , I have a web Application which I used in my work it's installed on an AIX machine . I need to access this application from my home when I connect to my work via VPN , but the browser not work at all . I did a work around by installing mozilla broswer on the AIX machine and make... (2 Replies)
Discussion started by: habuzahra
2 Replies
Login or Register to Ask a Question