Skip to main content

Howto Run Your HTML Static Website Locally In IIS On Windows PC

WHAT & WHY:

As a developer many time you may wish if you could run your static HTML website locally on your computer (Windows 7, Windows Vista, Windows XP, Windows 2008).

Although with Static website, you could easily download and double click the index.html or home.html file to open and run other pages. But this will not give you the real world senario. For example you will not able to use a path like /images/home-page-banner.jpg. You will have to use a relative paths like ../images/home-page-banner.jpg.

Following are very easy steps to do so. These steps are for Static HTML website. I will also post steps for more advance websites that uses ASP, ASP.NET, Dotnetnuke etc and uses database server.

 

WHAT YOU NEED:

1. IIS Server installed on your local machine

2. FTP username, password to download files form your FTP server

3. Administrative rights on local machine. Many task will display messages requesting Administrative privilege to run the task. 

 

STEPS:

1. Download files form Web Server

2. Installing IIS Server

3. Configuring website in IIS server, Add DNS in local Host file

3. Running the site

4. Troubleshooting

 

1. Downloading Files From Web Server

1. Download & Install an FTP Client. I like FileZilla which could be downloaded from http://sourceforge.net/projects/filezilla/

2. Open Filially & Site Manager using Menu File->Site Manager.

You will need FTP Host address, Username, password. You will need to login to your hosting account to find these 3 information or call customer service.

image

3. After entering about details click Connect. FTP will be connected and you will see few boxes in the FileZilla.

Top box for connection status and error messages

Left side box will display your computer files just like Windows Explorer while right side box will display your web server files.

image

Depending upon your hosting, you will find different folder naming. In Linux hosting you will find a folder name htdocs which will have all your files that runs the website. Html, images, css, JavaScript, document etc.

4. Create a folder in your local machine (lets say c:\LocalWebsite)

5. In the right side window, select all folder & files inside htdocs folder. You can do this by selecting htdocs in upper box (folder view) and then press CTL+A in the lower box (folder & files view)

6. Drag & Drop all the selected files from right side lower box to left side lower box. TAKE ALL PRECUATIONS during this step and DO NOT drop folders & files any ware else then the left side lower box. It will take few min to few hours depending upon the size of your files over web server.  

image

 

2. Installing IIS Server

 
Windows XP –>

1. Start –> Control Panel –> Click at Add or Remove Programs.
2. Click Add/Remove Windows Components. This will display The Windows Components Wizard.
3. Follow the Wizard to install IIS (Will post screenshot if needed. Let me know via comment)

 
Windows Vista, Windows 7 –>

1. Start –> Control Panel –> Click at Programs and Features

2. Click at Turn Windows feature on or off in the left side bar

3. This will display the Windows features screen. Select Internet Information Services, World Wide Web Services and few other checkboxes as shown in following screenshot. for the current task you don’t need most of them but I anyways shows you what I normally select.

image

 
Windows 2008, Windows 2008 R2

Follow the steps listed in my other post –> Windows Server 2008 - Add Role - Web Server IIS

 

Configuring website in IIS server, Add DNS in local Host file

 
Adding DNS in local Host file

1. Open Notepad using Run As Administrator Option and then open your local host file which is located at C:\Windows\System32\drivers\etc\hosts.

2. Enter the DNS entry for your local website and save. Following are some sample DNS names

127.0.0.1       local.laksha.net
127.0.0.1       www.lakshadev.net
127.0.0.1       www.localsite.com

image

Configure IIS – Windows Vista, Windows 7

1. Open IIS Server: Start –> Control Panel –> Administrative Tools –> Internet Information Services (IIS) Manager

2. In the IIS expand the left side tree –> select Sites –> Right Click –> New  Site. It will display Add Website screen. Enter the name you have added in the Host file

image

3. Click Ok

 

Running The Site

1. Open IE, Firefox Or Google Chrome

2. Type the DNS name that you enter in your local Host file and used when creating IIS website

3. Your website should comeup. You can make changes in files located at c:\localwebsite folder to try.

 

Troubleshooting:

image

Remember to open Notepad using Run As Administrator Option and then open your local host file. 

