Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a simple hello-world HTML file stored in my PC path: C:\Users\User_name\My Workspace\HelloWorld.html

If can open this in my Browser as file:///C:/Users/User_Name/My%20Workspace/HelloWorld.html

But I want to open the same from my browser, by something like this: http://127.0.0.1:51061/HelloWorld.html

Does anyone knows how to do this?

share|improve this question
add comment

1 Answer

Yes, its easy.

In Windows 7, do the following

  1. Go to Control Panel\Programs\Programs and Features
  2. In the left hand side, you will see Turn Windows Features on or off - click here.
  3. Look for Internet Information Services and expand that node. (see picture below for what I have checked under the IIS node)
  4. Make sure to check the Internet Information Services Hostable Web Core option (this is the actual web server)
  5. Click Ok when done.
  6. Now go to Start Menu > Administrative Tools > Internet Information Services (IIS Manager).
  7. Expand the node MachineName\Sites\Default Web Site
  8. Right click on Default Web Site and choose Add Virtual Directory
  9. Point your virtual directory to c:\users\username\My Workspace\
  10. Give this directory a name (this will be the folder you will put after h**p://yourmachine/folder) where folder = virtual directory alias.
  11. At this point you will need to turn on directory browsing or add HelloWorld.html to the default document list in IIS Manager. This is because your helloworld.html file is not a standard web document name so the webserver will not automatically know that you want it to be served. Alternativley, you could also rename helloworld.html to Default.html if you dont want to setup directory browsing or add helloworld.html to the default document list.

Let me know if that works!

Here is what mine looks like

enter image description here

share|improve this answer
    
If you want to change the port from :80 to something else, you will need to change the bindings in IIS Manager. To do that click on the Default Web Site node in IIS Manager and the context menu that shows up on the right should have a option for bindings. Change *:80 to *:12345 or whatever you want the port to be. –  Richie086 Jun 30 '13 at 21:43
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.