Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: Getting Started |
|
Author |
|
canrgs
Joined: 05 Dec 2007 Posts: 3 Location: Canada
|
Posted: Wed 05 Dec '07 6:15 Post subject: Getting Started |
|
|
Hi All,
I'm a old newbie to Apache (I used Apache for many years on W98 but have never set it up successfully on XP).
I just downloaded and installed a fresh copy of Apache_2.2.6-win32wx86-openssl-0.9.8e.msi
I started Apache
I use Firefox, went to File, Open File, pointed to printenv.pl in the Apache2.2/cgi-bin directory and
all it did was print the contents of the printenv.pl file on the screen - it did not display my ENV elements as expected.
When I run the printenv.pl script from a DOS window, it runs fine????
Any ideas would be appreciated as I expected this would run straight off the download? |
|
Back to top |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
Posted: Wed 05 Dec '07 7:35 Post subject: |
|
|
Well .. Firefox is going to do that if you just ask it to view the file on the hard drive. But enabling CGI in Apache, and sending firefox to http://localhost/cgi-bin/printenv.pl should work if you setup the ScriptInterpreterSource in Apache or add #!/path/to/perl.exe as the first line of that script (which is missing the #! shebang).
Apache runs the script and redirects the output to the browser. The bowser is not made run scripts. |
|
Back to top |
|
canrgs
Joined: 05 Dec 2007 Posts: 3 Location: Canada
|
Posted: Thu 06 Dec '07 3:40 Post subject: |
|
|
Thanks very much GL,
I addressed the file as you suggested in Firefox, as http://......., and it worked.
I also checked and I had put the shebang line in already.
When I tried this in IE7 I saw some strange results.
The first time, it prompted me to ask if I wanted to open the file - I clicked open and it ran the program in a doc window and then closed teh dos window immediately.
I then opened a new tab and addressed it using http://localhost/... and it worked fine
Any ideas?
tx,
again |
|
Back to top |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
Posted: Fri 07 Dec '07 2:10 Post subject: |
|
|
I am an IE refusenic BIG TIME, but if you're trying as you did first with FF, there is the same thing going on. Browsers do not run scripts, in your case perl does through Apache and Apache redirects the output to the browser. |
|
Back to top |
|
canrgs
Joined: 05 Dec 2007 Posts: 3 Location: Canada
|
Posted: Fri 07 Dec '07 16:05 Post subject: Thanks |
|
|
I understand.
Thanks again for your help - much appreciated. |
|
Back to top |
|
|
|
|
|
|