mBerube.net
A journey to .Net

From IIS 6 to IIS 7.5 : not as easy as it looks

Sunday, 27 June 2010 15:23 by mBerube
(Also available in: français)

I wanted to do some changes to my blog engine yesterday. I took my production code which run perfectly at my hoster on IIS 6 and I put it on my dev server on IIS 7.5. Nothing worked ! Error 401 (authentication) on every pages, even with Accept Anonymous request enabled. After many tries and searches, here's what I did to make it work, hopping it could be usefull for some of you :

  • 1st, I've created the application and put it in the Classic .Net AppPool
  • I verified that the default document was default.aspx. It wasn't so I put it on the top of the list.
  • Then, I checked if the user of the appPool had the required rights on the files. It's a little bit harder to check with IIS 7 because every appPool has a custom user. The only thing to check is that the IIS_IUSRS group has the required rights on the folder and it was ok.
  • It still doesn't work. I then saw on a blog post that even if you gave Anonymous user access to the site, you still need to setup which user to use as ananymous. My error was there and as soon as I put the anonymous user credential to "Application Pool Identity", boom, everything worked perfectly.

There's one last problem with an easy workaround but I still not understand. When i use the url http://myservername/blog (with a lower case b), it doesn't work BUT with the url http://myserbername/Blog (with an upper case B), it works? The application name is "Blog" but I didn't think that IIS treat URL as case sensitive. I will continue to look for that and I will keep you in touch.

Thanks, happy developping.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Categories:   BlogEngine.NET
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRss comment feed

Access machine by hostname between Linux and Windows without DNS server

Wednesday, 23 June 2010 12:39 by mBerube
(Also available in: français)

During setup of my Dev server, I found that I was able to access my Linux server by IP but not by name. The same thing was true from Linux to Windows. After a couple searches on the net, I realized that my network wasn't using a DNS server. It means that the name solution was made by another mecanism. In my case, my machine names are resolved using Netbios. So, how to make it works on Linux (specifically Ubuntu but it's pretty much the same for the other distrib I guest) :

  • Install samba (sudo apt-get install samba)
  • Once install, edit /etc/samba/smb.conf and, in the global settings section, set the workgroup and netbios name values to the proper values for your machine.

Your now able to access your Linux box by name from Windows. Now, how to do the other way (from Linux to Windows) :

  • edit /etc/nsswitch.conf and change the line hosts: file dns by hosts: file wins dns (order matters)
  • Finally, install winbind (sudo apt-get install winbind)

After that everything works as expected, from Windows and Linux. I hope it will works for you as well.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Categories:   Programmer life
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRss comment feed