Where should you save your IIS files - iis

May seem like a dumb question... but where should you save your website files in IIS?
If i need to make a WCF application should I just put the code in the wwwroot folder and convert the WCF folder into application?
Thanks

Its generally good to create a virtual directory and point it to the actual physical location, instead of putting all your files/projects in wwwroot folder

Related

Folder permissions in Azure web sites

Just getting my head around the new Azure web sites feature and hitting my first obstacle. I'm deploying a PHP site which writes cache data to the file system, but the app is throwing an error because the folder it wants to write to does not have write permission. Is it possible to set permissions on folders or is this a no-no?
I can probably work round this but would like to know if it's possible.
Folder permissions cannot be set/customized. This means whatever location your app writes to should be under your site root.
Your site can only write to locations under C:\DWASFiles\Sites\[siteName]\VirtualDirectory0 and to the %TEMP% folder.
Two caveats here:
Stuff can't be written directly under VirtualDirectory0, you have to create a subfolder under there and place your files in that subfolder
The %TEMP% folder really is temporary! If your site instance goes down for any reason and is brought back up somewhere else then everything in your %TEMP% folder will be gone. Use it only for files that really are temporary.
Is the folder that the app is trying to write to under the site's folder?
It's my understanding that folder permissions cannot be set/changed. But I haven't seen anything from Microsoft that definitively says "yes" or "no" to that.
It should be possible using webdeploy.
However I don't think there is a way do it without manually setting up the webdeploy package - as described in the post http://blogs.msdn.com/b/azureappgallery/archive/2013/04/03/set-file-folder-permissions-for-your-content-on-azure-website-using-web-deployable-package.aspx.

Need to point to files outside the www root

My problem is as follows, I am running a website on a window server. The websites are located in the following directory. 'c:/inetpub/wwwroot/'.
The c drive has become very full recently as one of the websites allows the user to upload files to this location 'c:/inetpub/wwwroot/mywebsite/recordings/'.
I would like to move this recordings folder the e drive on the server which has lots of space 'e:/mywebsite_data/recordings/'
I created this folder and have moved the files to there new location on the e drive.
My problem is I cannot create a hyper link to the files on this new location. I have tried this href below but obviously this is looking for a file on my own workstation.
Recording
Any suggestions?
Thanks
You can solve your problem by creating a virtual directory
Creating Virtual Directories in IIS 6.0
Here is an article on how to do this in IIS7
Understanding Sites, Applications, and Virtual Directories on IIS 7
You can use IIS' virtual directories: https://web.archive.org/web/20110318232846/http://support.microsoft.com/kb/172138
With them you can place external folders in your website (it's like an include).
Update:
Another tutorial: http://msdn.microsoft.com/en-us/library/zwk103ab.aspx

How to setup IIS 7 using physical path directing to DropBox?

I'm using multiple computers for development and I want to be able to store my files in my dropbox folder. I went to change the physical path in IIS from c:\inetpup\wwwroot to the dropbox folder but I get this error:
The requested page cannot be accessed
because the related configuration data
for the page is invalid.
I couldn't find the config file so I was wondering if anyone had done this before or whether there a better way to sync everything nicely across several PCs?
I tried it (IIS 7.5, Win 7) and it should work just fine to let your physical path of your web look at your dropfox folder. I would guess your web.config file generally contains malformed XML (see KB942055).
I'd suggest, try to map it to an empty folder just with an index.html file and see if this error still occurs.
As a workaround, I guess you can put Dropbox in your wwwroot folder and set up a virtual directory that points to Dropbox. However, there are some security issues that may hinder you from doing so. I come across a nice tutorial on how to set up Dropbox to IIS as FTP Publishing. Hope it helps.
Hodgin's guide on using Dropbox as FTP publishing.

IIS Config file in virtual directory

I have multiple websites that all have the same code, but different app settings.
I want to place my app settings in a separate configuration file that is located in a virtual directory. This will allow me to have a single copy of all of the code shared across all of the sites with a different virtual directory for each site.
Unfortunately, when I try to configure this, IIS doesn't process the config file when it is in a virtual directory.
If you have a solution to this, I would appreciate your help.
Maybe using the machine.config file on your web server would be a suitable alternative? Otherwise you could create a web.config file in a global folder somewhere and open it using the WebConfigurationManager.OpenMappedWebConfiguration() method.
It's not possible to use a virtual directory (or even files outside of the current website; only the current folder, or a sub-folder).
One possible way to share setting across projects would be to do it at build-time - either by coping it in, or using a Linked File in VS to have it copied to the folder on publish.
If you really need this functionality on the server, you could try (though I can't say how well it would work) a Junction.

When it says put crossdomain.xml in the root where would that be on IIS?

Would it be wwwroot, C, the root virtual directory where the assets are hosted, or the same folder that the assets are in?
Meaning if I have a virtual directory 'virdir' with a sub directory 'swf', which is really like C:\somedir\assets\swf\, where would the crossdomain.xml need to go so that my swf app on a different server can access the swfs?
you need to be able to access it as http://yoursite.com/crossdomain.xml so where would you put it to do that?
As a rule of thumb I put it next to my index.html for the site.
wwwroot will likely work for you.

Resources