Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

ActivePerl / Apache / WinMe config problem

by Anonymous Monk
on Feb 25, 2002 at 00:39 UTC ( [id://147237]=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

OK, newbie problem, and it's prolly something simple I've overlooked, but I can't seem to get cgi scripts to execute from the browser -- it always tries to download them. (ActivePerl 5.6.1.631, Apache 1.3.22, WinMe)

command line works fine; the script alias to cgi-bin is working since it finds the file to download it; if I deliberately muddle the shebang line I get a 500 error, so it seems apache is _trying_ to execute the script, and something is going wrong when it actually calls perl.exe.

I have tried it both with and without AddType and AddHandler (though I think I shouldn't need them since I'm working in the script-aliased cgi-bin?); I have tried using other directories (with AddType, AddHandler, and Options ExecCGI); I have tried the reg edit from this answer in the q&a section (which I think is really just for the MS-PWS, not apache?), all to no avail.

Any help will be most appreciated, I'm at wits end!
  • Comment on ActivePerl / Apache / WinMe config problem

Replies are listed 'Best First'.
Re: ActivePerl / Apache / WinMe config problem
by emcb (Beadle) on Feb 25, 2002 at 01:45 UTC

    Hi,

    are you sending your headers. Before any program output there must be a content-type HTTP header like this:

    print "Content-Type: text/html\n\n";
    Also what extension are you using .cgi, .pl.

      Yes, I am sending the headers. I've tried using both .cgi & .pl with the same results.

        Run through this to see you have everything set properly:

        Your PATH contains the location to your perl/bin directory (most commonly installed to C:\perl\bin.

        Your ScriptAlias looks something like : ScriptAlias /cgi-bin/ "C:/Path/To/Apache/cgi-bin/"

        also could you post the contents of your script so i monks can take a look. There might be a code error.

Re: ActivePerl / Apache / WinMe config problem
by Dog and Pony (Priest) on Feb 25, 2002 at 13:04 UTC
    If it tries to download your files, your ScriptAlias directive is most probably not working. It *should* give 500 errors or succeed in that case. And no, you don't need both AddHandler and ScriptAlias at the same time. :)

    One thing that is different from usual when you are doing CGI in the environment you describe is that the shebang line must be correct (this is not necessary otherwise under activestate). So make sure it is #!/perl/bin/perl -w or wherever you have installed it (I have /usr/bin/perl just like the real people). Also, if for some reason the apache is running on another drive, you need to set it with drive letter as well: #!c:/perl/bin/perl -w.

    Also, you will want to examine your log files, access and especially error logs can be very helpful sometimes when trying to track these problems down.

    One stupid question also, I am not trying to be condesending or anything, but you are restarting apache everytime you make a change, right? All in all, apache and activestate usually plays very well together on windows, although I have never run ME and never ever will.

    Feel free to come back with more info about your problem, especially error logs.


    You have moved into a dark place.
    It is pitch black. You are likely to be eaten by a grue.

      I'm sure the script alias is working; it tries to execute and does give the 500 error (can't spawn child process) when I muddle the shebang so that it _doesn't_ find perl, it only tries to download when it actually finds perl. Besides which, <a href=http://www.perlmonks.com/index.pl?lastnode_id=147237&node_id=147474">I discovered today that it works fine from a remote machine, just not locally:

      (and before anyone asks, yes I know WinMe is not secure enough to host a site, I just left it open long enough to test it)

      I had already checked the logs, no errors are recorded when it tries to download (with or without -w); the access log shows the GET...200 and looks otherwise like it was successful. And, yes, I was reloading apache when I made changes (no worries about being condecending, I remember well from a former tech support job having to ask if the machine was plugged in...)

      sigh...believe me I wish I was running this under unix/linux...unfortunately I'm doing this so I can work at home on a project for work, where they give me no choice of o/s...at least it will be NT there, hopefully that will be somewhat less problematic.

Re: ActivePerl / Apache / WinMe config problem
by Anonymous Monk on Feb 26, 2002 at 04:30 UTC

    UPDATE: I was able to try the page from work today, and everything worked fine! So, it seems the problem only exists on the local machine, and may have to do with either a needed registry addition or deletion, or an option to be set or unset in IE (as I was already suspecting from the tests I'd already tried)

    Any more thoughts?

      Heh, well, I solved the problem. Installed Netscape, no more problem. Figures...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://147237]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2024-04-16 08:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found