22 November 2009

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. 

Tagged:

10 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