70

I have a number of websites that run under IIS on a single machine.

Should I put these websites inside of the C:\inetpub\wwwroot\ folder or inside the C:\inetpub\ folder?

E.g.

  • C:\inetpub\wwwroot\Website1\
  • C:\inetpub\wwwroot\Website2\

or

  • C:\inetpub\Website1\
  • C:\inetpub\Website2\

Are there any pros/cons for either or another recommended location (I only have a C drive on this machine)?

I am not sure whether there is a "correct" answer to this, but want to follow best practice if there is one.

Many thanks, Jonathan

Jonathan Williams
  • 2,015
  • 1
  • 19
  • 23

4 Answers4

71

Go the second route.

wwwroot is simply there as the container for the default website for the server. If you delete the default website from within IIS, then you can safely remove this directory. Regardless, your sites have nothing to do with the default, so they should be in their own folders under inetpub.

That said, we sometimes have multiple "types" of sites on the same server. For example DEV and QA. In this case I would structure it as:

c:\inetpub\dev\site1
c:\inetpub\dev\site2

c:\inetpub\qa\site1
c:\inetpub\qa\site2

NotMe
  • 87,343
  • 27
  • 171
  • 245
  • 1
    Thanks Chris. Yes, I suspected that this was the case. I have created my website folders inside of the inetpub folder. – Jonathan Williams Sep 26 '11 at 10:27
  • 1
    Make sure to assign the proper permissions to any new created directory, as those assigned to the wwwroot before deleting it. – mchar Jun 15 '20 at 07:11
4

As variant:

C:\WebSites\my.site1.com

C:\WebSites\my.site2.com

Ankar
  • 94
  • 2
0

if you prefer you can put your application folder on desktop of your server. It is really up to you. You just need to make the proper configurations inside IIS and grant necessary access permissions to your folder. That's all.

tugberk
  • 57,477
  • 67
  • 243
  • 335
  • 8
    I would stay away from this option as the desktop is linked to a single user (the folder tends to be under user settings on the machine) so removal of that user would break your website. I do understand the point of the post is "You can put it anywhere" but this is a bad exampl – DJIDave Oct 25 '16 at 09:48
-3

There is no definitive answer but

  • C:\inetpub\wwwroot\Website1\
  • C:\inetpub\wwwroot\Website2\

are the standard locations for web sites. For example c:\inetpub\ftproot could be used to host an FTP site.

Darin Dimitrov
  • 1,023,142
  • 271
  • 3,287
  • 2,928
  • 10
    The `wwwroot` folder is the default website that contains the IIS welcome homepage. Anything you place into this, will be accessible if you visit the server via it's IP address, or a binding the server doesn't recognise. Placing websites here is not recommended, place your website directory alongside this root folder, not inside it. – simbolo Aug 10 '15 at 13:39