View previous topic :: View next topic |
Author |
Message |
cstone Registered User
Joined: 19 Jul 2001 Location: N. Carolina Posts: 388
|
Posted: Wed Jan 30, 2002 5:20 pm Post subject: |
|
|
I know this isn't the best place to look for web server tips but I thought I'd try my luck here anyway.
Can anybody tell me what I need to do to get perl scripts running on an Apache web server??
Here's what I have now:
-Apache running a working webserver.
-ActivePerl is working from the command prompt
-A WinXP server
However when I try to run a Perl script from the server, it just shows me the script itself. Grrr. What do I need to configure??
Anybody?
_________________ ctnstone.com |
|
Back to top |
|
|
Robert E. Lee Registered User
Joined: 18 Jul 2001
Posts: 2904
|
Posted: Wed Jan 30, 2002 5:43 pm Post subject: |
|
|
In your http.conf file , around line 250 you should see this line..
### Section 2: 'Main' server configuration
add these 2 lines below it
AddHandler cgi-script .pl
AddHandler cgi-script .cgi
Remember to restart Apache or it won't work.
_________________
|
|
Back to top |
|
|
LanceMantis Registered User
Joined: 12 Aug 2001 Location: Nebraska Posts: 164
|
Posted: Wed Jan 30, 2002 5:50 pm Post subject: |
|
|
Ah yes, Perl, the language I've never bothered to learn. I'm not quite sure why though. Guess I'm not an internet coder.
_________________
http://lancemantis.tripod.com/resourcecenter/
[ This Message was edited by: LanceMantis on 2002-01-30 17:51 ] |
|
Back to top |
|
|
cstone Registered User
Joined: 19 Jul 2001 Location: N. Carolina Posts: 388
|
Posted: Wed Jan 30, 2002 6:14 pm Post subject: |
|
|
Whew, thanks Rob - well at least I'm getting different errors now. It seems I don't have permission to view the file now - I'm guessing it has something to do with access.conf? Chmod maybe (or maybe that's just for unix servers)
Thanks again,
-cstone
_________________ ctnstone.com |
|
Back to top |
|
|
cstone Registered User
Joined: 19 Jul 2001 Location: N. Carolina Posts: 388
|
Posted: Wed Jan 30, 2002 10:35 pm Post subject: |
|
|
Any more thoughts on this? |
|
Back to top |
|
|
OmegaSiN Registered User
Joined: 05 Nov 2001
Posts: 712
|
Posted: Wed Jan 30, 2002 11:32 pm Post subject: |
|
|
ummm...............sorry, don't ask me out computer stuff, i'm no good at it
_________________ [swf]width=300 height=40 background=#F0F0F0]http://www.theville.org/phpBB/uploads/omegaflash_r1.swf[/swf]
-Omega SiN |
|
Back to top |
|
|
Robert E. Lee Registered User
Joined: 18 Jul 2001
Posts: 2904
|
Posted: Wed Jan 30, 2002 11:33 pm Post subject: |
|
|
The access.conf is pretty much obsolete. CHMOD is for *nix servers only. What errors are you getting? Internal Server Errors?
_________________
|
|
Back to top |
|
|
cstone Registered User
Joined: 19 Jul 2001 Location: N. Carolina Posts: 388
|
Posted: Thu Jan 31, 2002 7:40 am Post subject: |
|
|
From the error log:
(2)No such file or directory: couldn't spawn child process: C:/apache/apache/htdocs/hlmaps/test.pl
The contents of test.pl is just
print "Hello World";
And I have that directory set to Options ExecCGI.
I'm pretty sure that I botched the perl installation by now. Do I need mod_perl or ActivePerl, or both? |
|
Back to top |
|
|
Robert E. Lee Registered User
Joined: 18 Jul 2001
Posts: 2904
|
Posted: Thu Jan 31, 2002 10:28 am Post subject: |
|
|
Did you try running it from your cgi-bin?
_________________
|
|
Back to top |
|
|
cstone Registered User
Joined: 19 Jul 2001 Location: N. Carolina Posts: 388
|
Posted: Thu Jan 31, 2002 5:30 pm Post subject: |
|
|
I will try the cgi-bin, but if that doesn't work I'm just gonna forget about it. It's installed on our regular webserver, but not our game server. Maybe I'll ask our network tech guy to get it set up.
I'm trying to install HLmaps btw, ever hear of it? Its supposed to give map statistics and some other cool stuff.
Thanks for all the help Rob,
-cstone |
|
Back to top |
|
|
Warhammer Server Admin
Joined: 12 Aug 2001 Location: Atlantuh, Jawjuh Posts: 1226
|
Posted: Thu Jan 31, 2002 5:41 pm Post subject: |
|
|
CGI scripts have to print out the HTTP headers before they can print the "real" output otherwise you will get a 500 server error. The bare minimum you want to set in your http headers is something like this:
print "Content-type: text/htmlnn"
You can also use text/plain if it's not HTML code. You can set cookies, content expiration times, and all kinds of stuff in the headers.
Now I'm not sure how you get Windows to treat the file as an executable. Perhaps you need to associate .pl files with the perl interpreter? Then it should open by "executing" the file, which is what the web server will do. |
|
Back to top |
|
|
Warhammer Server Admin
Joined: 12 Aug 2001 Location: Atlantuh, Jawjuh Posts: 1226
|
Posted: Thu Jan 31, 2002 5:45 pm Post subject: |
|
|
On another note, you should not need mod_perl. Last I knew, that's a way of putting perl code into an HTML document so that the web server parses the perl code on the fly and creates the dynamic output. However I couldn't find documentation on it at the apache site, so I may be confusing it with ePerl or something else. |
|
Back to top |
|
|
|