Sun GlassFish Enterprise Server 2.1

# Quick Start for Basic Features

Welcome to the Quick Start Guide. This guide describes basic steps for using Application Server.

Note - For the latest version of this document, see the Sun GlassFishTM Enterprise Server 2.1 Quick Start Guide posted at docs.sun.com. The posted version of this document contains additional instructions for advanced features, such as clusters and load balancing.

Before using the procedures in this document you must have already installed the Application Server software.

The steps are presented in the order that you should complete them. This section contains the following topics:

- Application Server Administration Tools

- Default Administration Values

- Variable Names and Default Paths

- Starting the Server
- Adding Cluster Support to a Domain

- Where to Go Next

## Application Server Administration Tools

To enable administrators to manage server instances and clusters running on multiple hosts, Application Server provides these tools:

- The Admin Console, a browser-based graphical user interface (GUI)

- The asadmin utility, a command-line tool

These tools connect to a server called the Domain Administration Server, a specially designated Application Server instance that intermediates in all administrative tasks. The Domain Administration Server (DAS) provides a single secure interface for validating and executing administrative commands regardless of which interface is used. A domain is a collection of configuration data, deployed applications, and machines with a designated administrator. The domain definition describes and can control the operation of several applications, stand-alone application server instances, and clusters, potentially spread over multiple machines. When the DAS is installed, a default domain called domain1 is always installed.

## Default Administration Values

Domain name | domain1
--- | ---
Instance name | server
Admin user | admin
Admin password | adminadmin
Master passsword | changeit
Admin port | 4848
Instance (HTTP) port | 8080
HTTPS port | 8181
IMQ port | 7676
ORB port | 3700

##

## Variable Names and Default Paths

The following table describes what the variable names and default paths are for the directories used in this guide. Variable names are in the first column, and default paths are in the second column.

Variable Name | Description and Path
--- | ---

install-dir

By default, the Application Server installation directory is located here:

- Solaris Java Enterprise System installations: `/opt/SUNWappserver/appserver`

- Linux Java Enterprise System installations: `/opt/sun/appserver/`

- Windows Java Enterprise System installations: SystemDrive`:\Sun\ApplicationServer`

- Solaris and Linux stand-alone Application Server installations, non-root user: user_home_directory`/SUNWappserver`

- Solaris and Linux stand-alone Application Server installations, root user: `/opt/SUNWappserver`

- Windows stand-alone installations: SystemDrive`:\Sun\AppServer`

domain_root_dir

By default, the directory containing all domains is located here:

- Solaris Java Enterprise System installations: `/var/opt/SUNWappserver/domains/`

- Linux Java Enterprise System installations: `/var/opt/sun/appserver/domains/`

- All other installations: install-dir`/domains/`

domain_dir | By default, domain directories are located here: domain_root_dir `/`domain_dir

## Starting the Server

This topic provides instructions for the following basic tasks: starting the Domain Administration Server (DAS), logging into the Admin Console, and examining the log files. The steps are presented in the order that you should complete them.

### To Start the Domain on Solaris and Linux

To start the Domain Administration Server, start the default domain, `domain1`.

1. Add the install-dir`/bin/` directory to the `PATH` environment variable.

2. Start the server by entering this command:

   `asadmin start-domain domain1`

   When you are prompted for the admin password and the master password, enter the passwords that you provided during installation.

   When the start up process has completed, the following message appears:

   `Domain domain1 started`

   Each domain has a corresponding profile: enterprise, cluster, or developer. `domain1` is created with the default profile, which is defined in the `AS_ADMIN_PROFILE` variable defined in the `asadminenv.conf` file. For more information on the three profiles see the Usage Profile section in Sun GlassFish Enterprise Server 2.1 Administration Guide. If `domain1` was created with developer profile, when you log in to the Admin Console, you cannot use features such as clustering and node agents. To use clusters and server instances, use the `create-domain` command to create a domain with cluster profile. For information on creating domains, type `asadmin create-domain` `––help`.

### To Start the Domain on Windows

To start the Domain Administration Server, start the default domain, `domain 1`.

1. From the Explorer window or desktop, right click My Computer.

2. Choose Properties to display the System Properties dialog.

3. Click the Advanced tab.

4. Click Environment Variables.

5. In the User variables section:

   - If a `PATH` variable exists, verify that install-dir`\bin` exists in the path: install-dir`\bin;`other_entries. If install-dir`\bin` does not exit in the PATH variable, add it.

   - If a `PATH` variable is not present, click New. In Variable Name, type `PATH`. In Variable Value, type the path to the server's `bin` directory: install-dir`\bin`. Click OK to commit the change.

