not simple enough? blank page...

Jun 15, 2007 at 9:56 AM
I followed the instructions to the letter, installing to a local server (one of several) running on a Vista machine.

>Set folder as a .NET 2.0 application
In my system you have to run the IIS Manager, find the folder with the application in it, right click it, select "Add Application..." and accept the defaults. Well that's what I did. I've no idea how to revert this step, but I suppose that was what was needed.

>Add write permissions for App_Data folder
I can't figure this one out at all. Add write permissions for whom, precisely? I looked at the forums here and there seems to be some debate over it, but I don't seem to have the classes of user being discussed. Do I do this thing from the IIS Manager somewhere, from one of these little icon things? Or do I go to the file system and set the permissions there? Do I have to create a new user (called what?) on the machine or something? Sounds unlikely. There are lots of ways I could interpret this... in true adventure game style I've tried them all but I can't seem to find the way forward.

Can anyone help and tell me precisely what is required here? It's a standard Vista machine, it's not smart and neither am I.


>Navigate to the web page
>Ok, now you are ready to navigate to the web site and see how you did. If all goes well, you are greeted by the default blog page.

Which web page? Well I typed in the url of default.aspx, but that came up with a horrible error message, which I of course no longer have. Some googling for the error message told me that it was because asp.net 2 or something wasn't installed... indeed, the servers on this machine were using only classic ASP, so that could be so. I checked the Vista install and it seems that the default install of IIS indeed doesn't include ASP.NET or some required bit of it. Whatever... I ticked all the boxes and restarted the machine, so that's done.

So now if I type the url with /default.aspx on the end it gives me a mime-type error 403. I've no idea what to do with that.
If I type just the directory name in the url (no file name), then I get a blank page, which I don't understand either.

Does anyone have any ideas what all this means? It's just a standard server, honest. If I can't install it here then I've bog-all chance of making it work on hosted kit... ug.
Jun 15, 2007 at 7:30 PM
In my system you have to run the IIS Manager, find the folder with the application in it, right click it, select "Add Application..." and accept the defaults. Well that's what I did. I've no idea how to revert this step, but I suppose that was what was needed.

As your using Vista I am not entirely sure if it behaves like Windows XP Pro but I am going to assume its the same. What you need to do first is the following:

1. Download .NET 2.0 Runtime

2. Install the Runtime (this will update your IIS installation with any missing components)

3. Unpack the BlogEngine web files to your INETPUB directory, this will normally be on your C:\ drive so you want to copy the contents of the web folder (all of the folders and files including default.aspx) into:
C:\inetpub\wwwroot\blogengine (or whatever you want to call your blog directory)

4. Now you need to configure the blogengine as an application otherwise it will not work. Start IIS Manager, you can do this by click on START > Run.. (or the Search box in Vista) and then type inetmgr

5. This will start the IIS Manager; double-click on the server (should be the name of your PC), Websites and then Default Web Site. You will see a list of folders in the left hand column.

6. Right-click on the folder for your blogengine so if you called it blog, right-click this and select Properties. You will see a dialog box appear with a bunch of options/settings. Find the section that says Application Settings

7. Click on the Create button to create the application and then click OK to exit the dialog box. You will now see the folder for your blogengine has changed to a different icon (ugly green thing), this indicates the folder is now a web application.

7.1 An additional check you can do is to confirm your application is using .NET 2.0. Right-click the folder and choose Properties again, then click on the TAB labelled ASP.NET. This will show which version of .NET your application is using, it should say ASP.NET version: 2.0.xxxx.

I can't figure this one out at all. Add write permissions for whom, precisely?

Okay you need to setup the folder so that the ASP.NET service and IIS can read/write to the folder to save your users and blog content. As your hosting the site on your local PC you will need to pick the right users to permit read/write on the folder.

1. Open Windows Explorer and browse to where your BlogEngine site is hosted e.g. C:\inetpub\wwwroot\blogengine\

2. In that folder find the folder called App_Data, right-click this folder and select Properties, you will see a dialog box appear with a bunch of TAB's at the top.

