Hosting a website is essentially inviting strangers to
poke around inside parts of your computer. While IIS prevents visitors to your
web page from spilling over into the rest of your data, many security
vulnerabilities exist in different versions of the program. To ensure maximum
protection, visit the Windows Update website and download any security
patches and updates that you may be missing.
Adding a website to IIS
Now that IIS is installed and
patched, it's time to add your website. Open up 'my computer' or Explorer and
navigate to your 'c:' drive. You should have a folder called 'inetpub'.
This is the folder where IIS expects all files for your
web and FTP sites to be by default. Open up 'inetpub' and then the 'wwwroot'
directory. This folder will hold the files for your first published website.
If you are creating a website from scratch, you
can do so now. You should call the initial page of your site (the home page)
'index.htm' when you save it, as that is the file name that IIS expects to see
as the primary HTML file. You can add all your HTML pages to the same WWWROOT
directory, or create new directories under WWWROOT (or elsewhere) for them. Best
practice is to place all files and directories (if needed) under WWWROOT.
If you have already created a website, rename the main
HTML file to 'index.html' and copy your files to the 'c:\inetpub\WWWROOT\'
directory. Since users coming to your website will not be able to move from the
'WWWROOT\' folder up to the Inetpub\ folder, the links to other webpages on your
site should not include the 'C:\Inetpub\WWWROOT\' prefix. For example, a link in
the index.html page to the secondpage.html file need only be of the form '<a
href="secondpage.html">', or '<a
href="https://www.yourdomainname.com/secondpage.html">'. If you had
incorrectly typed '<a href="C:\Inetpub\WWWROOT\secondpage.html">' as the link, that would generate an error as being an unresolvable
page.
Once your website files are created or copied into the WWWROOT folder, it's time to
test to see if it is all working correctly.
To do this, open up a web browser of your choice and type 'https://localhost/' in the address
bar.
There's your website, ready for prime time. Please note
that from your computer you can reach your website by using the
address 'https://localhost' or '127.0.0.1'. This does not mean that anyone on the internet can use these
two addresses to reach your website however - they are
only internally addressable to your PCs WWWROOT folder.