Practice Solution: Configuring the Administration Port
There is no solution to this practice. The new domain is only used in this one practice.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Practice 11-3: Creating a Virtual Host
Practice 11-3: Creating a Virtual Host
OverviewIn this practice, you will configure a virtual host and deploy an application to it.
Assumptions
You completed “Practice 11-1: Configuring a Network Channel.”
All servers are currently running.
Tasks
1. Access the WebLogic Server administration console from the gateway machine.
a. On your gateway machine’s desktop, double-click the Mozilla Firefox web browser icon.
b. In the web browser, enter the URL to the administration console:
http://host01.example.com:7001/console
c. On the console welcome page, enter the username as weblogic and the password as Welcome1. Then click the Login button.
2. Create a new virtual host.
a. In the Change Center, click Lock & Edit.
b. In the Domain Structure, expand Environment and select Virtual Hosts.
c. Click the New button.
d. Enter the Name of benefits.com. Click OK.
e. Select the name of the new virtual host, benefits.com.
f. Under Virtual Hosts Names enter:
benefits.com g. Click Save.
h. Click the Targets tab.
i. Select cluster1. Select Part of the cluster. Select server1.
j. Click Save.
k. In the Change Center, click Activate Changes.
3. Undeploy the benefits application.
a. In the Domain Structure, select Deployments.
b. Select the check box in front of the benefits application. Click the Stop button and select Force Stop Now. When asked to confirm, click Yes.
c. In the Change Center, click Lock & Edit.
d. Select the check box in front of the benefits application.
e. Click the Delete button. When asked to confirm, click Yes.
f. Activate the changes.
4. Deploy the benefits application to the new virtual host and start it.
a. In the Change Center, click Lock & Edit.
b. In the Domain Structure, select Deployments.
c. Click the Install button.
d. Navigate to host01.example.com/u01/domains/part1/wlsadmin/apps.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Practice 11-3: Creating a Virtual Host
e. Select the option button next to benefits.war and click Next.
f. Select Install this deployment as an application and click Next.
g. For the target, select the new virtual host, benefits.com. Click Next.
h. Leave all optional settings at their defaults. Click Next.
i. Select No, I will review the configuration later and click Finish.
j. Activate the changes.
k. Select the check box in front of the benefits application.
l. Click Start. Select Servicing all requests. When asked to confirm, click Yes.
m. Minimize the web browser.
5. Add benefits.com to the hosts file on the gateway machine.
a. Open a new Terminal window on the gateway machine. (There is a Terminal icon on the desktop.)
b. Navigate to the /etc directory.
$> cd /etc c. List the hosts file.
$> ls hosts –l
-rw-r—r-- 1 root root ... hosts Note: Notice that the file belongs to the root user.
d. Log in as root. The password is oracle.
$> su root Password:
e. Edit the hosts file.
root> vi hosts
Note: This machine does not have the simple gedit text editor.
f. Find the line with host01.example.com. Move the cursor to the end of that line with the arrow keys. Click the a key for “append” mode. Add some spaces and then
benefits.com to the end of that line. Press Esc. When you are finished, it will look like this:
198.168.100.1 host01.example.com host01 benefits.com Note: The IP address will be different.
g. Save the file and exit the editor by pressing the keys :x and then Enter.
h. View the file to ensure that line is what you want it to be:
$> cat hosts ...
198.168.100.1 host01.example.com host01 benefits.com ...
$>
Note: The IP address will be different.
i. Close the Terminal window.
6. Add benefits.com to the URLs that should not be proxied by the web browser.
a. On your gateway machine’s desktop, double-click the Mozilla Firefox web browser icon.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Practice 11-3: Creating a Virtual Host
b. In the menu, select Edit > Preferences.
c. Click the Advanced tab.
d. Click the Network subtab.
e. Under Connection, click the Settings button.
f. Notice that Manual proxy configuration is selected. Click in the No proxy for field.
Move the cursor to the end of the field. Type in a comma, followed by benefits.com:
,benefits.com
Note: Do not change anything else in this field.
g. Click OK.
h. Click Close.
i. Close the web browser.
7. Access the application through the virtual host.
a. Open the web browser again.
b. Enter this URL to access the application:
http://benefits.com:7011/benefits c. Try the application.
8. Use the admin console to remove the application from the virtual host. Deploy it to the cluster.
Note: You will have no need for the virtual host later, but will be using the cluster.
a. Access the admin console from the gateway machine’s web browser. (URL:
http://host01.example.com:7001/console, Username: weblogic, Password:
Welcome1.)
b. In the Change Center, click Lock & Edit.
c. In the Domain Structure, select Deployments.
d. Select the check box in front of the benefits application. Click the Stop button and select Force Stop Now. When asked to confirm, click Yes.
e. Select the check box in front of the benefits application. Click the Delete button. When asked to confirm, click Yes.
f. Activate the changes.
g. Lock the configuration again.
h. Click the Install button.
i. Select the benefits.war application (under
host01.example.com/u01/domains/part1/wlsadmin/apps). Click Next.
j. Click Next again.
k. Select cluster1. Ensure that All servers in the cluster is selected. Click Next.
l. Click Finish.
m. Activate the changes.
n. Select the check box in front of the benefits application. Click Start and select Servicing all requests. When asked to confirm, click Yes.
o. Close the web browser.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.