Archive for the ‘Windows TCP/IP’ Category

IIS7 - DEBUGGING ASP Application

Friday, August 15th, 2008

Classic ASP: Security is Painful

I had to write some good old classic ASP code today and my classic ASP coding skills are so rusty that I put tons of errors in the code. I’m used to having basic ASP error messages on IIS5 and 6 which usually help me to track down problems. On IIS7 I only got the following though:

An error occurred on the server when processing the URL. Please contact the system administrator

After investigating a bit I figured out that we changed the default for the “scriptErrorSentToBrowser” flag in IIS7. It’s now false and you always get the error above. Here is how to change it:

%windir%\system32\inetsrv\appcmd set config -section:asp -scriptErrorSentToBrowser:true

Once you are done with debugging your ASP app please set it back to false. There are lots of ‘evildoers’ out there! :)

IIS Listen on non-specified IP ?

Sunday, March 2nd, 2008

We have a Windows Small Business Server at work, which we wanted to install Subversion onto. We therefore wanted to run Apache on the same server. However, IIS is also installed on the same machine for Small Business Server purposes so I couldn’t just remove IIS.

I had added multiple IP addresses to the server so that IIS could have one and Apache could have another (so they could both run on port 80). However, I ran into the problem that IIS was taking control of all IP addresses on port 80 and so Apache wouldn’t start. It seems that IIS 6.0 has a “feature” called Socket Pooling that claims all ports for all loaded IP address (even if not configured in IIS) - nice! So IIS had control of the port 80 on the IP address I had assigned to Apache.

Do not fear - there is a workaround:

  1. Extract the httpcfg.exe utility from the support tools area on the Win2003 CD.
  2. stop all IIS services: net stop http /y
  3. have IIS listen only on the IP address I’d designated for IIS: httpcfg set iplisten -i 192.168.1.253
  4. make sure: httpcfg query iplisten (the ip’s listed are the only ip addresses that IIS will be listening on and no other)
  5. restart IIS Services: net start w3svc
  6. start Apache service

You’ll then find that Apache and IIS will then play nicely together and run on the correct ports on the correct IP addresses. Woo hoo!

Can’t connect to MySQL server(10048)

Friday, February 2nd, 2007

We run Windows IIS + PHP, and we realise that the message Can’t connect to MySQL server(10048) do appear randomly. and we check out “netstat -an”, the port will not connect above 5000

The article Q196271 has solved our problem.

1. Start Registry Editor.
2. Locate the following subkey in the registry, and then click Parameters:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters

3. On the Edit menu, click New, and then add the following registry entry:

Value Name: MaxUserPort
Value Type: DWORD
Value data: 65534
Valid Range: 5000-65534 (decimal)
Default: 0×1388 (5000 decimal)
Description: This parameter controls the maximum port number that is used when a program requests any available user port from the system. Typically , ephemeral (short-lived) ports are allocated between the values of 1024 and 5000 inclusive.

4. Quit Registry Editor.

Note An additional TCPTimedWaitDelay registry parameter determines how long a closed port waits until the closed port can be reused.