where are the IIS server settings stored? - windows

I have installed url rewrite tool. I have set a global rule by right clicking on the server name (not a website name) and created a rule.
Now I want to edit this rule manually but I don't know where these settings are stored? when I create a rule for a website, it is stored in web.config but in this case I created rule for whole server and I can not find where it is stored? Is it stored as windows registry key? Do browsers look for windows registries rather than the web.config to ask for rules?

When doing a configuration via IIS Manager, the statusbar shows into which file the settings will be stored. At server level it mostly is applicationHost.config which is stored at %windir%\System32\inetsrv\config\applicationHost.config.

Related

How to access SharePoint files from a remote windows machine?

I have a few files in certain SharePoint folders that I would like to access from a Windows (Virtual Machine) remote machine. As a test, I copied the "link" of a SharePoint Excel file and used it in the WindowsVM browser and I connected successfully and opened the file.
I also tried to map a SharePoint folder's "link" within WindowsVM Folder Explorer/Network but I am getting the below error msg
Is there a way to accomplish this?
Thank you
To be able to map a SharePoint site as a network drive (this uses WebDAV) please make sure:
The SharePoint site url is added to trusted sites list in Internet Option -> Security -> Trusted sites.
Use Internet Explorer to navigate to the SharePoint site and sign-in using your credentials and leave the browser open (this should not be required but it helps somehow)
Now try to map the site as a network drive.
If the above does not resolve the issue (and assuming you are running Windows 10) you can additionally navigate to Settings -> Accounts -> Add a work or school account.
Edit:
If you only have Edge browser (no IE) - you'll need to open the SharePoint site in IE compatibility mode on Edge and login-in (SharePoint looks ugly in this mode). Once this is done continue to map the drive.

IIS 8 Virtual Directory Permissions for Linux Folder

I have just added a new Win2012 IIS8 server to my website. The main part of the site is working fine, but I have a problem with a virtual directory. The physical path points to an IP address (\192.168...). The 'connect as' user is set correctly. 'Test Settings' reports no problems. The setup matches precisely other servers on my site (except that they are IIS 7).
The problem happens when I click 'Edit Permissions' for the virtual directory. Instead of seeing properties for the directory, I see properties for 'System32'. I cannot set permissions for the virtual directory, and so I can't serve files from it.
On another server, 'Edit Permissions' behaves properly. I can see the permissions assigned to users on the Linux box. If I 'Add' to add another user, the 'Location' box shows me the Linux server IP, and I can add a Linux account.
I can browse, view, and edit files though Windows Explorer on the Linux server, so there is no connectivity problem. But IIS doesn't see it.
I feel like I missed a step somewhere - any ideas out there?
Found the answer over on serverfault (which is probably where I should have posted in the first place...). The allowSubDirConfig value for the site needed to be set to 'false'.
Details here

IIS Express 8 - Cannot write configuration file

