Tuesday, February 06, 2007

Error:"internal 500 error” when you access http://localhost

Error: "internal 500 error" when you access http://localhost
Try this first
If above solution does not work another solution
It works perfectly fine if you install the same in following order
  1. IIS
  2. .net
  3. Win XP SP2
Reason for the Error:-
If IIS gets installed after SP2, IIS does not server ASP or ASP.net pages. But IIS responds to plain HTML pages.
IIS depends upon COM+. And COM+ depends upon MSTDC (Distributed Transaction Server).
The reason for the error is MSTDC and COM+ link got corrupted and cannot contact MSDTC
Solution:-
We need to
  1. re-install MSDTC
  2. Create IIS packages (optional, sometimes it works fine without doing this)
Solution:-
  1. Login as administrator account.
  2. Create a System Restore point (start->programs->accessories->system tools->system restore)
  3. make sure that local user accounts IUSR_MYSHECXXXXXD, IWAM_MYSHECXXXXXD are not locked/disabled
  4. click on start -> run type "services.msc"
  5. Stop and disable the following services
COM+ event system
COM+ System Application
  1. Closer services MMC and restart the machine.
  2. Open command prompt type the command %WINDIR%\System32\msdtc.exe –uninstall
  3. Open Registry Editor and then remove the following keys if they exist:

HKEY_CLASSES_ROOT\CID
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSDTC
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\MSDTC
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Services\MSDTC

  1. Open command Prompt and type %WINDIR%\System32\msdtc.exe –install
  2. Once this task is performed properly, start the service COM+ event System as automatic
  3. Open registry editor and create a registry key (NOT A VALUE)
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSDTC\XADLL
  1. Type the following command in Command prompt
regsvr32 mtxoci.dll
  1. You will receive a message that DllRegisterServer in Mtxoci.dll succeeded.. Click Ok and Restart the machine.
  2. Login as administrator account and type the command in Command prompt %WINDIR%\System32\msdtc.exe –resetlog
  3. Open control panel->administrative tools->component services.
  4. Double click on component services , expand to component services->computers->my computer ->COM+ Applications
  5. You should be able to expand all the nodes in this window without any errors. If in case you get errors follow the below steps , else restart IIS with "iisrest" command and reboot the machine and check for http://localhost/
  6. If COM+ navigator throws errors, open command prompt and type the following commands
Cd %windir%\system32\inetsrv
rundll32 wamreg.dll, CreateIISPackage
regsvr32 asptxn.dll
  1. Then restart IIS( you can use "IISReset" command in command prompt)
  2. Restart the machine if it asks for

Ritesh Kumar Kesharwani
Infosys Tech. Ltd.

No comments: