LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-18-2010, 08:59 AM   #1
keenboy
Member
 
Registered: Jan 2008
Location: Cullompton
Distribution: Kubuntu
Posts: 36

Rep: Reputation: 15
Apache2 cgi-bin perl - My browser just wants to download the .pl files


Hello,

I'm just trying to configure my apache2 web server to execute perl scripts in a cgi-bin directory. After the configuration I tested a perl script via a browser and instead of running it the browser just wants to download it.

I have seen the this issue in a lot of forums but they all have no solution.

I am using Debian Lenny + Apache2 + PHP5 + Perl (apache modules)

Would somebody be so kind and point me in the right direction to get this fixed?

Thanks,
 
Old 05-18-2010, 09:16 AM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
make sure the cgi module is loaded, make sure ExecCGI is on for the Directory you want, make sure you've AddHandler'd .pl to cgi.
 
Old 05-18-2010, 09:38 AM   #3
keenboy
Member
 
Registered: Jan 2008
Location: Cullompton
Distribution: Kubuntu
Posts: 36

Original Poster
Rep: Reputation: 15
Does the AddHandler information need to go in /etc/apache2/apache2.conf?

I have this information in /etc/apache2/sites-available/mysite

cgi module is loaded.

my /etc/apache2/sites-available/mysite is as follows:

Code:
<VirtualHost *>
        ServerName site.mydomain.com/mysite
        ServerAdmin administrator@mysite.com
        DocumentRoot /sites/mysite/
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>

        <Directory /sites/mysite/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>

            ScriptAlias /cgi-bin/ /sites/cgi-bin/

        <Directory /sites/cgi-bin/>
                Options ExecCGI
                AddHandler cgi-script .cgi .pl
        </Directory>

        ErrorLog /sites/logs/mysite.error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog /sites/logs/mysite.access.log combined
        ServerSignature On
</VirtualHost>
Thanks for your help.
 
Old 05-18-2010, 04:43 PM   #4
hoppla
LQ Newbie
 
Registered: Feb 2009
Posts: 2

Rep: Reputation: 0
Hi,
do you have tried "SetHandler cgi-script" instead of "AddHandler ..."

http://httpd.apache.org/docs/2.1/howto/cgi.html
 
Old 05-19-2010, 09:42 AM   #5
keenboy
Member
 
Registered: Jan 2008
Location: Cullompton
Distribution: Kubuntu
Posts: 36

Original Poster
Rep: Reputation: 15
I've just read the tutorial and configured apache in the same way but still having the same problem.

I remember having a similar issue on another system where php files weren't being displayed instead the browser was offering them as a download.

Do I not need to tell apache what to do with .pl files? If so where do I do this?

Thanks,
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache2, enabling user cgi-bin directories...? arfon Slackware 2 01-30-2009 07:58 AM
Apache2 cgi-bin Forbidden Access cluckshot Linux - Software 5 01-09-2009 12:26 PM
perl files download instead of parsed on apache2 mod-perl2 not parsing perl files zeigerpuppy Debian 1 02-16-2006 05:31 AM
Can not access cgi-bin from browser. Spreegem Linux - Software 6 11-07-2005 07:22 PM
Apache2 CGI-Perl will not read files fefeh Linux - Software 0 06-30-2003 08:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration