Search - Articles
DevASP.NET for ASP.NET, VB.NET, XML and C# (C-Sharp) Developers Wednesday, February 08, 2012

Dev Articles
Search Directory
ASP.NET
VB.Net
C-Sharp
SQL Server
 

The Microsoft Management Console (MMC)

    The beauty of the MMC is that it provides a central interface for administrating all sorts of services that are installed on your machine. We can use it to administrate IIS – but in fact, when we use it to administrate other services the interface looks roughly the same. The MMC is provided as part of the Windows 2000 operating system – in fact, the MMC also comes with older Windows server operating systems.

The MMC itself is just a shell – on its own, it doesn't do much at all. If we want to use it to administer a service, we have to add a snap-in for that service. The good news is that IIS 5.x has its own snap-in. Whenever you need to administer IIS, you can simply call up the Internet Services Manager MMC console by selecting Start | Control Panel |Administrative Tools |Internet Services Manager.

Having opened the IIS snap-in within the MMC, you can perform all of your web management tasks from this window. The properties of the web site are accessible via the Default Web Site node. We'll be using the MMC more a little later in the chapter.

Testing the Installation
    The next thing to do is test the web server to see if it is working correctly, and serving pages as it should be. We've already noted that the web services should start as soon as IIS has been installed, and will restart every time you start your machine. In this section, we'll try that out.

In order to test the web server, we'll start up a browser and try to view some web pages that we know are already placed on the web server. In order to do that, we'll need to type a URL (Uniform Resource Locator) into the browser's Address box, as we often do when browsing on the Internet. The URL is an http://... web page address which indicates which web server to connect to, and the page we want to view.

What URL do we use in order to browse to our web server? If your web server and web browser are connected by a local area network, or if you're using a single machine for both web server and browser, then it should be enough to specify the name of the web server machine in the URL.

Identifying your Web Server's Name
    By default, IIS will take the name of your web server from the name of the computer. You can change this in the machine's network settings. If you haven't set one, then Windows will generate one automatically – note that this automatic name won't be terribly friendly; probably something  along the lines of "P77RTQ7881". To find the name of your own web server machine, select Start | Settings | Network and Dial-up Connections, and from the Advanced menu select Network Identification. The Network Identification tab will display your machine name under the description Full computer name:

My machine has the name chrisu, and (as you can see here, and in the earlier screenshot of the MMC dialog) my web server has adopted the same name. Browsing to pages on this machine across a local area network (or, indeed, from the same machine), I can use a URL that begins http://chrisu/…

There are a couple of alternatives if you're using the same machine as both web server and browser. Try http://127.0.0.1/… – here, 127.0.0.1 is the loopback address that causes requests to be sent to a web server on the local machine. Alternatively, try http://localhost/… – 'localhost' is an alias for the 127.0.0.1 address – you may need to check the LAN settings (in your browser's options) to ensure that local browsing is not through a proxy server.

Throughout the book, in any examples that require you to specify a web server name, the server name will be shown as localhost, implicitly assuming that your web server and browser are being run on the same machine. If they reside on different machines, then you simply need to substitute the computer name of the appropriate web server machine.

Browsing to a Page on your Web Server
    Now you know the name of your web server, and that web services are running; you can view some classic ASP pages hosted on your web server by browsing to them with your web browser. Let's test out this theory by viewing our default home page:

Try It Out – Testing the Web Service
  1. To verify that web services are working, start up your browser and type http://my_server_name/localstart.asp into the address box. (My server is named chrisu, so I typed in http://chrisu/localstart.asp.) Now press Enter; and (if all is well) you should get to see a page like this one:

    Note that the default page we see here uses the .asp extension, denoting a Classic ASP page. Support for ASP3 is provided as part of the standard IIS5.x web server program.

What do you do if this doesn't work?
    If you don't get this page, then take a look at the following steps as we try to resolve the problem. If it's not working correctly, then most likely you'll be greeted with this screen:

If you get this page then it can mean a lot of things, however one of the most likely problems is that your Web services are not switched on. To switch on Web services, you'll first need to start the IIS admin snap-in that we described earlier in the chapter (select Start | Run, type MMC and hit OK; then select Open from the MMC's Console menu and locate the iis.msc file from the dialog. Alternatively, just use the shortcut that you created there).

Now, click on the + of the root node in the left pane of the snap-in, to reveal the Default sites. Then right-click on Default Web Site, and select Start:

If it's still not working then here are a few more suggestions, which are based on particular aspects of your PC's setup. If you're running on a network and using a proxy server (a piece of software that manages connections from inside a firewall to the outside world – don't worry if you don't have one, they're mainly used by big businesses), there's a possibility that this can prevent your browser from accessing your web server. Most browsers will give you an opportunity to bypass the proxy server:

  • If you're using Internet Explorer, you need to go to View | Internet Options (IE4) or Tools | Internet Options (IE5/IE6) and select the Connections tab. In IE5/IE6 press the LAN Settings button and select Bypass the proxy server for local addresses. In IE4, this section forms part of the Connections dialog.

  • If you're using Netscape Navigator (either version 4.x or 6.x) and you are having problems then you need to turn off all proxies and make sure you are accessing the Internet directly. To do this, select Edit | Preferences; in the resulting dialog select Advanced | Proxies from the Category box on the left. Then on the right, select the Direct Connection to Internet option, and hit OK. Although you won't be browsing online to the Internet, it'll allow Netscape Navigator to recognize all variations of accessing local ASP.NET pages – such as http://127.0.0.1, http://localhost, etc.

You may hit a problem if your machine name is similar to that of some web site out there on the Internet – for example, if your machine name is jimmyd but there also happens to be a public web site out there called http://www.jimmyd.com. When you type http://jimmyd into your browser's address box, expecting to view a page on your local web server, you unexpectedly get transported to http://www.jimmyd.com instead. If this is happening to you, then you need to make sure that you're not using a proxy server in your browser settings – again, this can be disabled using the Internet Options | Connection dialog or the Edit | Preferences dialog.

Lastly, if your web server is running on your home machine with a modem, and you get an error message informing you that your web page is offline, this could in fact be a misperception on the part of the web server. This can be corrected by changing the way that your browser looks for pages. To do this, select View | Internet Options (IE4) or Tools | Internet Options (IE5/IE6), choose the Connections tab and select Never dial a connection.

Of course, you might encounter problems that aren't answered above. In this case, the chances are that it's related to your own particular system setup. We can't possibly cover all the different possible configurations here; but if you can't track down the problem, you may find some help at one of the web sites and newsgroups listed later in this chapter.

<<<<.....back Next .....>>>>
DevASP.Net - Disclaimer - Privacy
© 2002-2010 DevASP.net