Weblogic Virtual Host : Working with Virtual Hosts
When you use virtual hosting you use DNS to specify one or more host names that map to the IP address of a WebLogic Server instance or cluster, and you specify which Web Applications are served by the virtual host.
When used in a cluster, load balancing allows the most efficient use of your hardware, even if one of the DNS host names processes more requests than the others.
you can specify that a Web Application called
booksresponds to requests for the virtual host name
www.books.com, and that these requests are targeted to WebLogic Servers A,B and C, while a Web Application called
carsresponds to the virtual host name
www.autos.comand these requests are targeted to WebLogic Servers D and E.
To Create & Test a Virtual Host
Edit your hosts file and map your domain / DNS name to the server ip address.
Unix - /etc/hosts
Window - C:\WINDOWS\system32\drivers\etc\hosts
In Window entry should be like below -
127.0.0.1 localhost mukeshnegi.com
Create a virtual host, Click on Virtual Hosts, New, Enter name for virtual host.
Click on name of virtual host and in "Virtual Hosts Names" field enter your domain name like here, mukeshnegi.com, if you more then one domain name mapped enter each separated by comma
Click on target tab and select managed or admin server wherever you want to target,
5. Deploy your application on virtual host ( select deployment to deploy and target should be virtual host )
Create a channel
Click on managed or admin server on which you you targeted to virtual host, select channels under protocols on right hand side
Click on new
Enter channel name & select protocol http, select next
Enter port 80, select next
Select default options and click next
Select default option and click next
Click on finish
Now, you can see below lines in the server log file on which you targeted the virtual host -
<Oct 18, 2010 10:52:18 PM IST> <Notice> <Server> <BEA-002613> <Channel "Channel-
0" is now listening on 127.0.0.1:80 for protocols http.>
Now instead of http://<server>:<port>/your_apps_url, access it like http://mukeshnegi.com/your_apps_url
For example -
if you access your apps like http://localhost:7002