Wednesday, September 18, 2013

Network Channels and Virtual Hosts In Weblogic

In this article we will see
what are network Channels
What are Virtual Hosts
how are they configured and how does a application is deployed in the Virtual Host

What is a Network Channel
A network channel is a resource that defines the attributes of a network connection to the web logic server. Each network channel is a unique combination of a port, a listen address, and a connection protocol (for example t3 or HTTPS). Each Web Logic Server instance has its own network channels for clients to use to communicate with the server.

Web logic comes with 2 network channels for each managed Server in a Domain. They are a
pre-configured default channel and a administration channel

They are many uses of using a custom channel, including the ability to separate different types of network traffic. Multiple custom channels also enable you to specify different connection protocols, such as secure and non-secure protocols, to meet the needs of different types of applications and their network traffic

What are Virtual Hosts
A virtual host is a set of host names to which Web Logic Server instances (servers) or clusters respond. When you use virtual hosting, you use DNS to specify one or more host names that map to the IP address of a server or cluster. You also specify which Web applications are served by each virtual host.

how are they configured and how does a application is deployed in the Virtual Host
In the first part , we will see how we can configure a Network Channel first.

Configuring a Network Channel
Log in to the admin-console → left pane → Domain Name → Environment → servers
Click Local & Edit
Go to 'desktop_server' → protocols → channels
Click on Lock & Edit
Click New

Enter following details for channel as below, 

Click Next , in the next screen enter the below details

Leave External Listen address and Leave External Listen Port blank
Click on 'Finish'
Save changes
Activate changes

Note: After this step you have created a network channel. That means your server
will listen at given listening address and port. Try accessing

Configuring a Virtual Host
Here are the Sequence of steps to follow for configuring the Virtual host

Go to admin-console → left pane → Domain Name → environment -> virtual hosts
Click lock & edit
Right pane :
Click on New
Enter Name 'myVHost'
save changes

Activate changes

Now Edit the Created Virtual Host Setting , enter the below details

Configure the targets for the Virtual host,

Now Edit the Created Virtual Host Setting , enter the below detail

Deploy application to virtual host

Go to admin-Console → left pane → Domain Name → deployments
Click lock & edit
Right pane:
Click on 'Install'
Click on "upload your files" link
Click "browse" (against 'deployment archive' )
select "myApp.war"
Click "Next"
Choose 'myApp.war ' in the "location" section
Choose "Install this deployment as an application" radio button
Click on "deployment targets" tab
select 'myVHost' -> Next -> Next -> Finish
Save changes
Activate changes

Create DNS entry in your hosts file
For linux hosts file is: /etc/hosts Append the following line to the file as super user.
Save the changes to 'hosts' file.

For Windows , the host file in C:\WINDOWS\system32\drivers\etc directory and add the host name which we have specified for the virtual host. Add the below in the file:

Access the application
Access the application on the virtuals host using the url that we configured inside the hosts file.

More to Come , Happy Learning :-)