2

I'm trying to do a really simple task - setup a virtual directory in Windows Server 2008. This is what I am doing but it's not working for some reason:

  • Open IIS 7
  • Create a new virtual directory in Default Web Site and point it to a folder on d:\ drive
  • Browse to folder on d:\ drive and create an .htm file with some test text in it
  • Open a browser and navigate to http://localhost/TestSite/index.htm

But I get a 404 - what gives?

Edit:I didn't mention at first that this is Server 2008 R2

4
  • Double check that your browser is not set to go through a proxy. If it is, bypass the proxy for localhost.
    – Bork Blatt
    Jun 10, 2009 at 13:52
  • Can you browse to a htm file if you place it in the root of the site?
    – Sam Cogan
    Jun 10, 2009 at 14:55
  • no. that's what i've been trying to do all along. just get iis to serve me up one simple html page.
    – Tone
    Jun 10, 2009 at 23:46
  • Ok, so its not a problem with the virtual folder, but with IIS and the site.
    – Sam Cogan
    Jun 11, 2009 at 10:49

9 Answers 9

2

Did you set up correct permissions on the folder ?

IUSR and/or IIS_IUSRS should have at least read permissions.

3
  • Also, in the advanced settings of the virtual directory, check the Physical path, the virtual path and the Credentials Logon Type (should be ClearText by default)
    – Berzemus
    Jun 10, 2009 at 12:32
  • both users have been added with full permissions, the advanced settings you recommended to check all look correct.
    – Tone
    Jun 10, 2009 at 12:58
  • Don't forget ICACLS: adopenstatic.com/cs/blogs/ken/archive/2008/01/29/15759.aspx
    – bzlm
    Oct 8, 2009 at 20:48
2

I figured it out. I had installed Collabnet Subversion and it automatically setup something to handle the web client source control stuff. I uninstalled, rebooted and voila! Thanks to everyone for all your replies and suggestions.

1

In basic settings, click the "test settings" button and see what that says. I think I've had a similar problem and it was permissions related.

Try checking the "connect as" or check the identity of the app pool

4
  • ah ha! Getting closer.. Something is wrong with the passthrough authentication. I get this when I click Test setting: The server is configured to use pass-through authentication with a built-in account to access the specified physical path. However, IIS Manager cannot verify whether the built-in account has access....yadayada. I clicked Connect As and changed the user to the administrator account and the Test Settings works, but it still won't serve up a file. This is a stand alone machine (not on a domain). I also tried setting up a site in c:\inetput\wwwroot and get the same behavior
    – Tone
    Jun 11, 2009 at 1:17
  • Have you checked the application pool's identity? Are you getting a different message or the 404 still?
    – user8042
    Jun 11, 2009 at 13:05
  • i have 2 app pools setup - Classic .NET AppPool and DefaultAppPool. I've tried both and still get the 404. What exactly do you mean by checking the apppools identity?
    – Tone
    Jun 12, 2009 at 11:47
  • i found this in the event log dated this morning (just after a reboot): The World Wide Web Publishing Service (WWW Service) did not register the URL prefix http://*:80/TestSite for site 1. The site has been disabled. The data field contains the error number.
    – Tone
    Jun 12, 2009 at 11:55
0

You're file index.htm may be index.htm.txt if extension hiding is enabled at your system.

Greetz, GHad

3
  • Didn't think of that ^-^ Could be it, though.
    – Berzemus
    Jun 10, 2009 at 12:34
  • nope. no .txt on the end.
    – Tone
    Jun 10, 2009 at 12:52
  • Well, I tried... sorry I couldn't help
    – GHad
    Jun 10, 2009 at 13:03
0

Try just http://localhost/index.htm

Let's say I created a folder:

d:\Webs\TestSite
and put index.htm in that folder. Then I point the default web at that folder. I don't need to include "\TestSite" in the URL because that is the root folder of my web site.

I suspect this is the problem in your case.

2
  • no because i created a new website called TestSite under Default Web Site - thanks for the suggestion though.
    – Tone
    Jun 10, 2009 at 12:55
  • Whoops. I'll read the question more carefully next time.
    – Bork Blatt
    Jun 10, 2009 at 13:44
0

Is the name of the virtual directory really "TestSite" or is only the name of the filesystem folder on d: "TestSite" and you gave the virtual directory a different name?

It's very unlikely, but you could check this: is the file extension/mime type .htm allowed? Maybe somebody very restrictive removed it from the allowed extension from the default web? Try to put a .txt or a .html file in that directory.

UPDATE:

Another possible reason which same to my mind: the default web hasn't the "blank" host header or is restricted to a single IP address which is not 127.0.0.1. Or the default http port (80) was changed to some other value.

2
  • Both the virtual directory and the physical path are named TestSite. If i open the .htm file directly from the folder then it opens fine in a browser. I added 2 more files as you suggested just to see if that worked, and alas, it did not. This is a new install of Server 2008. and I've setup websites a hundred times before this. It's probably something really simple I'm just overlooking... Thanks for the suggestions.
    – Tone
    Jun 10, 2009 at 14:17
  • i should clarify that - I've setup websites a hundred times before on other servers.
    – Tone
    Jun 10, 2009 at 14:18
0

try http://yourcomputername/testsite/index.htm

0
0

Are you able to browse to http://localhost/ succesfully?

If you turn on directory browsing for TestSite, can you browse to http://localhost/TestSite/ successfully?

A 404 error is very clear cut. It's file can not be found, so it's something in the configuration. I'd suggest blowing it away and giving it a 2nd shot.

0

I successfully have a site working on server 08 R2 (SP1) running localhost. Have you checked under sites the bindings are correct? I.E. for default web site, should look something like: localhost on *:80 (http) or localhost on *:8080 (http), if you have checked this, then might I suggest changing the port from 80 to E.G. 8080 or something other than the HTTP ports - like 81 or 8181, this may help, but if you want 'outside' users to access your site you'll need to configure the Firewall (should already be configured for port 80 - but if you've changed it like suggested, you'll need to create a new rule for that specific port - and you may also need to configure an exception for that port in your modem or setup routing so that your modem will route that port back to your server.

I'd guess this could be the issue, or the other problem could be that somewhere on/in your server there is another program/application that has taken over port 80 and not allowing 'HTTP access' but is unlikely (as I'd guess this is a fresh or somewhat fresh server install).

I should've mentioned this before - the log that you supplied (The World Wide Web Publishing Service (WWW Service) did not register the URL prefix http://*:80/TestSite for site 1) indicate that the prefix *:80/TestSite indicates to me that the binding is incorrect. You may need to enter 127.0.0.1 to access your site unless you edit the binding and change to localhost (should be default but then again servers can go nuts ;)).

After checking this I'd imagine your issue should/could be resolved :).

I know I may not be making too much sense here, but this is from experience when setting up mine :), but I still have some bugs to fix :(, as mine is 'internet facing' ^^ with www.domainname.com :|.

Anyway, I'll leave it here and hope after confirming these things your server starts 'playing nice' :)

Cheers, Hope my suggestions have helped.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .