Now that you have gained familiarity with basic application deployment,
redeployment and reloading capabilities of the application server, you
can learn how to carry out common administrative tasks by performing the
following brief exercises.
Changing
the HTTP Listener Port Number
When you need to change the HTTP listener port number to avoid conflicts
with other servers, you can easily do so via the administrative console.
- Access the administrative console.
- Expand the HTTP Server and HTTP Listeners folders under
the application server instance.
- Click the listener named "http-listener-1".
- Change the port number to another value.
- Click Save.
- Select the instance node named "server1".
- Click Apply Changes. (No server restart is required).
- Using a browser, access the HTTP server on the newly specified port.
Adding a New HTTP Listener
Although the application server is initially configured with a single HTTP
listener, it is straightforward to add another listener. In the following
exercise you will create a new non-SSL HTTP listener.
- Access the administrative console.
- Expand HTTP Server
- Click HTTP Listeners
- Click New...
- Enter the following information:
Field |
Setting |
Name |
new-listener |
IP Address |
0.0.0.0
(listens on any interface) |
Port |
select a suitable port |
Return Server Name |
any valid host/interface name for
the machine |
- Click OK.
- Select the instance node named "server1".
- Click Apply Changes.
- Using a browser, access the HTTP server on both port numbers.
During server restart, notice the following messages in the server instance
event log:
INFO: HTTP3072: HTTP listener
http-listener-1 [http://kampfire:88] ready to accept requests
INFO: HTTP3072: HTTP listener new-listener [http://kampfire:89] ready
to accept requests
Adding a Virtual Server
In operational environments, it is common to configure a single HTTP
server to host content and web applications for multiple domains. For
example, the domains www.abc.com and www.xyz.com can be easily served
by separate virtual servers defined on the same HTTP server. The web traffic
served by a virtual server can be distinguished either by the interface
or port number over which HTTP traffic is received or by the domain name
on the incoming HTTP requests.
In this exercise you will use a newly defined HTTP listener to route
traffic to a new virtual server.
- Access the administrative console.
- Expand HTTP Server
- Following the steps above, create a new HTTP Listener that will be
associated with the new virtual server.
- Click Virtual Servers
- Click New...
- Enter the following information:
Field |
Setting |
ID |
new-virtual-server |
Hosts |
host name expected in the incoming URL (not important
in this example because a unique port is being associated with
this virtual server). |
MIME Types File |
mime1 |
HTTP Listeners |
select the appropriate HTTP listener(s) |
Access Log |
<domain_config_dir>/domain1/server1/logs/<access
log file name>
|
- Click OK
- Select the instance node named "server1".
- Click Apply Changes.
- Restart the server instance.
- Using a browser, access the HTTP listener port associated with the
new virtual server.
Adding a Server Instance
If you are a developer and need to define a separate "sandbox"
in which to experiment with either application server configurations, you
may need to define a new application server instance. For example, if you
need to upgrade to a new Java 2 SDK (JDK) version and would like to experiment
with the newer JDK in one environment yet maintain your stable configuration,
it might make sense for you to define a new application server instance.
- Access the administrative console.
- Select Application Server Instances.
- Click New...
- Enter a server instance name (e.g. "my-new-server") and
a port number for the initial HTTP Listener.
- Click OK
- Select the new server instance in the list of instances.
- Click Apply Changes.
- Click Start.
- Using a browser, access the HTTP listener port associated with the
new server instance.
Navigate to the domain1/
directory of your installation:
<domain_config_dir>/domain1/
Note the presence of a new directory representing your newly created
instance.
In the administrative console, under Application Server Instances,
note the presence of a new server instance node. Explore this new node
to see the default settings associated with the newly created application
server instance.
Creating an Administrative Domain
If you are using the application server that was installed as part of
a Solaris 9 installation, you already used the asadmin
CLI to create a new administrative domain. If this is the case, then proceed
to the final section, Summary and
Next Steps.
For all other situations, use the following instructions to create a
new domain named "mydomain", start the domain and access the
administrative server that manages this domain.
Since domain creation and deletion is available only through the asadmin
CLI, you must use the command line to create the new domain.
1. From the command line, execute the following command to create a new
administrative domain named "mydomain":
asadmin create-domain --adminport
9999 --adminuser admin --adminpassword password mydomain
Where the port number, user and password fields specify the initial
settings of the new administrative server defined for the domain.
Upon execution of this command, you should see the following message:
Created Domain mydomain successfully
If the name "domain1" has already been used, execute the
create-domain subcommand
again with another domain name. You can use periods and other characters
in your domain names. You could use your login user name as a qualifier
to help ensure that your domain name is unique. For example: ckamps.domain1.
Overriding
the Location of the Administrative Domain Configuration: To
override the default location of the newly created administrative
domains, use the --path
option of the create-domain
subcommand. Since the administrative domain configuration
will be written to this area, you must have write permissions to
the specified location.
asadmin create-domain
--path <domain_config_dir> --adminport 4848 --adminuser
admin --adminpassword password mydomain
In this example, a new directory named "mydomain" will
be created under the specified <domain_config_dir>.
|
2. Execute the list-domains
subcommand to display a list of all of the domains configured for the
application server installation. For example:
asadmin list-domains
domain1 [<domain_config_dir>/mydomain]
Where the value of <domain_config_dir>
represents either the default location for newly created administrative
domains or the value specified on the --path
option of the create-domain
subcommand.
3. Now start the new domain by executing:
asadmin start-domain --domain
mydomain
This command simply starts the administrative server of the newly created
domain.
4. Once the administrative server of the new domain has started, you
should be able to start the administrative console of the admin server
by using a browser to access the following URL:
http://localhost:9999
4. After you authenticate to the administrative server, use the administrative
console to create a new application server instance and then access its
HTTP port via a web browser.
To stop the domain, you can execute the following command:
asadmin stop-domain --domain
mydomain
Once you have completed these exercises, proceed to the final section,
Summary and Next Steps.
|