Moving Delphi 6 CGI to IIS 6, second page not displaying

164 views Asked by At

I've been asked to move some legacy Delphi 6 webapps (CGI .exe) from a windows 2000 server to Windows 2003.

I've copied the app and setup the virtual directory as per original server and followed the instructions Microsoft IIS about setting up Web Service Extensions (in both places) and added the extra user rights but when I access the web site the first page is shown but when a button is clicked it keeps returning to the first page instead of the expected page.

The weird thing is that if I tell the new server that the webpages are on the old server the pages open fine, which suggests that it is not the web broker.

What am I missing?

Thanks in advance

2

There are 2 answers

0
Stijn Sanders On BEST ANSWER

The URL of the request, or at least the part after the virtual directory you configured, or the URL to the dll, is passed over CGI in a different way than with IIS. CGI puts all parameters and HTTP request values in environment variables of the CGI process it starts. IIS uses an Extension Control Block that provide access to these values.

If your IIS implementation is showing the same page with a different URL, my first idea would be to check if this URL is processed correctly.

For a bit of example code, have a look at how I did it here.

0
Tony On

Thanks Stijn for pointing me in a different direction. (would up vote but can't)

After much reading and testing (including http://www.drbob42.com/books/cgi.htm & http://delphi.about.com/library/bluc/text/uc060901f.htm)

What I've found is that on the IIS6 server the PathInfo property of the request contains the scriptname and page paramater where as on IIS5 the PathInfo property just contains the page paramater.

I'm assuming that because the the reason the web page is not working on the IIS6 server is because the CGI web broker is recieving the requests containing the scriptname because this request doesn't match any of the known pages, it is displaying the default page which is the home page.

All I've got to do now it to find out why IIS6 is doing this and work out a way to fix it.