2.1 If you don't see a Security TAB then you need to setup Explorer to allow you to see it. Not sure if this applies to Vista but in Windows XP you open Windows Explorer, click on Tools > Options > View (tab) > Scroll to the bottom and untick Use simple file sharing (Recommended). Then click OK to exit

This will allow you to see the Security tab when you click on the Properties option for the folder

3. In the Security tab you will see some User's listed. One of those should say something like:

<YOURPCNAME>\<YOURUSERNAME>

Where YOURPCNAME is the hostname of your PC and YOURUSERNAME is the login name you are using Vista with. Select that user id and you should see the bottom Permissions box show what permissions are enabled. Make sure Read, Write and Modify are ticked.

4. Click on the Add button to display the add new user dialog box

4.1 This isn't the best designed dialog box so can be a bit confusing. In the empty white box type the following:

NETWORK SERVICE

4.2 Next click on the Check Names button, this should automatically complete the name to <YOURPCNAME>\NETWORK SERVICE

4.3 Click on OK and you will see the Network Service user id has been added to the list. Now select the Network Service id to see what permissions it has been given. You will want the following permissions for that id:

Read, Write and Modify

5. Finally click on OK and your folder should be done. You will need to check the child objects have been given the correct permissions (thats the files contained inside the App_Data folder).

5.1 In Windows Explorer browse inside the App_Data folder, you will see a list of files and folders. Right-click the users.xml file and select Properties. Then from that dialog box click on the Security TAB to display the list of users and their permissions.

5.2 You should have your username listed and the Network Service, click on each one and make sure they are showing Read, Write and Modify as the selected permissions.

5.3 If they are not (sometimes this happens), then select each user id and assign the Read, Write and Modify permissions

6. You need to restart IIS to make sure the changes take affect. In IIS Manager, right-click the top name of your PC e.g. <YOURPCNAME> (local computer) and from the list choose All Tasks > Restart IIS.

6.1 You will see a dialog box appear, select the Restart Internet Services on <YOURPCNAME> option and click on OK. This process can take a few minutes, once done you should be able to browse your blogengine site.

7. In IIS Manager, from the left hand column, right-click the folder that contains your blogengine e.g blog and then choose Browse.

7.1 If everything is working correctly you will see the default page for BlogEngine.NET appear in the right hand side of IIS Manager.

All done!

Thats it, your all done now. To test the login page and confirm your able to log in, browse the following page:

http://localhost/<yourblogenginefolder>/login.aspx

Where <yourblogenginefolder> is the name of the folder containing your blogengine. That should display a page asking for login credentials, type the following:

Username: Admin
Password: admin

If everything worked you should see the default blogengine page again however on the right hand side you will see a list of options. Click on the one labelled Users to display the User Manager page. This page lets you add and delete users.

Create your new user and give it a password, then locate the Admin user and remove it by clicking on the Delete link on the right hand side (bottom right side of the page), if this worked you will see the Admin user disappear (not a good idea leaving the default install user id there!).

That should be your lot mate, any problems ask away.

Adios,

Fz

Jun 15, 2007 at 11:38 PM
Thanks; I have pretty much all of that but it helps to confirm it...

security/ permissions
Okay you need to setup the folder so that the ASP.NET service and IIS can read/write to the folder to save your users and blog content. As your hosting the site on your local PC you will need to pick the right users to permit read/write on the folder.

That's the data I was missing....
I added read/write/modify for any authenticated user (which includes me!) and also the NETWORK SERVICE to the App_Data directory and subdirectories. The dialogs are like they are in XP, pretty much. I'll put this in the Wiki once I've made sure I have it all correct.


There's a restart button for IIS in IIS manager....

The "browse" thing gives a blank page because I don't have IIS to return default.aspx when hit with a directory... by default it displays a blank screen. The defaults for Vista seem to be: Default.htm, Default.asp, index.htm, index.html, iisstart.htm. Obviously I can change that, but I can also just type in both default.aspx and login.aspx... both of which give me:

HTTP Error 404.3 - Not Found

Description: The page you are requesting cannot be served because of the Multipurpose Internet Mail Extensions (MIME) map policy that is configured on the Web server. The page you requested has a file name extension that is not recognized, and is not allowed.

Error Code: 0x80070032

So I'm getting there... I haven't set IIS up to run ASPX correctly. I've run Visual studio a few times on this box, but it uses a pseudo-web server when you test with it, so I probably have not actually run any aspx on here... I figured my problem was the magic permissions, but it looks like it's two-fold. Anyway, that was the blog-specific issue, I'm sure I can figure out the IIS thing in the morning!

thanks
Jun 16, 2007 at 12:17 AM
Your not too far off then, sounds like Vista makes a meal of IIS (no doubt due to the stupid security model in place).

In IIS Manager, browse to your BlogEngine folder and right-click and then choose properties to display the properties dialog box.

Then click on the documents tab and check what documents are listed, you will probably find Default.aspx is not listed so click on Add and create Default.aspx as a default document. Now it should appear in the list, select the Default.aspx document and then click on the Up arrow until its at the top, this will tell IIS to look for Default.aspx first.

Now click on the HTTP Headers tab, you should see Custom HTTP Headers box, it should have something like X-Powered-By: ASP.NET. Click on the button labelled File Types and check if anything is in there, it will probably be blank (you may need to add the mime type in here later on if its still complaining).

Click OK to save the changes and then restart your IIS server, now try browsing the BlogEngine directory, it should attempt to load up the Default.aspx page.

If your still getting the error then let me know, in the mean time I will get my Vista Virtual Machine running and see if I can replicate the issue.

Adios,

Fz
Jun 16, 2007 at 5:27 AM
HTTP Error 404.3 - Not Found

Description: The page you are requesting cannot be served because of the Multipurpose Internet Mail Extensions (MIME) map policy that is configured on the Web server. The page you requested has a file name extension that is not recognized, and is not allowed.

Error Code: 0x80070032

When you install IIS in Vista it doesn't install everything you might expect it to by default. Double check you have ASP.NET installed: Control Panel -> Programs -> Windows Features -> Internet Information Services (IIS) -> World Wide Web Services ->Application Development Features
Jun 16, 2007 at 9:20 AM
Ho hum, I vaguely recall that .net was supposed to make things better, or easier or something. How many steps does it take to run a sumple web server with it on Vista... I don't know yet! The machine is running multiple staging servers, but they're all classic ASP so they tell me little about this.

I went back again to the IIS configuration (in the control panel/ windows features bit of Vista). I installed the web server from there originally I think (this machine was a replacement for an XP machine running the same handful of servers). Anyway, sure enough, not all the "application development" features were selected; in fact it's quite hard to select them all, but I did it and then restarted the thing.

That changed something... as my 403 changed to an internal server error (500). It even has some instructions, although it's not entirely clear what they mean. Here it is:

HTTP Error 500.0 - Internal Server Error
Description: This application is running in an application pool that uses the Integrated .NET mode. This is the preferred mode for running ASP.NET applications on the current and future version of IIS.

In this mode, the application should not specify ASP.NET module components in the <system.web>/<httpModules> configuration section. Instead, it should use the <system.webServer>/<modules> configuration section to load ASP.NET module components. You have the following options:
1) Migrate the application to work with the Integrated .NET mode (PREFERRED).
You can migrate the application configuration, including the contents of the <httpModules> configuration section, by using the following from a command line window (the window must be running as Administrator):

%systemroot%\system32\inetsrv\APPCMD.EXE migrate config "powder mountain/BlogEngine"

After you migrate your application, it will run in both Classic and Integrated .NET modes, as well as on downlevel platforms.

The other option is to migrate it to Classic ASP, which sounds like the wrong direction to me. They recommend (1) also.

Wonderful stuff.. you're in this dumbed-down IIS manager which looks like a child's colouring book, and then they send you back to the good old command window to do something like this. I will report back!

