Creating a New Domain

Creating a new domain is done partly through the system console and partly through the operating system. Somewhat perversely, in order to start up the system console, you must already have a valid domain on your system. (This is one of the reasons you were encouraged to create a backup copy of the default domain.) So, as with most WebLogic tasks , the first step is get the server console up and running, using either the default domain, the PetStore example domain, or perhaps something else you've got lying around your site. Log in as the system user .

Once the console is up and running, right-click on the current domain as it appears in the left pane. It's the one with the icon of the globe just to the left of it. Select "Create or edit other domains" from the pop-up list that appears. The only property you need to fill out is the name of the domain. In deference to my publisher, I'm going to call my new domain PH-domain. You will see it frequently in examples throughout the rest of this book.

Notice that the domain you started with has been replaced in the left pane by the domain you just created. However, your new domain is not yet the Active Domain as displayed in the header of the right pane. In order to make the new domain the Active Domain, we need to stop and restart the server, and our configuration of the new domain is not yet far enough along for that to be possible.

Machine

It's not strictly necessary to instantiate a new machine before configuring the server that will run on it. However, it is arguably more logical to do so, and the process doesn't take long.

To create a new instance of the Machine class on your system, right-click on the Machines folder in the left pane. From the pop-up list, select "Configure a new machine" or "Configure a new Unix machine," as appropriate.

The only attribute immediately presented is the name of the machine. I suggest that you use the same name here as that which the machine uses for network name resolution. By clicking on the Node Manager tab that pops up after you click the "Create" button, it's also possible to do some configuration of the network identity of the new machine, but it's not strictly necessary to do so at this point.

Server

Before you can do anything substantial with the new domain, you will need to create an Administration Server within that domain. To do so, make sure that the new domain is still showing up next to the globe icon in the left pane, and click on the Servers folder. Again, don't worry that the server is still showing your original domain as the Active Domain in the right panethis is normal.

Because the domain is brand new, your only real option at this point is to "Configure a new server." The first property of the new server is the name. I'm going to call the server that will run on this machine "NT4-server."

You need to fill out four fields:

Name

The name of the new server.

Machine

Pick the machine you just created from the drop-down list.

Listen Port

The default value, 7001, should be appropriate for most circumstances.

Listen Address

The IP address or DNS name of the Administration Server.

Startup Scripts

The next part of the process is a wee bit delicate. Read all the directions before starting work, and be very careful to follow them exactly. Even very small errors can leave your server in an unbootable state. [1] Do not attempt to boot the new domain until you have completed every step in this process and double-checked your work.

[1] I made a little typo when modifying the script"PH-Domain" instead of "PH-domain". Well, I say 'little typo,' but there's not really any such thing when you're doing server configuration. However, I still maintain that the punishment was all out of proportion to the crime. When I tried to start the server with the new domain, it laughed in my face. Because I was running under NT, it was difficult to capture the error and figure out what went wrong. There was no real harm done, but it cost me an hour , and all the cussing frightened my dog. Consider yourself warned .

You need to copy over the startup scripts and modify them with a text editor. On Windows, these are:

 startWebLogic.cmd startManagedWebLogic.cmd 

and on Unix:

 startWebLogic.sh startManagedWebLogic.sh 

Once you have the files open , use your editor to do a search for the name of the default domain. Change all instances of the default domain to the name of the new domain you are creating. In most cases, the default domain is going to be called "mydomain," but recall that you had the option of setting it to something else when you did the install. If you don't see "mydomain" listed under the config directory, search your memory for the name of the default domain on your system.

Change 1: mydomain

Change the name of the default domain everywhere it appears to the name of the domain you just created. There should be three instances of the domain name in each of the start scripts. In my case, the new lines looked like the following:

 -Dweblogic.Domain=  PH-domain  cd config\  PH-domain  

and

 echo startWebLogic.cmd must be run from the config\  PH-domain  directory 

Change 2: -Dweblogic.Name

Next, locate the string "-Dweblogic.Name=" and change the value after the equals sign to be the name of the new server you created a minute ago. Just to be clear, you're typing in the name of the new server at this point, not the new domain. Remember to be very careful about typos when making this modification.

 -Dweblogic.Name=NT-server 

Finally, you need to copy the following files into your new domain directory. Assuming they worked in the default domain, they will require no modification and may be used as is.

 SerializedSystemIni.dat fileRealm.properties setEnv.cmd 

Boot the Domain

By default, the new domain and the old domain want to monitor the same IP port for incoming connections. Only one server process can bind to any given port at one time. This means that before you can start your new server, you're most likely going to have to stop your old domain first. Detailed instructions on how to start and stop the server can be found in Chapter 2, but to save you some page flipping I'll resummarize here:

In a Windows environment stopping the original server is usually going to be done in one of two ways:

Close the window in which the server process is running.

Stop the server process in the services tab of the Control Panel.

On Unix, either use <Ctrl>-C to kill the process in the window, or perhaps use the kill command to stop the process.

If you did everything right, you should be able to use the startWeb Logic script in your new domain directory.

 startWebLogic.cmd 

On Unix, it's

 startWebLogic.sh 

Now use your browser to connect to the server console of the new domain.



BEA WebLogic Server Administration Kit
BEA WebLogic Server Administration Kit (Prentice Hall PTR Advanced Web Development)
ISBN: 0130463868
EAN: 2147483647
Year: 2002
Pages: 134
Authors: Scott Hawkins

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net