Windows 2003 IIS 6 won't run my Win 2000 IIS 5 code!!


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 13 of 13

Thread: Windows 2003 IIS 6 won't run my Win 2000 IIS 5 code!!

Hybrid View

  1. #1
    Join Date
    Jun 2005
    Posts
    13

    Windows 2003 IIS 6 won't run my Win 2000 IIS 5 code!!

    I have some web pages that were hand coded in basic ASP and developed on a IIS 5 Server under Windows 2000. I need to migrate to a new server running Windows 2003 Server with IIS 6.

    Now, part of my code refuses to work. I have sat with the Network Admin + DB guy for a couple of hours trying to get this to resolved.
    Most of the code still works fine and talks to the SQL Server database and pulls table data, no problem. But if I try to download or upload anything (other than simple text from tables), I get a HTTP 500 - Internal server error
    Even with detailed error reporting turned on in IIS, that is all I see, so this complicates debugging the problem.
    When sitting with the Net Admin+DB guy, he loaded the code into Dreamweaver to debug and we saw a write to file failed error generate. So that is what the problem is. The code I use is standard code I see in all of the examples on doing this sort of thing, but it just refuses to work. We have given the IUSR and IWAN accounts full access to all folders that they might need to access, still to no avail. One guy I spoke with mentioned something about it being a COM read/create permission issue, but I do not know where I would grant that specific access if that is the case. All NTFS permissions I know of are set to grant access and all IIS settings on the new server are identical to those on the older (working) server.
    Basically, I am totally lost and my project is starting to fall behind because of this issue (the old server cannot transfer 50+ MB files due to RAM issues). I need to get his resolved as soon as possible. The only solution I have come up with so far is to tell the company to buy a new server and install Windows 2000 + IIS 5 on it to run my app. Obviously, I would rather just get this to work on the 2003 machines as it is bound to be a simple fix I am simply unaware of.
    Any ideas?

    Here is the code: (Code grabs the document from the DB -digitalLocation from the Location Table - based on the composite key of docid and versionNumber - both of which are supplied in the URL Address string)
    Example address string:
    http://xxx.xxx.xxx.xxx/xxxx/doc.asp?id=1&version=1

    <!-- #include File="connection.asp" -->
    <!-- METADATA TYPE="typelib" FILE="c:\program files\common files\system\ado\msado15.dll"-->

    <%
    Dim id
    id = Request.QueryString("id")
    version = Request.QueryString("version")
    Dim rs
    Set rs = CreateObject("ADODB.Recordset")
    rs.Open "SELECT * FROM Location WHERE docid = " & id & " AND versionNumber = " & version, cn
    If Not rs.EOF Then
    Dim stm
    Set stm = CreateObject("ADODB.Stream")
    stm.Type = adTypeBinary
    stm.Open
    stm.Write rs("digitalLocation")
    Dim filename
    filename = Server.MapPath("/images") & "\" & rs("docname")
    stm.SaveToFile filename, adSaveCreateOverWrite
    Response.Write "<script language=javascript>location.replace('/images/" & rs("docname") & "');</script>"
    End If
    set id = NOTHING
    set version = NOTHING
    set rs = NOTHING
    set stm = NOTHING
    set filename = NOTHING
    set cn = NOTHING
    %>

    BTW - this is all normal non-.NET ASP code. (I'm sure the new server can handle .NET stuff, but I don't know what the differences are with .NET as I have not played with .NET)
    Last edited by Razarr69; 06-24-2005 at 01:12 PM. Reason: left out the code in question

  2. #2
    Join Date
    Dec 2003
    Posts
    2,750
    Can I assume you're using Anonymous (no) authentication? Is the location where the files are being written the local web server or a remote resource?
    Paul
    ~~~~
    Microsoft MVP (Visual Basic)

  3. #3
    Join Date
    Jun 2005
    Posts
    13
    Indeed you may assume we are allowing anonymous access. The files that are / would be created would be created in a subfolder of the folder that houses the actual ASP pages. Works fine this way on the 2000 server.
    We even set the NTFS permissions on this folder to be accessable with full control to EVERYONE and even created a network share allowing EVERYONE full control. Still access denied.

    I also tested some other asp code that generates a text file through asp code. That bit of coding worked fine, but it does not pull from a DB and only created a simple text file.

  4. #4
    Join Date
    Dec 2003
    Posts
    2,750
    Did you turn off the friendly message in your browser for the error 500? That should provide you with the actual error (Tools...Internet Options...Advanced...Show Friendly HTTP error messages).
    Paul
    ~~~~
    Microsoft MVP (Visual Basic)

  5. #5
    Join Date
    May 2005
    Location
    UK
    Posts
    278
    Hi

    I am mentioning the below hoping this helps.. not that it will give a immediate solution

    With IIS 6.0 in Windows Server 2003, the process model changes dramatically. To begin with, the processModel element in machine.config is ignored because it is replaced with equivalent settings in the IIS metabase, which is now stored in XML format in the metabase.xml file. ASP.NET is no longer hosted in aspnet_wp.exe but in one or more instances of w3wp.exe. Even more significantly, you are no longer constrained to just one worker process per CPU on a particular machine. Instead, you can configure what are called application pools, which contain collections of virtual directories that all share the same worker process.
    The other significant change is that HTTP requests are now handled in kernel mode through the http.sys service. This service listens for HTTP requests and places them in the appropriate application queue. This means that inetinfo.exe is no longer the front end for HTTP requests, so the advantage of servicing requests in-process is gone.

    If you are moving an ASP.NET application to IIS 6.0, but you still want to use the process model and configuration settings of IIS 5.0, you can set a backward-compatibility flag in IIS 6.0 that causes it to run in IIS 5.0 isolation mode. This must be applied at the machine level, because it affects how all requests are processed on a given machine.

    On a long run you could consider using Cassini which is a provided by microsoft and is a webserver its full code is also available at www.asp.net, but that needs testing for sometime

    If you are wondering why I am saying all this, if you are moving a application from IIS 5.0 to IIS 6 and its a commericial application as a counter measure u can set IIS 6.0 to backward compatibility and use it, so that downtime is avoided, and the application is up, then test your old website, the change from IIS 5. 0 to 6.0 is quite huge for a ASp.Net application and migration should be done with a lot more care

    Thanks

  6. #6
    Join Date
    Jun 2005
    Posts
    13
    I removed the Flag for Show Friendly HTTP error messages and at least I am seeing the line number where the code is failing now
    error reads:
    "
    ADODB.Stream error '800a0bbc'

    Unknown runtime error

    /CLMS/doc.asp, line 19
    "


    In the code, this line is:

    stm.SaveToFile filename, adSaveCreateOverWrite

    So again, it is pointing to a write permission issue, unless, of course, the coding syntax has changed slightly on IIS 6.

    In regard to:
    "If you are moving an ASP.NET application to IIS 6.0, but you still want to use ..."

    This is a simple ASP application, not an ASP.NET one. I don't know how much of a difference there is from ASP to ASP.NET, but I will see the the admin for the IIS server can set the server to run in IIS 5 isolation mode. From reading MS article this topic, this sounds like the case.

    MS states:
    "If backward compatibility is an issue, use IIS 5.0 isolation mode. In IIS 5.0 isolation mode, however, IIS 6.0’s application pools, recycling, and health detection features are not available. Therefore, you’ll have to be much more stringent in testing for memory leaks and other problems that can consume server resources and cause processes to hang.
    IIS 5.0 isolation mode is required when using:
    • ISAPI filters that read raw data filters (i.e., registers SF_READ_RAW_DATA or SF_SEND_RAW_DATA)
    • Session state is persisted in a process (using ASP session state works fine in Worker Process mode and does not require IIS 5.0 isolation mode)
    • COM objects, or any application, that are not multi-instance aware.
    • Microsoft Exchange
    "

    My app reads raw data when creating the file from the binary data stored in the SQL Server. I assume this is what MS means when they talk about "raw data filters " We'll see. I'll update if this is the fix for the problem.

    Thanks for the suggestions. Now I get to go see if this works.

  7. #7
    Join Date
    Dec 2003
    Posts
    2,750
    There is a significant different between ASP and ASP.NET apps. Impersonation is enabled by default for ASP. Impersonation is not enabled by default for ASP.NET apps. The default account used (w/o impersonation) for ASP.NET is ASPNET under Win2K or NetworkService under Windows 2003. I believe the IWAM account is used if the application is configured to run (isolated) in it's own DLLHost process.

    Is there a value in any of the following ServerVariables?

    Request.ServerVariables("LOGON_USER")
    Request.ServerVariables("AUTH_USER")
    Request.ServerVariables("REMOTE_USER")
    Paul
    ~~~~
    Microsoft MVP (Visual Basic)

  8. #8
    Join Date
    Jun 2005
    Posts
    13
    Code still refuses to work. I don't think the ServerVariables are set. I created a ASP page that would display them if they were and nothing come up on the screen.
    Assuming the following code would display those variables on screen:
    <html>
    <head>
    <title></title>
    </head>
    <body>
    <BR><BR>
    <%response.write Request.ServerVariables("LOGON_USER")%>
    <BR><BR>
    <%response.write Request.ServerVariables("AUTH_USER")%>
    <BR><BR>
    <%response.write Request.ServerVariables("REMOTE_USER")%>
    <BR><BR>
    </body>
    </html>

  9. #9
    Join Date
    Dec 2003
    Posts
    2,750
    Just a couple of other suggestions. I'm fairly certain that to write from the Stream object the folder must exist and the file must not exist.

    Also, I believe the anonymous user account should have read/write/modify permissions to the folder where the file is being written.
    Paul
    ~~~~
    Microsoft MVP (Visual Basic)

  10. #10
    Join Date
    Jun 2005
    Posts
    13
    The folder the ASP page tries to write to is currently empty. But even so, if the file did exist, it should overwrite it anyway. That is how it worked on Windows 2000 anyway. Thus the line in code that states: adSaveCreateOverWrite

    We have given the following accounts FULL CONTROL (read, write, delete, modify, etc): EVERYONE, IUSER_computerName, IWAM_or_IWAN_whatever_it_is, and any others we could think of
    We tried turning off inheritance. Every NTFS permisson we could find has been allowed. We even tried setting the folder up as a shared to the world folder to no avail. Basically anything NTFS wise, we have probably tried.

    I guess it comes down to me concluding that Win 2003 is not going to let my application run. Has anyone else ever gotten a file to upload / download from a SQL Server database through a ASP page that is housed on a Windows 2003 box? When I say download I mean like, store a .doc file in SQL server and have it uploaded and downloaded through an ASP interface.

    I have a job opening for whoever can figure this one out ;P

  11. #11
    Join Date
    Dec 2003
    Posts
    2,750

  12. #12
    Join Date
    Aug 2005
    Posts
    1

    IIS 6.0 Error Page not displayed

    Hello,

    Can you try the option in the internet explorer.

    Got to tool, internet options, and then to advanced tab.

    Just uncheck the option "Show friendly HTTP Error Messages"

    Hope this will help.


    Niraj Ranka

  13. #13
    Join Date
    Aug 2005
    Posts
    10

    Increase MaxMessageSize?

    Hi,

    You could try increasing the value of the node "MaxMessageSize" found in "C:\Windows\system32\inetsrv\MetaBase.xml"

    This is currently limited to only a few KBs and for any upload facility it must be increased to a sensible amount.

    Cheers,
    Jonny Tooze

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center