How to compare settings of two websites on one IIS7.5 server - iis

I have two websites running on one server in IIS7.5 and would like to find a way to compare the settings each one has. (I see the question has already been asked for IIS6.)
I want to do this so I can see why one website is handling HTTP 404 errors differently to the other. I am sure I've set all the options in IIS to be the same on each site. I've checked the web.config files have the same values in the <httpErrors> and <customErrors> nodes. I cannot see anything in applicationHost.config either.
Thanks.

Doh! After going back into IIS and comparing the two websites again, I realised I had ASP errors set to "Custom" (instead of "Detailed") on the site that was the problem. The ASP.NET error settings matched, but not the ASP ones. The page that handled 404s was a classic ASP page copied from another site to save time.
I'm still interested to hear whether web.config and applicationHost.config are the only places where website-specific settings are stored?

Related

Is it good practice to delete Default Web Site in IIS?

I can't found nothing recent on the web about if deleting Default Web Site in IIS is a good practice, i'm using IIS v10 and as in wwwroot i have each website inside it's own folder in IIS i've just created a website for each of them..
So i'm just not using the Default Web Site and i was wondering if will it cause any problem if i will delete it (for now i've just disabled it but seeing it in the list is a bit triggering), about deleting or keeping the Default Web Site i just found an article from 2001 so i would know something more recent about it.
Yes, you can safely delete the Default Web Site in IIS Manager, even though delete the files under the wwwroot. And it should be a good practice to do that to avoid some unexpected web accesses or attack.
And the Default Web Site in IIS Manager, even though the files under the wwwroot, is used for the first validation of IIS installation.
More, the Default Web Site will take the default port 80 if not disabled/deleted.
So, please go ahead to delete it.

IIS does not contain Web Sites folder

I am trying to follow these instructions but I am unable to find “Web Sites” folder in IIS, and I tried to Google it, and I can't just find where this should be in my IIS manager. Is it because of a different version of IIS?
I can only see a folder called Sites, but it has no Properties option on right-click so I guess it is not the right one. This is how it looks:
Can anyone tell me if the information in that msdn blog post is still valid, and how to open Properties of WebSites in IIS?
As #LexLi have written in his comment:
That post is for the obsolete IIS 6. Try to use Google to search for posts that apply to IIS 7 and above.
So that solution was not a valid one in my case, as the IIS structure is different between the versions 6 and 7.

Url not showing expected content

I have a webserver using IIS 7 that hosts multiple sites. We've added a few subdomains recently and the one I'm working on WAS working. It's only partially in production so I'm not sure when this problem came up.
The problem is the subdomain (vendor.domain.com) is pointing to another site on IIS (Mobile).
Advanced settings of Manage Web Site show the bindings to be correct:
ftp:<ipaddr>:21:vendor.domain.com,http:<ipaddr>:80:vendor.domain.com,https:*:443:. The physical path is Vendors and has the files that I would expect it to be showing. But...it's not.
I've gone to the "Mobile" site that it is being redirected to and edited the files there and the changes I've made there have NOT been reflected on the vendor.domain.com as I would expect. It's like I have a cached version of the "Mobile" site.
Is there a way for me to find out where these files are coming from or a way to figure out why it's not showing the expected content?

Add Application Error on Default Web Site (IIS 7.5, Windows server 2008R2)

I am trying to add a .net application to my Default Web Site on IIS 7.5 Windows Server 2008 R2. The Default Web Site currently serves ASP Classic pages (not sure if that is relevant) and I'm trying to setup some aspx pages. But I can't even add a new application, i keep getting an error of
"value does not fall within range"
I have no idea what this means?
Please see my screenshot for more information:
http://i.imgur.com/nsUs5.png
Thanks in advance.
Although quite tedious, you could try checking the settings in the apphost config file. You can find it at C:\Windows\System32\inetsrv\config
Look for errors in names, sometimes spaces can be replaced with %20% by Visual Studio which should be removed, also if you have deleted something manually in your file system, this will not have been updated in the applicationhost config file, so any references would need to be removed manually also.
Regards, and good luck
Well i never found a solution apart from Creating the App as ASP Classic (which would allow me too do it) and then switching the AppPool to DefaultAppPool which in turn lets me server ASPX pages.
So, Kind of solved for now...

