Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Webserver perl script woes.
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Zarathustra[H]
Guru
Guru


Joined: 30 Dec 2002
Posts: 389
Location: Cambridge, MA, USA

PostPosted: Fri Jun 06, 2003 12:23 am    Post subject: Webserver perl script woes. Reply with quote

Hey..

I'm trying to have a perl script executed on load from my web server running apache, but for some reason all it does is display the script in text mode in the browser instead of executing it.

Anyone know what I need to do to have it executed?

I can make it execute bby renaming the file .pl or .cgi, but for the purposes I am coding it, the file can't have either of these names. Any suggestions?


Thanks,
Matt
_________________
----
Athlon 64 3000+ / 1Gb Kingston Hyperx PC3500 / MSI K8N Neo / Geforce 6800GT
----
Back to top
View user's profile Send private message
kashani
Advocate
Advocate


Joined: 02 Sep 2002
Posts: 2032
Location: San Francisco

PostPosted: Fri Jun 06, 2003 4:17 am    Post subject: perl execution Reply with quote

try ruinning the script out of /home/httpd/cgi-bin/

IIRC the Gentoo apache config by default doesn't allow execution out of the htdocs dir.

kashani
_________________
Will personally fix your server in exchange for motorcycle related shop tools in good shape.
Back to top
View user's profile Send private message
slartibartfasz
Veteran
Veteran


Joined: 29 Oct 2002
Posts: 1462
Location: Vienna, Austria

PostPosted: Fri Jun 06, 2003 5:18 am    Post subject: Reply with quote

run the script from the cgi-bin directory if possible, try to give it a .pl extension and double check your settings for cgi in commonapache.conf as well as file permissions (755). make sure that the mime type is correctly configured...
_________________
To an engineer the glass is neither half full, nor half empty - it is just twice as big as it needs to be.
Back to top
View user's profile Send private message
xedx
Tux's lil' helper
Tux's lil' helper


Joined: 23 May 2003
Posts: 93

PostPosted: Fri Jun 06, 2003 5:52 am    Post subject: Re: Webserver perl script woes. Reply with quote

Zarathustra[H] wrote:

I can make it execute bby renaming the file .pl or .cgi, but for the purposes I am coding it, the file can't have either of these names. Any suggestions?


Seems like a cgi-handler prob

"Files having the name extension will be served by the specified handler-name. This mapping is added to any already in force, overriding any mappings that already exist for the same extension. For example, to activate CGI scripts with the file extension .cgi, you might use:

Code:
AddHandler cgi-script .cgi


Once that has been put into your httpd.conf file, any file containing the .cgi extension will be treated as a CGI program.

The extension argument is case-insensitive, and can be specified with or without a leading dot."


:)
_________________
--+//+
Back to top
View user's profile Send private message
uzik
Apprentice
Apprentice


Joined: 17 Apr 2003
Posts: 257

PostPosted: Fri Jun 06, 2003 9:58 pm    Post subject: Reply with quote

You will probably have to name it ".cgi" and put it in the cgi-bin
directory if you don't reconfigure apache.
If you put the first line of the script as:
#!/usr/bin/perl
It should still execute as a perl program.

DOUBLE CHECK YOUR PERL PROGRAM as you are probably making
your system VERY CRACKABLE by doing this.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot 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