I am trying to use IIS Express 8 for a MVC site in VS2012. I am getting the following error whenever I attempt to create the site:
Filename:
\?\C:\Users\xxxxxx\Documents\IISExpress\config\applicationHost.config
Error: Cannot write configuration file
Is there some way to force IIS Express to use a different location for the config & logs folders? I understand I can point to a different location when I am running iisexpress.exe from the command line, but I have no control over this when using Visual Studio.
Alternatively, has anyone got any suggestions why the error is happening? (Side note: My laptop is in a corporate environment which has some stupid encryption on the "Documents" folder, however I haven't had any problems with other software that saves to this location. I also have given the "Everyone" group full access to the folder.)
EDIT - After following the instructions at http://learn.iis.net/page.aspx/1286/iis-80-express-readme/ I still can't seem to get this working. I've tried the following:
Added HKCU\Software\Microsoft\IISExpress\CustomUserHome registry key pointing to my alternate directory
Added HKCU\Software\Microsoft\IISExpress\8.0\CustomUserHome registry key pointing to my alternate directory
Added HKLM\Software\Microsoft\IISExpress\CustomUserHome registry key pointing to my alternate directory
Added HKLM\Software\Microsoft\IISExpress\8.0\CustomUserHome registry key pointing to my alternate directory
Setting the %IIS_USER_HOME% environment variable pointing to my alternate directory.
Any other suggestions?
#Brad
I had your same problem just now. Removing the encryption on the IISExpress folder and the "Read Only" attribute solved it. In my company Documents is also encrypted, but I don't think removing that encryption from IISExpress would be a problem of any sort.
Hope this helps.
I had a very similar error message caused by a completely different problem.
The Error:
C:\VS\TFS_Projects\SomeSolution\SomeProject\SomeProject.csproj : error : Creation of the virtual directory http://localhost:55063/ failed with the error: Filename: \\?\C:\VS\TFS_Projects\SomeSolution.vs\config\applicationhost.config
Error: Cannot write configuration file due to insufficient permissions
More Details: I couldn't even open the project, as opening it would fail.
I could get prior changesets, and they would actually open fine, but if I got latest the projects couldn't be opened.
Solution: In my case, it turned out that when we changed TFS servers, someone had added the ".vs" folder to source control along with everything else. Under which, one developer had his applicationhost.config set up to run sites on a D:\ drive, while I had no such D:\ drive (well, it was a DVD drive.) I was able to get this working by finding a prior changeset with the un-altered applicationhost.config and replacing my local file. (I could have attempted to actually delete the folder, but I didn't go that route.)
Afterwards, we removed the ".vs" folder from source control.
(I put this solution here because it's where google landed me, so other people having this error message might find the above solutions don't fix it for them, and thus they might be having this problem.)
I'm also in a corporate environment with Encryption on the users folder, and removing encryption and removing the read only flags on everything in the IISExpress folder worked for me.
I'm using Visual Studio 2017 on Windows 10 and to fix this problem I had to disable the OneDrive setting "Save space and download files as you use them". After changing the setting my computer crashed but after rebooting I was then able to change SSL Enabled and everything worked.
For anyone googling this; this might be the same problem as this: http://connect.microsoft.com/VisualStudio/feedback/details/878812/use-iis-express-is-broken-in-vs-2012-on-windows-8-1
You can check it by downloading Prcocess Monitor and run it with a filter for "Path" contains "\Documents\IISExpress\config" and then try to change the project to use IIS Express. If there is a CreateFile entry with the result 0xC0190052 as one of the last entries then this is the same issue.
After struggling with this, and verifying encryption and read-only attributes, and having them not work, my solution ended up being:
Navigate to the folder containing the IISExpress folder (in my case, it was in my OneDrive, not Documents folder)
Right click on IISExpress folder > Security tab > Advanced button
Change Owner to yourself, even if it already is
Check the "Replace owner on subcontainers and objects" box
This may not appear until you've completed the Change owner dialog
Open the IISExpress folder
Right click on config folder > Security tab > Advanced button
Add a user > Add principal
Change location to local machine (and not a domain)
Enter the name NETWORK SERVICE and "Check Names"
Press OK to get back to the Advance Security dialog
Make sure to check "Replace all child object permission entries with inheritable permission entries from this object"
Worked in Windows 10 with IISExpress 10, for both VS 2013 and VS 2017.
C:\Users\xxxxxx\Documents\IISExpress\config\applicationHost.config
Uncheck the read-only attribute from the file. It worked for me.
Adding the registry entry seemed to work, however, using environment variables in the registry entry did not. In my environment only our documents directory is redirected, so I simply wanted to move the IIS Express config directory up one level to the %USERPROFILE% directory. However, that did not work. IIS Express read the environment variable literally and of course failed to run.
I had the same issue before, running VisualStudio as Administrator (Run as Administrtor) resolved the issue.
I also had the problem and tried to fix it with setting the registry key in HKCU\Software\Microsoft which didn't work.
The error I made, was using HKCU because, since I do not have permissions to edit the registry under by normal account (which I use to run visual studio), I was using an administrative account. Then of course, HKCU was for that account.
So I just used HKEY_USERS\"my normal user's SID" instead and, when starting iisexpress.exe manually, it created its files at the location indicated. What still didn't work was using iisexpress from visual studio. It still seemed that VS didn't use the registry setting at all.
Finally I resorted in setting a non UNC path for Shell Folders\Personal and User Shell Folders\Personal in HKU\"my normal user's SID"\Software\Microsoft\Windows\CurrentVersion\Explorer\ which did the trick.
I received the same error but in a different context. Opening a project (.csproj file) provided by another developer returned this error and failed to do anything:
Creating of the virtual directory http://localhost:58753/
failed with the error:
Filename: \?\C:\Users\xxxxx\Documents\Clients\xxx\Gen
II\xxx\,vs\config\applicationhost.config
Error: Cannot write configuration file
I removed both Encryption and the R/O attribute from the directory containing the project files and applied to all subfolders and files. Visual Studio can now read the project.
In my case I moved the folder to another location, so I had to edit the applicationhost.config file and changed the virtualdirectory entry to the new location. Removing encryption and setting read only off did not help. I imagine if I had just copied it instead of moving it, it would have happily continued working.

Create virtual directory at http://localhost/

Hi I would like to create a virtual directory at http://localhost
Its just a standard IIS 7.5 installation, meaning that http://localhost/ just shows the iis logo. But how do I remove that page and make it possible to use it for at virtual directory.
Right now Im getting this message in Visual Studio, when Im trying to create the virtual directory.
"Unable to create the virtual directory. The URL 'http://localhost/' is already mapped to a different folder location."
I can create a virtual directory at ex. http://localhost/web But I need it to be a http://localhost/
What you want is not a virtual directory. Just change the physical path of your Default Web Site to where you want it, or publish into that folder. By default the physical path is c:\inetpub\wwwroot\.
Default Web Site -> Manage Web Sites -> Advanced Settings -> Physical Path
Right click the folder that you want to make as the virtual directory.
Under Properties->Web Sharing select the Default website.
Also click the option Share this folder. In Aliases give the name of the folder. Now click OK.
There's nothing "virtual" about the directory mapped to http://localhost. That's your web root, likely located at c:\inetpub\wwwroot\. You should be able to publish directly to that.
A Virtual Directory is basically configuring IIS to internally create a folder under the web root which points to a different folder on the file system, as opposed to one actually located under the web root folder. It doesn't sound like you need that.

ASP.NET Web Setup

I have 3 web projects in a Visual studio solution.I want to create a single web setup project which should install all 3 web projects in their virtual directories.So how to create a single web setup project which supports multiple web application installation?
You can do this by creating a Web Setup Project. In the File System add as many Web Custom Folders as you need.
Only the main Web Application Folder will have the installation dialog so if you want to customize the virtual directory names then you will need to add a screen and set the Property of the web custom folder to be the same as the field name on the screen you add.
I never found the whole "web setup project" concept to work well. For starters, I've never managed a web server where the only site configuration was the default web site, so the "out of the box" functionality of defining a virtual directory to be created on the default site never worked for me, and it doesn't sound like it would be very useful to you either.
The best option I've found is to create a standard setup project that installs the output + content files of each web site into a \\Website path (or similar) and write a custom installer action with a supporting GUI that allows the installer (user) to select the proper web site and specify the name of the virtual directory to be used.
As John Hunter said, it is possible to add multiple Web Custom Foldsers beside the default Web Appplication Folder. But you need to know some details about how things add up.
One thing to notice is that the Property name you set for the additional folder will be the physical path of the installation. This however is read only in your setup logic, because it is automatically set later as the location of the IIS default path (typically C:\intepub\wwwroot\) added with the value specified in VirtualDirectory on the folder properties. So what you need to set in the custom screen you add, is not the Property name defined on the folder, but the property name that is used for the virtual directory. This is the Property name you specify appended with "VDIR". So if the property name you specify for the web folder is "WEBSITE1", then the property name for the virtual folder will be "WEBSITE1VDIR". In your custom screen, you then need to set up the property name for the text field you use to "WEBSITE1VDIR", The default value in this textbox will be automatically populated with you default VirtualDirectory value specified on the folder.
If you choose to remove the default Installation Address dialog so you specify also the main web site in a custom text box on the same page as the others, you need to know that the property name for the physical path as you see grayed out is fixed to "TARGETDIR" in the Property name for the "Web Application Folder". However, the property for the virtual path is not "TARGETDIRVDIR" as it would be if it followed the same name convention as the other, but it is "TARGETVDIR".
But if you do remove the default Installation Address dialog, you loose the option to select the web site to use (typically "Default Web Site") and Application pool from drop downs that shows you what is available.

Resources