How can I deploy an IIS application to a subpath of a web site?

We currently have an application in the Default Web Site at the path /ourcompany/. If I try to deploy my OctoPack containing the web application to Default Web Site, then Default Web Site’s path is changed from C:\inetput\wwwroot to the configured Custom Install Directory. Not what we want. If I instead configure the Web Site name to be “Default Web Site\ourcompany”, then the deploy fails with the following errors from IISWebSite_BeforePostDeploy.ps1.


Set-WebConfigurationProperty : Filename:
Error: Unrecognized configuration path ‘MACHINE/WEBROOT/APPHOST/Default Web Site\ourcompany’

If I try Web site name = “Default Web Site/ourcompany” then I get this instead:


Assigning bindings to website…
Clear-ItemProperty : Property bindings does not exist at path
\SERVER\Sites\Default Web Site\ourcompany.

  • Clear-ItemProperty $sitePath -name bindings

Hi Carl,

The Octopus “IIS Web Site” feature doesn’t support virtual directories at this point.

Manually setting up the VDIR in IIS (or scripting this with custom PowerShell) then using the alternative “IIS 6+ Home Directory” featureis the way to handle this.

Hope I’ve understood you correctly, let me know if you still have any trouble.

Cheers,
Nick

Thanks, Nick. What is the IIS 6+ Home Directory feature? Is it a feature of IIS or of Octopus?

Hi Carl,

It’s a feature of Octopus. When editing a NuGet package step in Octopus, you can click “Configure features”, and there’s an option for IIS6+ home directory.

Hope that helps,

Paul

This is very frustrating. I don’t see that documented anywhere, virtual or application directories not supported. I wasted hours trying to get it to work.

Please support this in the near future as I’d have to imagine this is the most common way to install.

Thanks for the honest feedback Paul, you can follow the status of this feature here:

https://github.com/OctopusDeploy/Issues/issues/588

Paul

Same goes here Paul. We just upgraded our environment to Octopus 2.0 and with a lot of surprise we noticed that the IIS feature doesn’t understand the concept of Virtual Directory.
This is frustrating cause I have now tons of machines and 10 projects that need to be converted somehow in order to install properly even with Octopus 2.0.

Raf

Hi Raffaeu,

We have two IIS conventions - one will create/update web sites and application pools. The other will update an existing web site OR virtual directory. This is the way Octopus 1.X worked, so things haven’t got worse - we just haven’t added VDir support to the new automatic site creation feature.

Paul

Hi Paul and thank you for your reply.
Yes you are right, if I use the IIS 6 functionality I can still deploy web
applications in virtual directories, the pity is that I loose the
flexibility of naming my own app pool.

Raf

Hi,
any updates here?

Hi Sebastian,

Last commend was over a year and a half ago and I’m not sure there were any pending comments about it.

Perhaps it’ll be best if you can describe your current scenario and what you are having problems with :slight_smile:

Regards,

Dalmiro

A quick note here when setting up a process within the website name field use : #{OctopusWebSiteName}. This should be a variable and configured to reflect the virtual directory Default Web Site[Virtual Directory].

Recreate your release - this does the trick!