Classic ASP "Down for Maintenance" page

I'm making some changes to a legacy classic ASP application. I've made the changes locally, and now I want to copy the changed files to the server. At the same time, I need to download the Access database, add some fields to some tables, and upload it again. For this reason, I need to be able to stop visitors from modifying the database while this is happening.
My main question is, what is the best way to setup a quick "Down for Maintenance" page that will be shown immediately and no matter which page the visitor requests. The application is already established, so I'd rather an answer that didn't require me to rework the application's architecture.
My second question (maybe this should be a separate question):
Is there a better way to add fields to a db table than to copy it down, modify, and stick it up again? Please forgive if that's a dumb question - I'm new to ASP - new to Windows too.
I only have FTP access to the remote server.
Thanks.
two ways:
1
if you do a server-side include in every asp page you can do a response.redirect in that include to /upgrading.html
2
in global.asa you can do a response.redirect in the session on start event. THis is probably the best way. Will only work for .asp pages, not if the client comes to a .html page.
Do you have any control panel access to the site at all?
When I used to run a number of ASP Classic sites I often turned them off for the five minutes required to do what I needed.
Rude to do to your visitors I know.
As others have said you could redirect to a page, but that won't stop people visiting static content in html pages, but then that probably won't matter, at least it stops them making changes to the mdb whilst you download it.
It's a pity that ASP.net's app_offline.htm doesn't work for ASP classic.
Another option I used to use was to create a default.htm file that had the offline message, and the way IIS was setup default.htm overrode default.asp, so simply uploading default.htm changed the homepage. This of course doesn't stop anyone using any of the other .asp pages.
So no real answer! Sorry.
If you have just FTP access to the server (and no control over the IIS) just insert a response.redirect to the "down for maintenace" page in top of all the asp pages, and remove it when the update is completed.
The changes to the database can be performed with the ALTER TABLE statement.
With regards to the "Down Maintanance" page issue you can and taking mapache's idea a step further if there is an included file (for a header) in each of the pages you can put the Response.Redirect in that one file and upload that in place. This will avoid making changes to all pages.
Another option is to upload a temp html file which will be found first by IIS. In IIS you can set which page name.ext are looked for in a domain/folder. For example when you browse to www.example.com you don't specify the page you are looking for so it could load index.html or index.htm for example depending on setup. It will depend on your hosts configuration setup, but a bit of trial and error I'm sure you can find out which one they use. Common ones for IIS are default.htm, default.html, index.html and index.htm. You can then put it in each of the folders in the website (not ideal I know) and then carry out your maintenance.
When updating databases you can run a migration script, written in sql, to update the schema and data of the db. As you only have FTP access this will require some sort of page you can paste the sql into and run. This however opens security issues so downloading the db, making the changes and then uploading again is probably easier. In addition to doing it this way you can also save the file and you'll have a backup :-)
Hope this helps.
Better than an include file, just use the Global.asa.
In the Global.asa's Application_onStart, add
Application("Offline")= True
at the top of all of your ASP files, add
If VarType(Application("Offline")) = vbBoolean Then If Application("Offline") Then Response.Redirect "App_Offline.htm"
(The double-if gets around the lack of VBScript's short-circuit operators, and therefore any data type errors.)
You could even set the Global.asa code to
Set fso= Server.CreateObject("Scripting.FileSystemObject")
Application("Offline")= fso.FileExists(Server.MapPath("App_Offline.htm"))
Set fso= Nothing
Which would enable the offline page if it exists, like ASP.NET. However, the application start code is only reparsed when the server is reset (using iisreset), or when the Global.asa file is modified, merely adding the App_Offline.htm will not be enough.
Add below code in web.config
<?xml version="1.0"?>
<configuration>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
</system.webServer>
</configuration>
And place app_offline under root folder. This will work.

Resources