Installing WebSphere Application Server 3.02 Advanced Edition for Windows NT

Installing WebSphere Application Server 3.02 Advanced Edition for Windows NT using DB2 and IBM HTTP Server

This guide describes in simple terms how to install a single configuration of WebSphere Application Server Advanced Edition that uses--

This guide covers installing from the WebSphere Application Server CD as well as upgrading to Version 3.02 by running an executable downloaded from the product Web site at http://www.ibm.com/software/webservers/appserv/.

This guide does not describe how to migrate your files used for a previous version of WebSphere Application Server. For information on migrating files and for detailed information about the installation process, see the WebSphere Application Server Version 3.02 Advanced Edition Getting Started manual, which is accessible from the product Web site.


Contents

Prerequisites
Deciding which steps to follow
Installing IBM JDK n1.1.7p build level 0823
Installing IBM HTTP Server 1.3.6
Installing DB2 Universal Database (UDB)
Testing installation of prerequisites
Installing WebSphere Application Server
Testing your installation
Configuring an Enterprise Bean
Setting up TCP/IP for standalone operations


Prerequisites

Hardware

Operating system

Software

You may also need a text editor to edit files and a ZIP tool to unpack files.


Deciding which steps to follow

If your system already holds WebSphere Application Server and the correct levels of IBM JDK, IBM HTTP Server and DB2 UDB, proceed directly to "Installing WebSphere Application Server" and opt to upgrade your installation.

If your system does not already hold WebSphere Application Server, IBM JDK, IBM HTTP Server, and DB2 UDB, obtain the product CD for WebSphere Application Server or download the components listed in "Software" above from the Web. Then, do either of the following:

If your system is not connected to the network, also complete the steps in "Setting up TCP/IP for standalone operations".


Installing IBM JDK n1.1.7p build level 0823

Attention: Sun JDK 1.2 causes unexpected results if you install it before installing WebSphere Application Server 3.02 and IBM JDK 1.1.7. To prevent these results, uninstall Sun JDK 1.2 before installing WebSphere Application Server.

To install IBM JDK n1.1.7p, which you can obtain from an IBM Web site, do the following:

  1. Run the file ibm-jdk-n117p-win32-x86.exe.
    Install Shield dialog
  2. Select Yes, select Next, read the license agreement, and accept it.
  3. Leave the default selections and then select Next twice.
    Select Components panel
  4. Select Finish.

Installing IBM HTTP Server 1.3.6

To install IBM HTTP Server, which you can obtain from an IBM Web site, do the following:

  1. If you have the product CD, run \httpd\Setup.exe. If you have the downloaded file, run the program HTTPServer_ex.exe.
  2. Select the language and click OK.
  3. Click Next, read the license agreement, and accept it.
  4. Select the installation directory. The following example uses C:\http\.
    Choose Folder dialog
  5. Select Yes to create the directory. Then select Next.
  6. Select the Typical installation stream, click Next and then Next to accept the Program folder. The Information for Service Setup window displays:
    Information for Service Setup panel

    For the user ID and password, consider using a single Windows NT user ID and password for all of the WebSphere and support software packages--DB2, HTTP and WebSphere. Also consider using a user ID which has administrative rights, although this would not be recommended for a production system. Fill in the user ID and password here. If you need to create a new user ID and password, do it using the Windows NT User Manager. Note the comments in the README file; if this machine is a Domain Controller you need to perform an additional step as described in the README file.

  7. Click Install and finish the install package. Do not restart your computer at this time.
  8. Configure the HTTP Admin server password:
    1. Go to a command prompt for the c:\http directory, and enter:
      htpasswd -m conf\admin.passwd <userid>
    2. Type a password, and confirm it.
  9. Configure the ServerName of the Web server at this point. (Or, using the administration console of HTTP Server, configure the Web server at a later time.)
    1. Using a text editor such as Notepad, Editpad or WordPad, edit the file c:\http\conf\httpd.conf.
    2. Go to the line #ServerName new.host.name. Add below the line the domain name of your machine (your host name). If you don't know your host name, enter hostname at a command prompt.

      For example, if entering hostname at a command prompt returns smith, go to the line #ServerName new.host.name in the httpd.conf file and add ServerName smith below the line. The file now shows:

      #ServerName new.host.name ServerName smith
    3. Save the file.

If you need to install DB2 UDB, don't reboot yet. If you have already installed DB2 UDB, reboot your system and proceed to "Testing installation of prerequisites."


Installing DB2 Universal Database (UDB)

If you already have installed DB2 UDB Version 6.1 with fixpack 2 (or fixpack 1a if fixpack 2 is not available) or DB2 UDB Version 5.2 with fixpack 11 (or fixpack 10), then proceed to "Testing installation of prerequisites" or "Installing WebSphere Application Server".

Installing the base product

  1. If you have the WebSphere Application Server CD, run db2inst.exe in the \install subdirectory for the appropriate language. For example, for English look in the \nt\db2\en\install subdirectory.

    If you downloaded DB2 UDB, unzip the DB2 zip file to a temporary directory using an option that recreates the directory structure. Then, run the setup.exe file from the directory.

  2. Select Next, choose the Workgroup Edition, and then select Next.
  3. Put a check mark beside the Typical installation, keep the default installation directory (C:\SQLLIB), and click Next.
  4. Overwrite the default Username and Password with the same user ID you specified previously (if you installed IBM HTTP Server). This will make it the DB2 administration ID as well.
    Enter Username and Password panel
  5. Select Next, and continue with the installation.
  6. After the product installs, opt to restart your system.

Installing the DB2 UDB fixpack

If you installed DB2 UDB from the WebSphere Application Server CD and you are not using VisualAge for Java Version 3.0, proceed to "Testing installation of prerequisites". DB2 UDB fixpack 10 was installed when you installed the base UDB product.

If you did not install DB2 UDB from the WebSphere Application Server CD or are using VisualAge for Java Version 3.0, download the appropriate DB2 UDB fixpack from the product Web site. VisualAge for Java Version 3.0 requires fixpack 11. Otherwise, you may use fixpack 10 or 11.

Next, do the following:

  1. From the Services panel of the Control Panel, stop the services DB2 - DB2 and DB2 - DB2DAS00. If you have the Netfinity Support Manager or other monitoring agents you may need to stop these as well, since they can lock DB2.
  2. Unzip the fixpack file into a temporary directory. Delete the DB2 install directory if you wish.
  3. Run setup.exe from the fixpack temporary directory.
  4. Click Next, and then Next again. Select the check box to always start the DB2 instance. Consider selecting the check box to start the control center.
    Select Start Options panel
  5. Click Next. If needed, fill in your Username and password, and click Next again. Then, click Install.

When the installation finishes, restart your computer and login as the user you have been using to configure the software.

After your system restarts, the DB2 First Steps and Control Center dialogs may display. At this point, you may create the database sample used by the WebSphere Application Server samples. To create the database sample, click Create the SAMPLE database in the DB2 First Steps dialog and then click Yes in the confirmation dialog.

If you receive an error message stating that the database was not created, go to the Services dialog accessible from a Control Panel and ensure that the status for the DB2-DB2 service is Started. The startup type for the DB2-DB2 service should be Automatic and the hardware profile should be Enabled. Once you start the DB2-DB2 service, try creating the database sample again.

After you finish, close the DB2 dialogs.


Testing installation of prerequisites

  1. If you have installed some prerequisites and have not since restarted your computer, do so now.
  2. Start IBM HTTP Server. From the Start menu, select Programs -> IBM HTTP Server -> Start HTTP Server; or use a Services dialog, which is available from a Control Panel, to start the IBM HTTP Server.

    If the server does not start, check the README file in the IBM HTTP Server installation directory (c:\http for this guide) and take whatever appropriate action is noted in the README file.

  3. Open a browser and browse http://localhost/. You should see:
    IBM HTTP Server browser
  4. Select Configure server.
  5. When prompted, enter the username and password that you entered in the htpasswd command.
    Enter Network Password dialog

    When you enter these you should see the configuration page for the Web server.
    IBM Administration Server browser

  6. Use the basic settings to check the server name parameter you set earlier.

You have now tested and configured DB2 and HTTP Server. Also check that you have the right JDK installed and configured by starting a command prompt and typing:
java -fullversion

You should see the response
java full version "JDK 1.1.7 IBM build n117p-19990823 (JIT enabled: ibmjitc)

If you don't, check that c:\jdk1.1.7 (or whatever you specified for the IBM JDK directory) has been added to your path.


Installing WebSphere Application Server

To install WebSphere Application Server, do the following:

  1. If IBM HTTP Server or another Web server on your system is running, stop the Web server.
  2. Run the downloaded executable if you obtained Version 3.02 from the product Web site. Or, run \nt\setup.exe if you have the product CD.

    You will need 30-50Mb free in your temp directory (usually on the C drive), even if you are installing on another drive, because the installation shield package unpacks to the temp directory. This will kick off an installation shield package.

  3. If you installing from the product CD, select a language and click OK.
  4. Click Next to pass the introductory page.
  5. If you already have a JDK and database program installed, but do not have supported versions, a dialog opens informing you of the need to upgrade the prerequisite software. If this dialog is not shown, proceed to step 6.
  6. If WebSphere Application Server with the appropriate prerequisites is already installed on your system, a dialog giving you the option to upgrade WebSphere Application Server displays:
    Upgrade dialog

    You now have two options:

    If WebSphere Application Server is not already installed on your system, proceed to step 7.

  7. In the Install Options dialog, select Custom Installation and the installation directory; then click Next.
    Install Options dialog
  8. In the Choose Application Server Components dialog, select the following options:
  9. Click Next. If necessary, shut down all Web servers you plan to run with WebSphere Application Server and proceed.
  10. The system should find any level of IBM JDK that is installed. If you do note have the IBM JDK installed, click Install JDK 1.1.7. "Installing IBM HTTP Server 1.3.6" has information on installing IBM JDK.

    If you have other JDKs installed, make sure you select the IBM JDK, and click Next.
    Select Java Development Kit dialog

  11. You are now prompted with the Security/Database Options page, which configures the database access and user IDs. The database access is important to WebSphere Application Server, because the product stores the configuration of the server in a set of specially defined tables in the database.

    Note: If you use an invalid user ID to install WebSphere, it will not successfully register the WebSphere Administrative Server to the NT services database.

    Fill in the user ID, security password, and confirming password; and specify the user ID and password for the database. For the database values, if you have already installed DB2 UDB, ensure that you specify the Username and Password specified when installing DB2 UDB. Then click Next.
    Security/Database Options page

  12. Click Next again to begin the installation.
  13. Near the end of the installation, you are prompted for the location of the IBM HTTP Server configuration file. The installation tool should successfully find the file for you, so you should see:
    onfigure IBM HTTP Server dialog
  14. Click OK, and it will finish updating the files and installing.

    The next panel points you to the README and, if you are installing the samples, states where the samples have been installed and the server to use.
    Info on README, etc. dialog

    For the most recent version of the README or release notes, go to Library section of the product Web site at http://www.ibm.com/software/webservers/appserv/.

  15. Click Finish, and choose to restart.

Finishing prerequisite configuration

If you installed IBM HTTP Server or DB2 UDB as part of the WebSphere Application Server installation (that is, you did not install either prerequisite product before installing Application Server), you may need to configure them. See "Installing IBM HTTP Server 1.3.6" or "Installing DB2 Universal Database (UDB)" for details.

Further, if you installed DB2 UDB as part of the WebSphere Application Server installation, the installation program should create a database to store the administrative configuration when your system starts up after rebooting. The database definition is based on the JDBC URL you specified during installation; the steps in this guide use jdbc:db2:was for the JDBC URL. Thus, the installation program should create the WAS database with its DB2 application heap size set to 256.

To ensure that the WAS database exists, do the following:

  1. Go to the Control Center dialog. If it did not open automatically after rebooting, open it as follows: from the Start menu, select Programs -> DB2 for Windows NT -> Administrative Tools -> Control Center.
  2. In the DB2 Control Center, expand the tree under Systems. Your DB2 databases are listed under Databases. Examine the list to see if WAS is in it.

If you see WAS in the list, proceed to "Testing your installation".

If you do not see WAS listed, go to the Services dialog accessible from a Control Panel and set the startup for the DB2-DB2 service to Automatic. Also, ensure that the hardware profile for the DB2-DB2 service is enabled. Then, complete the steps in the next section, "Setting up administrative configuration." Optionally, for information about why the installation program did not create the WAS database, look at the wasdb2.log file.

Setting up administrative configuration

If the DB2 database WAS has not yet been created, do the following:

  1. From the Start menu, select Programs -> DB2 for Windows NT -> Command Line Processor.
  2. Enter CREATE DATABASE WAS
  3. Wait a minute to allow time for DB2 to create the database.
  4. Enter UPDATE DB CFG FOR WAS USING APPLHEAPSZ 256
  5. Type quit to leave the CLP, and then exit to finish the command prompt.
  6. Restart the machine.

If an application heap size of 256 doesn't work for your system, return to the DB2 Command Line Processor and change the application heap size to, for example, 512 using the command:

UPDATE DB CFG FOR WAS USING APPLHEAPSZ 512

Testing your installation

  1. If you have not rebooted since installing WebSphere Application Server or any of its prerequisites, do so now.
  2. Check that WebSphere administrative server has been registered in the Services dialog. Open the Control Panel and select Services. If you scroll down you should see IBM WS AdminServer.
  3. Start the service by selecting IBM WS AdminServer and then selecting Start.
    Services dialog

    Wait patiently. To see whether the system is still trying to start the server, examine the Performance page of the Task Manager.

    If the server is slow to start or does not start successfully, look at the last line in the \WebSphere\AppServer\logs\tracefile log. If the trace file says server is open for e-business, the server has started.

    Hint: You can control the server from a command line or batch file using the following commands:

    net start "IBM WS AdminServer" net stop "IBM WS AdminServer"

    Explaining the AdminServer: The AdminServer doesn't run any servlets, Java Server Pages, or Enterprise Beans. Each node can have multiple JVMs known as servers which run the application code. The Admin Server manages these servers, and if they stop, it restarts them. Each server can have EJB Containers to run EJBs, and a servlet engine to run servlets. Servers can either be independent, running different code, or clones which are identical, and the infrastructure manages spreading the incoming requests across the servers. A cluster consists of multiple nodes, each with clones.

    Although the installation has created a default server, it hasn't started it, so you can't run anything yet.

  4. To start the server, run the administrative console, which is how you manage WebSphere Application Server 3.0. From the Start menu, select Programs-> IBM WebSphere -> Application Server 3.0 -> Administrator's Console. This starts a new command shell, followed by a window showing the startup screen. You can minimize the Administrator's Console command shell, which states No remote host or port argument... As to the window, you should see something like this:
    WebSphere Console browser
  5. Wait until the little icon in the bottom left corner stops rotating. Then start to administer the server:
    1. The basic administrative console is split into three tabs: Tasks, Types, and Topology. Click on the Topology tab, and then click on the + sign next to WebSphere Administrative Domain to expand the view.
    2. Your host name should be listed. Expand the view of that node, and you should see an entry called Default Server. Expand that and you will see the default container and servletEngine.
      WebSphere Console browser
    3. If the Current State of DefaultServer is Stopped, click the green Start button on the tool bar. After an information dialog displays, stating that the server us running, click OK. Note that the current state changes from Stopped to Running.

      Once the server starts, it is marked in the configuration database that it should be running. If it stops, or if you reboot the machine, the administrative server will automatically restart it. Even if the administrative server fails, it will continue to run.

  6. Test the server. Ensure that the IBM HTTP Server is running. (The status for IBM HTTP Server in a Services dialog, which is accessible from a Control Panel, shows Started.) If the IBM HTTP Server is not running, use the Start option in a Services dialog to start the server, or select Start -> Programs -> IBM HTTP Server -> Start HTTP Server. Then, open a browser and go to http://localhost/servlet/snoop, which is a standard sample servlet installed by default. You should see a result like this:
    Snoops Servlet browser

The next step is to configure an Enterprise Bean and test the bean.


Configuring an Enterprise Bean

To test an Enterprise Bean inside WebSphere Application Server, configure one of the samples, and use a sample servlet to test it. The samples in general are documented, and can be located in the Programs -> IBM WebSphere -> Application Server V3.0 -> Samples choice of the Start menu.

This exercise uses the Enterprise Bean Increment. This bean is simply a counter.

Creating a database

If you have not done so already, create the database sample for use with Increment:

  1. From the Start menu, select Programs -> DB2 for Windows NT -> First Steps.
  2. In the DB2 First Steps dialog, select Create the SAMPLE database.
  3. In the dialog that opens, confirm the creation operation.

Setting up a DataSource

Increment is an Entity Bean, thus it requires a database to store the values of the bean. WebSphere Application Server 3.02 uses a concept from JDBC 2.0 to implement access to persistent stores such as databases, although Version 3.02 is not yet JDBC2.0 compliant. This is called a DataSource.

The DataSource is important for two reasons. First, it gives connection pooling to databases, so WebSphere can reuse database connections. Second, for BMP or session beans, it creates a model where the bean can ask the application server for a connection. This gives the application server the hook it needs to grab the XA resource manager handle so that it can become the transaction coordinator for the transaction. The way this works is by defining a JDBCDriver to the Application Server, then a particular database as a DataSource. This database is given a local name, which will be made available in the JNDI name space.

Servlets and BMP or Session Beans that want to access the DataSource can retrieve it using a JNDI lookup, and then get a standard JDBC connection from the DataSource. This is documented under Connection Pooling in the online help.

The DataSource is the object that applications will be configured to use. WebSphere Application Server 3.02 separates the DataSource from the JDBC driver. This is important, because you may want to reconfigure a DataSource to use an alternative driver (for example, one that supports two-phase commits for transactions).

To configure a DataSource:

  1. Go to the Types tab, right-click on JDBCDrivers, and then select Create.
    WebSphere Console browser
  2. For Name, enter DB2AppDriver and, for Implementation class, select COM.ibm.db2.jdbc.app.DB2Driver. Leave the URL prefix as jdbc:db2 and JTA Enabled as false. (JTA is the transaction API. DB2 6.1 FP1 provides a JTA enabled driver, but 5.2 does not.)
  3. Click Create and, after a dialog opens stating that the create command was successful, click OK.
    Information dialog
  4. Right-click on DataSources and select Create. In the Create a DataSource dialog, enter sampledb for Name and sample for Database name.
    Create DataSource dialog

    The first entry, Name, is used to create the JNDI directory entry for the database. For CMP Enterprise Beans such as the sample Increment, the server will automatically pick this up. For servlets and non-CMP beans, this will make a JNDI name of jdbc/sampledb. See the connection pool sample program for a programming example.

    The second entry, Database name, is the name of the database, and is concatenated with the URL prefix field (see above) to make the full JDBC URL of the database. The name in this example, sample, was created when you installed DB2.

    For the last field, Driver, the only choice is DB2AppDriver because it is the only JDBCDriver defined.

  5. Click on the Advanced tab. You will see the connection pool parameters, which control the performance of the pool.
    Create DataSource dialog

    The minimum and maximum connection pool sizes are clear.

    The Connection timeout (default 300 seconds = 5 minutes) means that if the pool reaches the maximum, new connections will wait this long for a new connection before timing out.

    The Idle timeout of 1800 seconds (30 minutes), means that if connections in the pool are unused for 30 minutes they will be closed down to the minimum.

    The Orphan timeout field indicates how long a connection can remain allocated before the server decides that the owner thread has died and the connection should be recovered.

  6. Accept the defaults by clicking on Create, and then OK. If you now click on the Topology view you should see the sampledb and DB2AppDriver objects:
    objects

    If you don't, try refreshing the view. Select WebSphere Admin Domain and click on the Refresh selected subtree button.

  7. Install the driver by right-clicking on the DB2AppDriver object and selecting Install.
  8. Select the node on which to install--in this case there will be only one--and then click Browse:
    Install Driver dialog
  9. Browse for the JDBC driver JAR/ZIP file which contains the JDBC driver for this database. For DB2 and the standard installation this is C:\SQLLIB\java\db2java.zip. Select the file, then click Open, Install, and OK.

Deploying and installing the Enterprise Bean

  1. In the administrative console and from the Topology view, make sure the node (your host), and Default Server is expanded. Right-click on the Default Container entry, and select Create -> EnterpriseBean.

    Note that the right-click behavior is different when the object is running. You must hold down the right mouse button while you browse the pop-up menu, and then let go on the selection you want to make. This prevents a random click from affecting the server.

    You are prompted with a dialog:
    dialog

  2. Click on Browse and navigate to C:\WebSphere\AppServer\deployableEJBs\ (or the directory where it is installed). You are browsing the server directories here, so even if you were using the console on a remote machine, this would be the server directory you see.

    Note: Each EJB-JAR file can contain more than one EJB. WebSphere Application Server Version 3.02 includes a EJB-JAR browser, and this example uses an individual bean to deploy.

    Select Increment.jar and double-click on it. You should see "inside" the JAR file now:
    dialog

  3. Double-click on the .ser file to select it. When prompted, select Yes:
    Confirm dialog

    A dialog stating that the Enterprise Bean is deploying briefly displays.
    dialog

    During this deployment process, the product generates the code to actually run the Enterprise Bean in the server. This includes code to persist the state (for an Entity Bean), manage transactions, and also the RMI-IIOP stubs and ties.

  4. When the system finishes deploying the Enterprise Bean, a dialog opens stating that the deployment was sucessful. Click OK and you will be presented with the Bean dialog again, but now with the fields filled in.
    dialog

    The Database Access field is set to Shared, which is equivalent to Option C locking/caching, and supports clustering. You can now look at the deployment descriptor by clicking the Edit button:
    Deployment Properties dialog

    Only the JNDI name and the environment variables are editable here. This is because updating other properties requires re-generating the code. To update other properties, edit the deployment descriptor using VisualAge for Java Enterprise Edition, or use the standalone EJB tool, jetace, which is included with WebSphere Application Server. Don't change any properties now.

  5. After you finish viewing the deployment descriptor, click OK to return to the first dialog, and select the DataSource tab. Click Change and, in the Datasource dialog, select the sampledb DataSource:
    DataSource dialog
  6. Click Ok.

    Because WebSphere is running under the user ID that has full rights to DB2, you can leave the user ID and password blank. Alternatively you can enter a valid user ID and password that has access to this database.

  7. Click on the Advanced tab. The following is displayed:
    dialog

    This defines the pool size for the bean. In general, WebSphere tries to optimize Enterprise Bean access by re-using existing beans where the semantics of the EJB specification allow it. Note that the maximum is not a hard maximum, but the maximum number of instances that will be held alive.

    The Find for update field specifies the locking behavior of the bean. It reduces deadlock when beans are updated. Normally, when a findByPrimaryKey is issued, WebSphere Application Server puts a shared lock on the database row and then, if the client updates the bean, WebSphere Application Server converts it to an exclusive lock. If two transactions run at the same time, deadlock occurs. If this is likely to happen, enabling Find for update causes the product to use an exclusive lock when the find is issued, avoiding deadlock.

  8. Click Create. The following dialog is displayed:
    Information dialog
  9. Click OK to clear the dialog.
  10. You can deploy a new Enterprise Bean into an already running container. To start the bean, select the Increment object, which is under Default Server and Default Container in the Topology view, and select the green Start button on the tool bar. Then, click OK to clear the dialog that Increment is running.

Testing the deployment

To test the deployment, go to the samples page:

  1. From the Start menu, select Programs -> IBM WebSphere -> Application Server 3.0 -> Samples.
  2. Click on Enterprise Beans in the left frame, and then choose Increment from the right frame.
  3. Select Run this sample, and you should see:
    Samples Gallery browser
  4. Click Visit, and the number of visits information should be displayed:
    Samples Gallery browser

    Click on Visit Again repeatedly, and the number will increase by one each time.

You have now installed and configured an EJB application.

Examining the database

To see what is going on in the database, start up the DB2 Command Line Processor:

  1. From the Start menu, select DB2 for Windows NT -> Command Line Processor.
  2. Enter connect to sample select * from ejb.incrementbeantbl

Data similar to the following is displayed:

db2 => connect to sample Database Connection Information Database server = DB2/NT 5.2.0 SQL authorization ID = MYID Local database alias = SAMPLE db2 => select * from ejb.incrementbeantbl COUNT PRIMARYKEY ------- --------------------- 5 count 1 record(s) selected. db2 =>

Setting up TCP/IP for standalone operations

If your system is not connected to a network, you must set up WebSphere Application Server for standalone operations.

To set up your system for standalone operations, you must have TCP/IP networking installed. If you will run WebSphere Application Server as a standalone (not connected to a network), your host name must remain fixed. WebSphere Application Server is a "networked" system that can be clustered into a single domain, with the administration and other aspects rely upon the IP networking. When the product starts for the first time, it records the host name. When it restarts, it needs to be able to contact that IP address again. If you wish to use WebSphere Application Server "disconnected", you must still always be able to "ping" your host name successfully.

If you need to set up a fixed IP address, go to the Network section of the Control Panel, in the Adapters tab, and install the MS Loopback Adapter.

Then, go to the Protocols tab, open TCP/IP properties, and specify a fixed TCP/IP address of 10.0.0.1 (which is an address reserved for private use and thus appropriate for standalone operations), and a subnet mask of 255.255.255.0.
Microsoft TCP/IP Properties panel

No default gateway for this adapter was specified. Go to the Bindings tab, select all protocols, expand TCP/IP Protocol, and then move the MS Loopback Adapter to the top of the TCP/IP Protocol list as shown below.
Network panel

Save the changes and reboot. After rebooting, you should be able to ping your host name whether or not you are connected to a network. To test your new TCP/IP setup, ping your host name while running standalone and, optionally, while connected to a network.