View previous topic :: View next topic |
Author |
Message |
Zarathustra[H] Guru


Joined: 30 Dec 2002 Posts: 389 Location: Cambridge, MA, USA
|
Posted: Fri Jun 06, 2003 12:23 am Post subject: Webserver perl script woes. |
|
|
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 |
|
 |
kashani Advocate


Joined: 02 Sep 2002 Posts: 2032 Location: San Francisco
|
Posted: Fri Jun 06, 2003 4:17 am Post subject: perl execution |
|
|
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 |
|
 |
slartibartfasz Veteran


Joined: 29 Oct 2002 Posts: 1462 Location: Vienna, Austria
|
Posted: Fri Jun 06, 2003 5:18 am Post subject: |
|
|
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 |
|
 |
xedx Tux's lil' helper


Joined: 23 May 2003 Posts: 93
|
Posted: Fri Jun 06, 2003 5:52 am Post subject: Re: Webserver perl script woes. |
|
|
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 |
|
 |
uzik Apprentice

Joined: 17 Apr 2003 Posts: 257
|
Posted: Fri Jun 06, 2003 9:58 pm Post subject: |
|
|
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 |
|
 |
|