I'm not sure why I need to "migrate" anything. I'm doing this on a staging server; I doubt very much I can bugger about quite so much on the live (third-party-hosted) machine. Is this some difference between IIS7.0 and earlier versions I wonder (my hoster is on 6...).

I'll go and play with command lines...
Jun 16, 2007 at 9:25 AM
Edited Jun 16, 2007 at 9:39 AM
They must have had a barrel of laughs when they set this up. So you type in the command line (admin level) and that ccomes back with
Successfully migrated section "system.web/httpModules".
Successfully migrated section "system.web/httpHandlers".
Looking good, eh?

So I restart the server... and I'm back to error 404.3. Ok, I'll go and look at that some more. Maybe I should fire up visual studio, write a simple aspx page, and load that on a server here to see if I can get that going. At least then I know that it's just my own bad configuration which is the problem. This is pretty much an out of the box machine though (ok, it has the MS VVS stuuff on it, nothing fancy). First I'll google: there must be someone else out there who foolishly tried to run a web server on Vista...
Jun 16, 2007 at 9:51 AM
Edited Jun 16, 2007 at 10:14 AM
On, here is my IIS problem: http://dunnry.com/blog/IIS7And4043Error.aspx.

I did that odd thing and sure enough the handlers are pretty much all there... looks like a list of the files which I'd guess are in the "BlogEngine".

But although there's the old entry for "ASP Classic .asp", there's nothing for "Login.aspx" or ".aspx", which presumably is why it still barfs with the 404.3 when I try to display Login.aspx.

So I seem to have it half installed, but I need to figure out how to convince the server that aspx isn't a static file.... weird (well this is a default, standard config). It does now list Default.aspx as one of the default pages, not that I care much about that.

More googling I guess...
Jun 16, 2007 at 11:26 AM
Ok, I have it. I logged in, just about to change the default accounts...

In summary, reading back here, we have, for Windows Vista Business, standard configuration, nothing fancy. Obviously you have to install IIS 7.0 and the .net stuff and follow the instructions (which I'd already done...)

1) Security settings
The specific detail above is what I needed: I'll add it to the Wiki later. Setting the stuff is easy, you just need to know precisely what needs to be set.

2) Inherited handler settings
As per this link. http://dunnry.com/blog/IIS7And4043Error.aspx Deleting the default site seems to populate the handler settings down to the other sites.

3) HTTP Error 500.0 - Internal Server Error
This application is running in an application pool that uses the Integrated .NET mode. This is the preferred mode for running ASP.NET applications on the current and future version of IIS.
Open an admin command window and paste the garbage in there:
%systemroot%\system32\inetsrv\APPCMD.EXE migrate config "site_name/BlogEngine"

4) web.config
This one's a hoot. After following the instructions here, and fixing the above things, I was left with my 404.3 problem. Checking the "handler mappings" for this specific site, they weren't set up fully... but they were for the server, and also for all the other sites I have here... some adding, removing and deleting followed, until I discovered a little file called "web.config" in the root of this specific site. I didn't put it there explicitly, so I killed it and then it all worked, after another bash of (3).


Of course having hacked this stuff about I'm not sure what the "happy path" would actually be, but at least here is a set of specific problems and solutions... I hope they help someone else, and I'll "wiki" them in due course.

Thanks for your help. I plan to stage this through to live in a week or so onto a jolly old IIS6 server... I hope that will be less traumatic!

cheers
Jun 16, 2007 at 6:57 PM
Hey Philw, good to hear you finally got it sorted and I feel your pain ;)

Vista is not fun, its always difficult to transition from one way of doing things to another and Vista unfortunately doesn't make it any easier, in fact it breaks a few rules as you found.

From experience you shouldn't have any issues with IIS6, only thing to worry about is making sure the BlogEngine is enabled as an application and the obvious, making sure the permissions are correct; otherwise it works a treat and I have not had any issues with it so far.

Adios,

Fz