6. Add a new environment variable `AS_ADMIN_USER` and set it to the Administrative User Name that you assigned during installation.

7. Click OK to commit the change and close the remaining open windows.

8. Start the Application Server by clicking the Start Admin Server option within the Programs menu.

9. When a command prompt window opens to prompt you for the admin password and the master password, enter the passwords that you provided during installation.

   A window appears with a message telling that you the server is starting:

   `Starting Domain domain1, please wait. Log redirected to domain_dir\domain1\logs\server.log...`

   When the startup process has completed, you see an additional message:

   `Domain domain1 started.Press any key to continue ...`

   Each domain has a corresponding profile: enterprise, cluster, or developer. `domain1` is created with the default profile, which is defined in the `AS_ADMIN_PROFILE` variable defined in the `asadminenv.conf` file. For more information on the three profiles, see the Usage Profile section in the Sun GlassFish Enterprise Server 2.1 Administration Guide. If `domain1` was created with developer profile, when you log in to the Admin Console, you cannot use features such as clustering and node agents. To use clusters and server instances, use the `create-domain` command to create a domain with cluster profile. For information on creating domains, type `asadmin create-domain` `––help`.

10. Press a key to close the message window.

### To Log In to the Admin Console

The Admin Console is a browser interface that simplifies a variety of administration and configuration tasks. It is commonly used to:

- Deploy and undeploy applications

- Enable, disable, and manage applications

- Configure resources and other server settings

- Configure clusters and node agents

- Manage server instances and clusters

- Select and view log files

- Configure load balancers

For further information about using the Admin Console, consult the Application Server online help.

1. Type this URL in your browser:

   `http://` localhost`:4848
   `

   If the browser is on a different system than the server, replace the localhost variable with the name of the system that the Domain Admin Server is running on.

   `4848` is the Admin Console's default port number. If you changed the port number during the installation, use that number instead.
   If you have installed the cluster profile, the admin port is secure, by default. For cluster profile, the URL for Admin Console is `https://` localhost`:4848`.

   Note - If a popup window appears with a message such as `Website Certified by an Unknown Authority`, click OK.

   This message appears because your browser does not recognize the self-signed certificate that the Domain Administration Server uses to service the Admin Console over the secure transmission protocol.

2. When the log in window appears, enter the admin user name and password.

3. Click Login.

### To View the Domain Administration Server Log File

Application Server instances and the Domain Administration Server produce annotated logs on the file system. By default, all errors, warnings or useful informative messages are logged.

1. From the Common Tasks list in the right pane, click Search Log Files to launch a new browser window for Log Viewer.

2. In the Log Viewer window, select "server" from the Instance Name drop-down list and click Search.

   The Domain Administration Server's recent log file entries are displayed.

3. Scan the messages and look for any `WARNING` or `SEVERE` messages indicating that problems were encountered during server startup.

   You can close Log Viewer at any time. After you create clusters and deploy applications, examine log files if any of the operations failed. Use Log Viewer to view the log files of any running Application Server instance in the domain.

   For more information about the log file, see the Configuring Logging chapter in Sun GlassFish Enterprise Server 2.1 Administration Guide.

### Adding Cluster Support to a Domain

You can use the Admin Console add cluster support to a developer domain.

1. Log on to the Admin Console.

2. From the left pane, click Application Server.

3. Click the Add Cluster Support button in the General tab.

4. The Add Cluster Support page appears. Review the information on this page and click OK.

5. In the Restart Required Page, click the Stop Instance button to stop the domain.

6. Log in to the machine where the domain is installed and run the following command: `install-dir/bin/asadmin` `list-domains`. Verify that the domain was stopped.

7. Run the following command: `install-dir/bin/asadmin` `start-domain <domain-name>`

   The restarted domain supports clustering.

## Where to Go Next

The next steps of the Quick Start Guide are available in the following chapters.

These chapters are available only in the Sun GlassFish Enterprise Server 2.1 Quick Start Guide posted on docs.sun.com.

- Chapter 2: Setting Up a Cluster
  Steps for creating a cluster.

- Chapter 3: Deploying An Application
  Deploy a sample application to a cluster.

- Chapter 4: Setting Up Load Balancing
  Steps for creating and using a load balancer. Requires installation of the load balancer plug-in and the Web Server.
- Chapter 5: Setting Up High Availability Failover
  Steps for setting high availability failover.

Other resources for learning about and using Application Server are available. They include:

- Product details at install-dir`/docs/about.html`.

  See this document for the latest information on what is new, and pointers to tutorials and other educational services.

- Sample applications at install-dir`/samples`

  See the sample applications for Application Server examples.

- Java EE 5 Tutorial

Copyright 1994-2008 Sun Microsystems