umbraco giving 404 on all pages except root. preview works fine - iis

BACKGROUND
We are upgrading an umbraco 4.5.2 site running on Win2k8r2 / IIS7.5, SQL2k8r2 to umbraco 4.11.10. Given the number of steps required to perform the upgrade, we chose to do it offline and then replace production with the updated db and file system.
We did an offline upgrade to bring it up to 4.11.10 (4.5.2 -> 4.6.1 -> 4.7.2 -> 4.8.1 -> 4.9.1 -> 4.11.10). These upgrades affected the database and the filesystem.
The old system has 14 domains resolving to the 1 umbraco site. The domains are just aliases and per requirements are not set up with redirects from 13 of the domains to a master - instead, each domain serves the same content - just with a different host.
The 14 host headers are defined in IIS. They are also defined in umbraco under:
Content (folder)
EN (language folder)
Home (Hostnames are defined here)
Top Level 1 (also a child of EN)
Top Level 2 (also a child of EN)
PROBLEM
When we test under localhost (which is defined in IIS but not as a hostname in umbraco), the site renders content as expected. However, when we test with one of the hosts defined in IIS and in umbraco host names (after setting it up to resolve to 127.0.0.1 in hosts file), we are able to get to the home page but all other pages result in a 404.
The home page and preview pages render fine and the content editor and other backend admin features work fine. However, the "nice url" pages do not render and get 404 errors.
WHAT I'VE TRIED
I have deleted app_data\umbraco.config and republished the entire site.
Create a new website in IIS. Still get the 404 on pages other than site root.
Looked in umbracoLog table. Didn't see anything about 404s or anything that looked unusual in relation to before/after upgrade but I'm not an umbracoLog expert.
Is it necessary to do a clean install of 4.11.10 to install prerequisites that I may be missing? If so, what are these prerequisites and can they be installed independent of 4.11.10 install?
I'm at a loss as to what might be causing the issue. Any help would be appreciated.

A combination of items fixed the problem.
The main problem was having the hostnames defined in umbraco under the Home node. I removed the hostnames defined in umbraco at the Host node. Hostnames still exist in IIS.
In config\umbracoSettings.config
Set <useDomainPrefixes> to false
Set <addTrailingSlash> to false
In web.config set umbracoUseDirectoryUrls to true
Finally, fix a side-effect of removing the umbraco hostnames that causes requests for / to resolve to the EN node by adding the following to config\UrlRewriting.config
<add name="SiteRootHack"
virtualUrl="^~/$"
rewriteUrlParameter="ExcludeFromClientQueryString"
destinationUrl="~/home.aspx"
ignoreCase="true" />

There are several things you should check, but if you are getting Umbraco's 404 page and you can access the backoffice then that is a good sign at least!
The first thing to do is check Umbraco's logs at ~/app_data/logs/ to see what Umbraco is logging upon each request, if anything. Then check:
Have you installed MVC3 and 4 on the server?
Is the application running in a .Net 4 integrated app pool?
Have you applied "write" permissions to the correct folders?
Try removing any domain settings you have in the Umbraco backoffice, these are almost redundant if the site is a basic install.
If possible you should also create an Umbraco project from NuGet, this way everything you need with regards to DLLs dependencies are installed in the project. Also, there shouldn't be any need to upgrade in so many steps. It should be possible to upgrade from 4.5 to 4.7 then to 4.11 directly.
Finally, check the breaking changes in the Umbraco versions. For example, GetProperty("propertyName").Value returns a string in one version and then was changed to object in a latter version possibly 4.11, so this would obviously start causing NullReference exceptions which may be inadvertently be causing the 404's. It is unlikely you would be able to upgrade like this without having to make some code changes.

Related

iis 10 .net core 2.1 website configuration error

Good Day,
I am running into an error that I have never run into before. I have a brand new server (Windows 2016) and I have added IIS 10 to it. I have also installed .net Core 2.1 and 2.2 runtime and SDKs onto the server. When I set up a .net Core 2.1 website, it appears to set up fine, but when I try to click on any of the features in the features view, I get a really generic error message (it happens for any .net Core website I set up). The error is an alert that states: There was an error while performing this operation. Details: [empty] Filename: \\?\D:\Apps\Test\web.config Error: [empty]
I found one place where this question was asked before, but I have IIS Rewrite 2.1, .net Core 2.1 and 2.2 and I have this site set up on another server (test env) and it works perfectly fine there! I have also made sure that IUSR and IIS_User both have read/write capabilities to the folder and every file in it.
Does anyone have any suggestions?
Thank you,
Tim
In my experience, this sort of error normally means there is either something it doesn't like in the web.config (XML element it doesn't recognize) or the web.config is missing.
Normally (for me anyway) this is because I've forgotten to install URL Rewrite as that's pretty much the only "extra" thing I use - but you've got that covered already.
It might be worth checking that the App Pool for the site is configured correctly and running (should be same as your other machine, check the basic settings and the advanced).
The only other thing I can think of, is that you've installed some of the features for IIS through the Windows Features, but not all of them. I sometimes have to go back through the lists and make sure all the right things are definitely checked.
Last step would be to create a real simple little mini site, with just a default page, use the IIS GUI to change some site level settings so it creates its own web.config, make sure it runs, then have a look at the differences between the files.
Hope any of that helps

