Page

1.3.2- Testing your Web Server

Created by Brendan Doss.
Last Updated by Brendan Doss.  

PublicCategorized as 01. Getting Started With ASP.

Not yet tagged
<< 1.3.1- Working with IIS 5.0Chapter11.3.3- Managing Directories on your Web Server >>

Testing your Web Server

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 test 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 universal resource locator (or URL) 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.

Identifiying your Web Server's Name

By default, IIS will take the name of your web server from the name of the computer. You can find this in the machine's network settings. On your 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:

 

Chapter1_image016

 

My machine has the name chrisu, and (as 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. Or 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. We will discuss this in more detail a bit further into this chapter.

Throughout this book, in the examples that require a web server name, we'll show the expression my_server_name whenever you need to insert your own web server's name. When you see this, you'll need to substitute your own server's name for my_server_name, rather than typing this expression in literally.

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 the 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

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:

 

Chapter1_image017

 

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.

 

Chapter1_image018

 

If you get this page then it means 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 (to reprise: 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:

 

Chapter1_image019

 

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, 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) and select the Connections tab. In IE5 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 and you are having problems then 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 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), 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.

<< 1.3.1- Working with IIS 5.0Chapter11.3.3- Managing Directories on your Web Server >>

Copyright © 2003 by Wiley Publishing, Inc.

Powered by Near-TimeTerms of Services | Privacy Policy | Security Policy |