Monday, May 27, 2013

Hosting your First Website

 

If you are new to Web Development then hosting a website for the first time can be very exciting and challenging task. In this blog I’ll try to show a simplified approach to hosting your first dummy website.

1. For any website, the first basic thing that we need is a web page. To keep this example simple we’ll restrict ourselves to html pages. So lets do this exercise from scratch. Open a text editor like notepad/notepad++ .

image

2. Now lets prepare a basic HTML page.

I’ll skip on the non mandatory decorations and focus on the core tags to make it simple and easy to understand.

   1: <html>
   2: <head>My First HTML Page</head>
   3: <body>
   4: <p>Hope it works!!
   5: </p>
   6: <p> It'll definitely work</p>
   7: </body>
   8: </html>


image


3. Now save this file with html extension.


image


 



image


4. Now your HTML file is ready so let’s test it, by opening it up in browser.


image


5. Nice, so you have a basic HTML file with a custom name and its opening in browser.


6. Now open IIS by Navigating from Control Panel or by typing “inetmgr” at run.


image





7. Select Default Website and press Explore


image


8. It will open a Windows Explorer and you need to copy your HTML file to that location.


image



9. Select Default Document and double click or press Open Feature button


image


10. Now add the name of your HTML file in the Default Document so that whenever the website is opened your HTML file opens as default.


image


Once done, Select Default Web Site on Left side pane.


11. Now Press “ Browse” as shown below in Pic.


image


12. It should open your Webpage in Browser hosted via IIS, alternatively you can open a browser and type in “http://localhost:80” and access your webpage.


image


13. Congratulations, you have hosted your first web page.

Thursday, May 16, 2013

IIS Installation on Windows 7

A lot of time people come across a situation where they don't have IIS installed on their machines.
Assuming you have admin access to Control Panel and sufficient Installation rights the process becomes fairly easy.
1. Open Control Panel
image

2. Click on Programs
image
3. Select “Turn Windows features on or off”
image
wait for it to load…
image
Notice that “Internet Information Services” is highlighted, locate it and click on the “+” sign.
image
4. Once “IIS” node expands, select the options “Web Management Tools” and “World Wide Web Services” And press “OK”.
5. That’s all and IIS will be installed on your system.
6. Incase you want to use the FTP Sever features as well check on the FTP Server option as well. (It’s mainly for file transfer")

Friday, May 6, 2011

Removing Excessive Files from Application Pool


We keep on debugging our Web Applications with IIS, however over a period of time we have multiple web applications under the Default Application Pool. As a result we end with far too many applications pointing to an Application Pool than actually intended.
image
To resolve this, go to Sites, expand it and go to Default Web Site, and on the extreme right end you’ll see an option on View Applications, select it.
image
This wil give you complete list of Websites under Default Web Site, which are associated to various Application Pools.
Select them individually and delete it.

Monday, May 2, 2011

Configure IIS 5.1 to work with MVC 3.0

For IIS versions greater than 5.1 configuring MVC will be taken care by the installer itself, however for IIS 5.1 its a bit tricky.
After struggling for hours I was finally able to make MVC 3 work on IIS 5.1 on Windows XP SP3.
Here are the simple steps to make it work for you as well.
1. Open IIS using Control Panel->Administrative Tools -> Internet Information Services.


or open from Start->Run


2. Drill down to the MVC website virtual folder hosted on IIS.


3. Select the folder and right click and select the properties.


4. Open the Virtual Directory Tab and press the Configuration button under Application Settings



5. Locate the Extension .aspx and copy its executable path.


6. Under Application Configuration, go to Mappings Tab, and press Add


7. Paste the executable path as copied earlier in the Executable field
8. In Extension textbox, enter ".*"
9. Ensure that the Script Engine and Check if File Exists are unchecked.
10. You'll notice that the OK button is disabled, go back to the extension tab and alas, the OK button becomes active.
11. Press OK and exit
12. Restart IIS
13. Browse your MVC application
14. Congratulations you've finished hosting your MVC 3 Application in IIS 5.1

Error : Directory Listing Denied This Virtual Directory does not allow contents to be listed.

This is a common Error frequented by many of us when we try to configure the IIS to work for our websites. This error indicates that the IIS could not locate the intial load document of your website or web application. This is generally due to our oversight while configuring IIS.
By default, the following documents are listed in IIS.

  • Default.asp
  • Default.htm
  • index.htm
  • iisstart.asp
To fix this error, we need to follow the following steps.
1. Open IIS via Control Panel or by entering "inetmgr" at run(Start).
2. Open your Computer details(default local Computer)
3. Expand "Web Sites" -> "Default Web Site"
4. Locate your project folder under this and right-click and select properties
5. Locate the "Documents" tab under these properties.
6. Under the "Enable Default Document" section, press the ADD button.
7. In the new pop-up window enter the name of your startup document with its extension.(Login.aspx)
8. Select the newly added value in Default Document section and set it priority level by using the arrows on the left side on the window.
9. Press the OK button and refresh IIS.
10. Right click your project and select browse.

Congratulations, your website works.