Sunday, October 7, 2012

Working with IIS On your local Environment


IIS (Internet Information Services )
can be used to run a website in local computer. It is used especially for testing a web page or a web application locally before actually launching it. For this we have to configure our machine and IIS.
IIS comes by default with all the windows operating systems.

Installing IIS
For XP users
go to Control Panel>>Add or remove prorams>>Add or remove windows components
In the window that appears next select all the components that u require also select IIS. You might have to Insert the Windows Boot CD in most cases, do as it asks.
For Windows Vista users follow the same steps after logging in as admin.
& For Windows 7 users the process is bit more tedious so just refer refer http://www.iis.net you might video tutorials and articles as well. or Installing IIS on Windows 7

Opening IIS
1.)click  windows key + R>> type "inetmgr" without the quotes
for those who didn't understand simply try this
2.)Start>>run>>inetmgr
otherwise there is this routine way
3.)Start>>control panel>>Administrative Tools>>Internet Information Services


Web Page
Before Proceeding it is recommended that you select a web page on your PC to be tested. In case u don't have a Web page with you to test just type the below given code onto notepad and save as testpage.html  to a folder you can remember.

HTML Code Snippet


Configuring and Working with IIS
On the Left pane of IIS Expand the tree i.e. click all the  ( + ) symbols till u  get "Default Web Site" . Select Default Web Site icon and right click. Select the properties link on the right-click menu. In the opened window many tabs appear which have to be customized according to the task you are assigned to manage but all that are for advanced users. As of now we will just concentrate on hosting our site/page locally.
Properties Window
Go to the tab named Home Directory. Here the directory where our website files are stored is to be marked as home directory. By default IIS keeps c:\Inetpub\wwwroot as the home directory. This path can be changed to any other location of the computer. But it is suggested that u don't change this default directory. Instead we have a better option
 right click on Default Website>>New>>Virtual Directory
on the window that appears click next. Then u will have to put in an alias for the virtual directory, let's put it as "Test1". Browse to the HTML/Web page you have saved on your PC. Click on next. Now on access permissions screen select the check boxes-->>read, run scripts and browse. Click next  and Finish.

Done your local website has been loaded onto the IIS
now select the directory u just added select the web page right click and select browse.
Wait for the browser to load the page and here your page is running.
(In case it is not running, on the browser try replacing the address part where /localhost is written to /127.0.0.1)

No comments:

Post a Comment