Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HELP: CGI problem in Apache 1.3.12 (Win 95)

Status
Not open for further replies.

Whatszzup

Programmer
Oct 8, 2000
3
US
I have successfully installed Apache 1.3.12 on Win 95
but am having problems executing CGI script.

Yes, I did read the Apache manual and FAQ but have not
been able to resolve the problem. Everytime my HTML file
calls the CGI script, I get a dialog box saying "You have
choosen to download the file from this location" and then goes on to ask meif i want to open it or save it. When I say open it, I get error saying that the file is not valid
WIN32 application.

I think server is not able to associate .cgi files as CGI
script. But I have done everything in the httpd.conf file
to make the association. But have not been successful.

Here are the details:

- Apache is installed at E:\Apache Group\Apache
When I go to http:\\localhost or http:\\127.0.0.1
I see the APache page that say "if you can see this,
it means that the installation of the Apache web server
software on this system was successful"

Also I can start the apache server using "apache -k start" from DOS.

- In httpd.conf file I have the following:

ScriptAlias /cgi-bin/ "E:/Apache Group/Apache/cgi-bin/"
AddHandler cgi-script cgi
<Directory &quot;E:/Apache Group/Apache/cgi-bin&quot;>
AllowOverride None
Options ExecCGI FollowSymLinks
</Directory>

DO I NEED TO CHANGE or ADD ANYTHING ELSE?

- I have perl installed in D:\Perl

- My HTML file that calls the CGI script is located in
E:/Apache Group/Apache/htdocs
I have enabled ExecCGI option in this directory too.

- My cgi script is located in E:/Apache Group/Apache/cgi-bin
here is how it looks

#!D:\Perl\bin\perl.exe
print <EOF:
Content-Type: text/html


<h1>My CGI Program in Perl!</h1>
EOF

- I am using IE5 browser

SO WHAT AM I DOING WRONG.
I have been strugling to make this work for last 3 days.

Any help would be greatly appreciated.

Thanks in advance
[sig][/sig]
 
Can you keep it all in the one dirrectory? perl is a bit funny.... I did the same as you, but put it all on c://program files/apache group/apache/cgi-bin
and perl is #!c:\\perl\bin\perl.exe , it worked fine........ I used Sams teach yourself CGI in 24hrs to show me how.

I think the problem may lie with the different drives
also see a few perl examples for how you call the script
try putting


Where example is the name of your cgi

if this fails

run it from the command line in perl

if this fails

re-install apache into the same drive
 
I moved the Apache to D drive (same drive as my Perl)
and it did the trick.

Thanks a million for your advice.
[sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top