Learn HTML : Getting started Part 2

Tuesday, February 10th, 2009 | Learn HTML

This is Part 2 of our Learning HTML set of articles. In this article we will learn how to setup a Virtual directory and run our html pages properly. It does not matter if you dont have IIS installed or are not allowed to have it, reading this article will help you when it comes to understanding how html pages are used on the web.

So in the first session we created our first , very simple HTML file. Once it was saved to our hard disk we double clicked it and it loaded up inside our browser. It would have looked something like this.

My First HTML Page

My First HTML Page

As mentioned before, this is an ok way to view your html page, but if we had some script in our file it may not run correctly like this so we realy need to understand how we can run it in our browser correctly. To do this we need to create a Virtual Directory in Internet Information Services ( IIS ) .  So how can this be done, firstly we have to open up IIS. If it is on your machine you will see the following in the administrator tools on your server or desktop. If it is not there, check with your IT team and see if they will let you install it. You can tell them at this stage you dont need the SMTP or the FTP bits, just IIS.

IIS Icon

IIS Icon

When you have opened up IIS it will look like,

IIS Open

IIS Open

So now we have it open we need to create a virtual directory so we need to expand websites , followed by a right mouse click on Default Website, then click “New” followed by “Virtual Directory”

New Virtual Directory

New Virtual Directory

 Then you will see the Virtual Directory Wizard

Wizard

Wizard

Click Next and enter an alias. The alias name is the name that we are going to see in our URL for example in this url http://localhost/MySite the word “Localhost” is the name of the machine or server and is a standard way of referencing the machine you are working on. The word “MySite” is the alias name and is the word used to help distinguish the site from others that we may have on our server.

 

Specify Alias

Specify Alias

Click Next and enter the directory path. The Directory path is the path that we save our HTML files in on our machine. So in our case that was “c:\LearnHTML”

Specify Directory

Specify Directory

Click Next. The Access Permissions screen is all about how users access your pages, we will take the default which means that people will be able to read them, and if we have any Active Server Pages ( ASP )  they will be allowed to run also.

Access Permissions

Access Permissions

Click Next and then Finish

Finish

Finish

And we will end up with a Virtual Directory in IIS

MySite Virtual Directory

MySite Virtual Directory

Now that we have done this we can run our html files correctly as if they where on the internet and any scripts that we have inside them will execute. Open up your browser and then type in the following,

http://localhost/[YourAliasNameGoesHere]/MyFirstPage.html

and you will see, if you have done everything correct, your web page, running as wep pages should be run.

Final Page in Browser

Final Page in Browser

No comments yet.

Leave a comment

Categories

Blog Counts

Search

Archives

PHP Notice: A feed could not be found at http://twitter.com/statuses/friends_timeline/16449757.rss in F:\hshome\anncoona\smarterdimensions.com\Blog\wp-content\plugins\external-rss-reader\inc\simplepie.inc on line 1780