Comments

  1. This article aims to describe the differences between a static website and a content managed website using a content management system by describing the benefits and disadvantages to SME's (small and medium sized enterprises.) Online Marketing

    ReplyDelete
  2. Any web master would always want high traffic for his web site. After all, traffic can help build a community, increase sales, and increase web site conversion. As such, every web site owner practically does what it takes to get high traffic. Read More

    ReplyDelete
  3. Any web master would always want high traffic for his web site. After all, traffic can help build a community, increase sales, and increase web site conversion. As such, every web site owner practically does what it takes to get high traffic.

    ReplyDelete
  4. A great and important information you have shared with me as i love to use p.c and mostly essaytigers students review required PC and internet so these types of posts are very important for me so i really find your post very important because all the informative articles are very important and i really like to read them on daily basis.

    ReplyDelete
  5. Well, you should know that actions such as the ones mentioned above could be responsible for the damaging of your Windows registry.
    showboxdownloadsapp.com

    ReplyDelete
  6. Showbox is one of the best apps among all the others which provide streaming of movies and tv shows.
    The best part is, it is absolutely free for everyone and it also provides multiple resolutions of the videos.
    You can also watch the videos even when you are offline ShowBox for iOS

    ReplyDelete
  7. The more loan specialists you take a gander at, the more probable you are to locate a honest to goodness moneylender with a reasonable rate. Cash Advance

    ReplyDelete
  8. Before you apply for any payday credit, you ought to search out organizations that are positioned well and that are unguarded with the expenses and rates they charge. Avoid organizations who make it hard to discover the charges related with their advances. Continuously make a point to make your installments on time or to make plans previously in the event that you are not ready to make an installment. Check Cashing

    ReplyDelete

Post a Comment

Popular posts from this blog

SharePoint WebPart Error - Unable to add selected web part (s) – MOSS 2007

ISSUE: Recently I faced this issue that when I try to deploy my WebPart.  Unable to add selected web part(s).WebPartName: Cannon unregister UpdatePanel with ID ‘ctl00RTMPanel’ since it was not registerd with the ScripManager. This might occure if the UpdatePanel was removed from the control tree and later added again, which is not supported.
Parameter name: updatePanel.I faced this issue twice and both the time the issue was not what display here. This could be sure to any error in the WebPart. Following are list resolution from multiple instances.RESOLUTION: 1. Check the WebPartName.webpart file. Check whether you have a proper PublicKeyToken value. When I face the issue the value was PublicKeyToken=$PublicKeyToken$. If you have used WSP builder then in the Visual Studio you will find this file at \WebPartsProject\12\TEMPLATE\FEATURES\WebPartName\WebPartName.webpart. Sometime when you create a new WebPart using WSP builder then you do not get the correct value. The WebPartName.we…

How To Create Virtual Machine Using Existing vmdk file in VMWare Workstation

vmdk file is hard disk of the VMWare virtual machine. There are many scenarios where you may need to create a new virtual machine for an existing vmdk file. This is also an alternate Method to the “vmx is not a valid virtual machine configuration file – Could not open virtual machine” issue.Please refer to the previous post “Could not open virtual machine – vmx is not a valid virtual machine configuration file” for a full list of possible resolution. This post is to describe one of the solution in more details. How To Create a new virtual machine & attach the existing .vmdk file:1. Open VMware and select create a new virtual machine with custom (advanced) configuration option.2. Chose “I will install the operating system later”. and chose “I will install the operating system later”. 3. Select the operating system that matches the operating system in your existing .vldk file.4. Select a location of the new virtual machine5. Chose “Use an existing virtual disk”. This will allow yo…

My Grandparents – Grand Parents Day Essay Competition Winner

Vedic won the Grand Parents Day Essay Competition at HSCF New Age Sr. Group function. There were 27 participants in his category (Elementary School Category) and he won 1st price.Full list of winners are available at http://www.hindutempleorlando.org/new-age-group.

Video of Vedic reading his essay after winning:


My Grandparents – Grand Parents Day Essay Competition Winner from Laksha on Vimeo.

Below is the script of his Essay: My Grandparents I have three grandparents, my “dada ji, dadi ji and nani ji”. My grandparents live in India. Sometime I go to India and stay with them.

My dada ji is a homeopathic doctor. Whenever I get sick he gives me sweet medicine. I love my dada ji because my dada ji take me out for a walk and always play with me. And whenever we go for a walk my dada ji tells me stories.

My grand ma takes me to temple. She even played with me and made food for me.

My nani ji sing “Bhajans” everyday. She play with me and take me to the satsang.

I love my gr…