Can the web deploy agent run on a port other than 80 on IIS6?

Troy Hunt picture Troy Hunt · May 3, 2011 · Viewed 21.7k times · Source

I've got a bit of a challenge with a Windows 2003 machine where I need to run the web deploy agent on a port which isn't 80. By default, MsDepSvc will expose an endpoint at http://[server]/MsDeployAgentService which obviously implicitly listens on port 80.

The problem I have is that the machine is also running Visual SVN Server which is using port 80 and as a result, the web deployment agent service refuses to start. (At least this is the only logical conclusion I can draw.) I have a small SVN management app on the same machine which I'd like to publish over web deploy hence the conundrum.

Is it possible to run the agent on another port? Obviously if this was IIS7 we'd be on 8172 and everything would be fine but unfortunately that's not the case here. Any suggestions?

Answer

Kev picture Kev · May 16, 2011

There's a couple of ways to do this:

Option 1: Uninstall and re-install Specifying a different port:

msiexec /I WebDeploy_x86_en-US.msi /passive ADDLOCAL=ALL LISTENURL=http://+:8172/MsDeployAgentService

The command line installs the MsDeployAgentService and configures it to listen on port 8172 just like on IIS7.

Option 2: Re-configure Existing Service to listen on port 8172:

  1. Stop the msdepsvc (net stop msdepsvc)

  2. Edit the following registry value:

    HKLM\SYSTEM\CurrentControlSet\Services\MsDepSvc\Parameters\ListenUrl
    

    It'll look something like:

    http://+:80/MsDeployAgentService
    

    Change to:

    http://+:8172/MsDeployAgentService
    
  3. Query HTTP listeners:

    httpcfg query urlacl
    

    Your should see the following entry listed in the results:

    URL : http://+:80/MsDeployAgentService/
    ACL : D:(A;;GX;;;NS)
    
  4. Modify listener:

    httpcfg delete urlacl /u http://+:80/MsDeployAgentService/
    

    This should respond with: HttpDeleteServiceConfiguration completed with 0.

    httpcfg set urlacl /u http://+:8172/MsDeployAgentService/ /a D:(A;;GX;;;NS)
    

    This should respond with: HttpSetServiceConfiguration completed with 0.

    The ACL specified in the /a switch should match the ACL reported by the httpcfg query urlacl command

  5. Restart the msdepsvc (net start msdepsvc).

  6. You can confirm that the service is listening on port 8172 by doing:

    netstat -an
    

    You should see the following:

    TCP    0.0.0.0:8172           0.0.0.0:0              LISTENING
    

Warning:

I would try this on a non-production machine first to ensure this works as you expect.