Everyone may have experience, and after deploying applications on WebLogic. Tap a pile of URLs when you are accessing. The most typical is as follows: http; // localhost: 7001 / Webapp / ..., etc. Willing to knock on the bleak port behind the domain name and add a bunch of paths. Moreover, how can people access my site through different domain names when the WebLogic is deployed? These are the problems we have to solve next.
Let us use a solution in the XX government e-government project as an example. First explain the environment: The database is used by Oracle. The web application is deployed in WebLogic, two web applications are to access the outside world through the domain name, one is the external network portal, the name is referred to as WWMH in the web application. One is an intranet portal, the name in the web application is referred to as NWMH. Suppose these two applications are in the same directory, their folders are the name of their web application, two domain names are www.xxxx.gov.cn and inner.xxxx.gov.cn.
Let's see the general process of domain name visits:
For example, an external machine input domain name accesses www.xxxx.gov.cn, this domain name is parsed into an IP address and some requested host information, which is found to find a DNS server. Through the IP set by DNs, the host where WebLogic is located, so you can access the application of the external network. For details, please refer to other information.
Several key configurations of the external network are as follows: The prerequisites here are that your web application has been deployed. First, you must change the List port port in Mydomain-> Servers-> MyServers to 80, the default is 7001. This way you don't need to type port when you visit the domain name, because the default is 80. However, only this is still not enough. At this time, if you access the domain name, you have to keep up with WWMH folder path behind the domain name, otherwise you will not be accessed. What we want now is the path to the Context root. Turn off the WWMH folder, replace it "/", so your default path is the root directory, the practice is to find the weblogic.xml file, plus
/
, Restart service, which can be accessed through the domain name.
If only one app is deployed, there is course no problem with such configuration access. However, multiple applications will be deployed on a WebLogic. Need to access different domain names, what should I do? For example, the intranet here, in the case of the external network, can't bear to change the previously configured results. In particular, the previous developers have been configured. We think of a function of WebLogic itself, that is to set the virtual host. Its think is to simulate the intranet application into another domain, and achieve the purpose of accessing the intranet through this domain name.
The specific configuration is as follows: In the left navigation bar of WebLogic's Console, select Mydomain -> Services-> VirtualHosts, then click Configure a New Virtual Host ..., under the Configuration's General tab, fill in: name: nwmh . Fill in Virtual Host Names: Inner.Weifang.gov.cn. Then click "Apply", then go to the Target and Deploy tab, select MyServer, click "Apply", so that the name of the NWMH is successful. Next, in the left navigation bar of WebLogic's Console, select Mydomain -> Deployments-> Web Application Modeules, in the application of DEPLOY NWMH, select NWMH in Virtual Hosts, click the Deploy button. Such a virtual host configuration is completed. However, if you want to access the intranet directly through the domain name or not. It has to keep up with the annoying path, such as inner.xxxx.gov/nwmh, but the default path has been occupied by the external network, if you add it in the online configuration file
/
The deployment is definitely unsuccessful. WebLogic will tell you that context root has been occupied. How to do? In fact, don't panic. The solution is as follows:
Plus on the private network portal configuration file
.
Repeason service, type the domain inner.xxxx.gov.cn. Everything is OK! problem solved. In this way, even if several applications, several applications in WebLogic can be resolved.
The above is merely the experience of individuals in the project. It does not guarantee its integrity and absolute correct.