Klondike private NuGet repository api page responds with an HTTP 404.0 error

Using the instructions in this link and the "How to Deploy Klondike"
github instructions I have installed the Klondike release on my local IIS (Version 10.0.15063.0). At first it looked promising, but then I realized that the main page is showing "loading..." rather than the Klondike URL. See image:
Additionally the when I click the API page tab, the site navigates to http://localhost:8081/api which returns a 404.0 HTTP error. This error may not seem very surprising as the site's directory does not contain an api directory. However, I have reverse engineering a working server with Klondike configured on it and it also does not have the api directory. Here is an image of the 404.0 error:
Additionally, when I try to nuget pushto localhost:8081, it results with the error in the image here (note, the red blocked out text is the apikey).
Finally, I have left the handleLocalRequestsAsAdmin is set to true, but even though I am on localhost, it does not show me the "LocalAdministrator" link. I believe that all these symptoms are linked to the same issue.
I have tried the following with no affect on the behavior:
Putting this site in c:\inetpub\wwwroot and also in C:\Klondike;
Using different port numbers, such as 8081 and 80;
Putting a 127.0.0.1 alias in my hosts file and binding the value in IIS to the host name; and
Installed the Debugging tools for Windows install as was suggested on the github site and set the debuggingToolsPath to its path.
(at this point, I'm just guessing at the issue)
The settings I have changed in settings.config file are as follows:
packagesPath = C:\Klondike\App_Data\Packages
Left lucenePath = empty string (I also tried this with a value of C:\Klondike\App_Data\Lucene with no affect.
symbolsPath = C:\Klondike\App_Data\Symbols
debuggingToolsPath = C:\Program Files (x86)\Windows Kits\10\Debuggers\x64
ignorePackageFiles = "true"
I have not changed any values in the web.config file from the default web.config release values.
Thank you for any help that you can provide.
I ran into the same problem, although I was installing Klondike on a remote server rather than locally, but still IIS 10. The problem might be you don't have all the IIS components installed or enabled. More specifically, .NET or one of its required components might not be installed or enabled. If you look at the error on the /api link - it has to do with the MapRequestHandler and Static file handler in IIS - this indicates IIS doesn't know how to handle the request, which is an indicator you might be missing the ExtensionlessUrlHandler in IIS, as well as other components. To solve the problem, go to Start -> Control Panel -> Turn Windows features on or off (varies per system, might be under "Programs and Features"), then find the IIS Application Development Features. These might be listed under Internet Information Services -> World Wide Web Services, or Web Server (IIS) -> Web Server, depending on your system. Once you find these Application Development Features, make sure you have an ASP.NET option checked - you might just want to check all the options. Below is screenshot of what it looks like on my system. You might want to reboot after adding those features - not sure if a reboot is required, but it doesn't hurt. After you enable those features, you might start to run into all kinds of file permission errors when running the Klondike app - you might want to just remove Klondike and reinstall it from the zip file. I have a feeling it Klondike doesn't run cleanly the first time it has problems, as it needs to create an App_Data folder with sub directories.

iis 10 Static Website: Deleting default site and creating completely new site (how to access new site)

This post needs help from experienced iis administrators, but must be explained in details for EXTREME newbies.
What I am doing:
I have two computers, both running Windows 10. One is a desktop and one is a laptop.
iis is enabled on both computers. Each computer can access the iis web server from the other and pull up a page from the other - using the ip address.
There is no DNS or host files being used (this is by ip address only), nor do I want to use any sort of naming.
Both computers are running an identical website, and the website files are in a different directory than the default. The structure is like this:
C:\inetpub\ROOT\myWebsite\myIndex.html
web.config
Changes I've made - now a few problems.
On both computers I have deleted the DefaultAppPool and the default website that comes installed with iis. This has not stopped the website from completely working, so adding that back seems unlikely to fix my problem.
I have deleted my application pool and website from iis (never deleting the actual files from the file system) several times, and added it several times. Each time I do this, my site comes back, but with the same problem I am having.
I have deleted all of the default documents, and the only default document listed in iis is myIndex.html.
myIndex.html initially displays a graphic image (using the standard tag), and this image comes up. Sort of. See explanation below.
The problem I am having
Before I started this project, I had iis working on the desktop with the default site and app pool and simply added some of my own files with really simple text content and some pics. I had replaced the default iis splash image with my own image, and all that worked with no problem.
the image that comes up is a link to another page that has a list of links to other stuff in my website. It all works no problem there.
Now, with the setup I have now, on the desktop I was originally using (in the paragraph above) if I pull up my website locally, myIndex.html loads in the browser and my image comes up, and everything works fine.
The same is true on the laptop, when I access the site locally.
However, if I attempt to access the desktop site (using its ip address) from the laptop, it pulls up the old splash image from the default site I deleted.( I left those files there even though I deleted the site from within iis). All those files are in the default location C:\inetpub\wwwroot.
If I move those files to another directory, thus leaving C:\inetpub\wwwroot completely empty, then when I access the site on the desktop (via the ip address) from the laptop, my new site comes up without a problem.
While it seems I may have solved my problem by moving the file from the previous project, doing that does not teach me how iis is actually working, and why files from a website that no longer exists in iis are still being accessed from remote computers.
So, please teach me something about the internal workings of iis, and how it chooses to access the different application pools and websites.
Again, please word your answers for complete newbies, because I know a little but not enough to get real technical.
I have been reading posts on stackexchange.com and other sites; links to microsoft docs etc. That's not helping as those docs are expecting too much prerequisite knowledge, and speaking in terms that are not really explaining things in a way I can understand.
You have described several different problems. I will try to address each of them (contrary to S/O recommendations).
First, when you make changes, and they don't seem to show up, it is usually because of caching. IIS always wants to cache files/configs. So does your web browser. So, to force an accurate test, you need to dump your browser cache and cycle IIS (to make sure it drops its cache and loads new files and configs). Start there.
Second, IIS is designed for settings inheritance. Which means, each app and each folder will inherit settings and permissions from the parent, unless you override them. Overriding them can be done by files and/or IIS configs (application vs folder). The IIS configs are the stronger of the two.
Also, the IIS config for "default files" might have come into-play for your test. If you didn't set up MyIndex.html as the top-most default file, then IIS would look for other files first. In fact, if you don't have MyIndex.html in the list of default files, IIS would have to depend on your app to choose that as a default page (MVC routing, etc).

IIS not able to locate the web.config

I have a deployed a web application in IIS. Which used to work without any issues. Recently i have shifted that web application to another machine, Here is the problem. Once i setup the Webapplication when i opened the default document in IIS im getting the File not found error as following
Internal Server Error
\?\C:\inetpub\wwwroot\application\web.config
I have no clue why the IIS is not able to find the web.config. The file is present in the path C:\inetpub\wwwroot\application\web.config but the IIS is looking in the path \?\C:....
Please let me know how to resolve this??
Firstly this is documented on support.microsoft.com so I would suggest that anyone who has this issue read this first as it covers a number of solutions which I won't
Now from personal experience I encountered this error after setting up a new development machine. What I had forgotten to do was install the Url Rewrite 2.0 IIS module. Sadly the IIS error gives absolutely no idea that this is the actually issue.
Therefore to solve this issue investigate the system.webServer setting in our web.config and ensure that you have installed all the iis modules that you use. I did this by systematically removing elements from my web.config until I came across the cause.
In my case, I was running ASP .NET Core website so I had to install .Net Core Runtime from
https://dotnet.microsoft.com/download/dotnet-core/current/runtime
I know it's old post but I resolved the same issue as follows:
If you are using TFS and you are getting this problem then Reason is ".vs" file is not excluded from commit.
Because of that ".vs\config\applicationhost.config" gets the local version of another user/Developer.
To Solve the error, First open that file Update Physical path inside "" xml tag.
Also ask user to exclude this folder from TFS to prevent future issues.
If you are getting mysql localhost error. What I will do will work for you.
Control Panel(View by: Large Icons) >> Programs and Features >>
(Usually upper left corner) Turn Windows Features on or off >>
Internet Information Services >> Web Management Tools and World Wide Web Services
After Restart.

Drupal Login goes to wrong URL :: Problem started after site migration

I just migrated a drupal 6 site from the ('normal-live') host to a MAMP (Mac (L)AMP stack). I needed to do this so a client can have 'offline' access to the site in remote areas.
I used the backup/migrate module on the live site to get an export of the db. On the MAMP setup I did a fresh install of Drupal. Then I copied the modules, files, themes, etc. to the new install. After that, using phpMyAdmin, I imported the exported (from live site) SQL file to the new install on the MAMP. At this point everything appears fine at...first glance, I can nav to the different pages as an anonymous user, etc.
My problem is that if I try to login it takes me to the old URL (instead of going to http://localhost:8888/drupal-6.20/??? it goes to the 'https://originalDomain.com/???'). If I change the $base_url in the settings.php it wants to reinstall the site (drupal installer runs), I am also using the .htaccess file that got installed w/ the fresh drupal (not the one from the live site).
I am baffled...
Since you're getting redirected from an URL starting with http to a URL starting with https, check to see if you have the Secure Pages module installed and set to redirect users.

Resources