From: http://dev2dev.bea.com.cn/bbs/yuanch/ArticleShow.jsp? Id = 19
This article briefly introduces howConfigure the VM as follows:
Environment preparation
Configure a VM
Configure the default web application of the server
Configure Web applications for the VM
Configure the default web application of the VM
Environment preparation
Software Platform: Windows 2000 Professional + SP4, WebLogic Server 8.1 SP2
Machine preparation:
Machine name |
IP address |
Purpose |
Ericwang |
192.168.80.109 |
WebLogic Server |
Test |
192.168.80.110 |
Client used for testing |
WebLogic Domain Configuration:
Name |
Value |
Bea home |
C: Ea |
Domain type |
Basic WebLogic Server domain |
Domain location |
C: eauser_projectsdomainsmydomain |
Server Name |
Myserver |
Server listening address |
192.168.80.109 |
Server listening port |
7001 |
WebLogic configuration Startup Mode |
Development Mode |
Username of myserver |
WebLogic |
Myserver Password |
WebLogic |
Hosts file:
In the C: winntsystem32driversetc directory on the test machine, locate the hosts file and add the following two lines:
192.168.80.109 news.synnex-china.com
192.168.80.109 tech.synnex-china.com
Configure a VM
Method 1 (via console)
In the left-side navigation pane of the console, choose mydomain-> services-> virtualhosts, and click Configure a new virtual host... on the right. Under the General tab of configuration, enter:
Name: News
Virtual host names: news.synnex-china.com
Click "Apply", go to the target and deploy tab, select myserver, and click "Apply". In this way, the virtual host named "news" is successfully created.
Method 2 (using weblogic. Admin)
1. Create a virtual host named "news,
Java weblogic. Admin-URL T3: // 192.168.80.109: 7001-username Weblogic-Password WebLogic create-name news-type virtualhost
2. Set virtualhostnames for the VM news
Java weblogic. Admin-URL T3: // 192.168.80.109: 7001-username Weblogic-Password WebLogic set-mbean "mydomain: Name = News, type = virtualhost"-property virtualhostnames news.synnex-china.com
3. Add the news department of the VM to WebLogic
Java weblogic. admin-URL T3: // 192.168.80.109: 7001-username Weblogic-Password WebLogic set-mbean "mydomain: Name = News, type = virtualhost"-property targets "mydomain: Name = myserver, type = server"
Either of the above methods can be used to create a virtual host named Tech, its virtual host names is a tech.synnex-china.com, and the virtual host tech is deployed on the WebLogic Server.
After the configuration is complete, restart the WebLogic Server.
Configure ServerDefault webApplication
1. Refer to eDocs (http://edocs.bea.com/wls/docs81/index.html) in 8.1 and add:
<Context-root>/</context-root>
2. Package webapps into the webapps. War file, and post them to the WebLogic Server. After the deployment is successful, the console displays the following:
Figure 1 Welcome picture after the webapps. War file is successfully deployed
3. access through a browser on the test server through http: // 192.168.80.109: 7001. The following screen is displayed, indicating that the default web application of the server is successfully configured.
Figure 2 WebLogic Server default web application Screen
Configure the WebApplication
1. Package news into a news. War file and post it to the news virtual host on the WebLogic Server. After successful, the following information is displayed:
Figure 3 Welcome picture after the news. War file is successfully deployed
2, on the test machine, access through the browser, http://news.synnex-china.com: 7001/news, the following screen appears, indicating that the configuration of the virtual host web application is successful.
Figure 4 Web application screen of VM news
Configure the default webApplication
1. Refer to the eDocs (http://edocs.bea.com/wls/docs81/config_xml/VirtualHost.html#DefaultWebApp) of wls8.1 to add the WEB-INF/weblogic. xml below the tech directory:
<Context-root>/</context-root>
Then, deploy the service on the tech VM on the WebLogic Server. The result is as follows:
Figure 5 failure of deploying default web applications on the virtual host TECH 1
Figure 6 failure of deploying the default web application on the virtual host TECH 2
This indicates that only one conext-root web application can exist in a WebLogic Server. At this time, if you delete the webapps Web applications deployed on the WebLogic Server, the default web applications deployed on the virtual host tech can be successfully deployed. However, this is not my intention. In this way, only one VM can have a default web application among multiple VM instances.
In this case, how do I configure the default web applications for multiple virtual hosts?
After carefully analyzing the composition of the config. xml file elements, I decided to set the default web application for the web host of wls8.1 in a way compatible with wls7.x.
First remove the contxt-root entry for the WEB-INF/weblogic. xml under the tech directory, then redeploy the tech application, and finally close the WebLogic Server. Manually modify the config. xml file as follows:
<Virtualhost name = "tech" targets = "myserver"Defaultwebapp = "tech"Virtualhostnames = "tech.synnex-china.com"/>
After saving config. XML, start WebLogic Server.
2, in the test machine, access through the browser, http://tech.synnex-china.com: 7001/, the following screen appears, indicating that the default web application configuration of the VM is successful.
Figure 7 default web application screen of VM tech
Postscript
1. A WebLogic Server can have only one web application whose context is.
2. In wls8.1, the weblogic. Admin tool cannot be used to set the default web application of the VM. For example:
Java weblogic. Admin-URL T3: // 192.168.80.109: 7001-username Weblogic-Password WebLogic get-mbean "mydomain: Name = synnex-China, type = virtualhost"-property defaultwebapp synnex
It can be seen that the defawebwebapp option has been gradually eliminated by Bea.
3. You can use the weblogic. Admin Tool to view the properties of the virtual host whose name is news.
Java weblogic. Admin-adminurl 192.168.80.109: 7001-username Weblogic-Password WebLogic query-pattern *: Name = News ,*