Wednesday 15 August 2012

Change hostname of weblogic server

If you change the host name of the server that runs your weblogic server, then connecting to a page in the weblogic server (/console, /em, etc) may cause page load errors.
When installing the weblogic server, it registers the current hostname as the name of the server in the domain config. It will do a URL-rewrite to that hostname when connecting to a webapplications.

To change the weblogic-hostname, go to config folder of the domain home and edit the config.xml.
under //server/web-server/frontend-host you find the host that is used for the url rewrite. Edit it according to your hostname settings:
<?xml version='1.0' encoding='UTF-8'?>
<domain xmlns="http://xmlns.oracle.com/weblogic/domain" xmlns:sec="http://xmlns.oracle.com/weblogic/security" xmlns:wls="http://xmlns.oracle.com/weblogic/security/wls" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/weblogic/security/xacml http://xmlns.oracle.com/weblogic/security/xacml/1.0/xacml.xsd http://xmlns.oracle.com/weblogic/security/providers/passwordvalidator http://xmlns.oracle.com/weblogic/security/providers/passwordvalidator/1.0/passwordvalidator.xsd http://xmlns.oracle.com/weblogic/domain http://xmlns.oracle.com/weblogic/1.0/domain.xsd http://xmlns.oracle.com/weblogic/security http://xmlns.oracle.com/weblogic/1.0/security.xsd http://xmlns.oracle.com/weblogic/security/wls http://xmlns.oracle.com/weblogic/security/wls/1.0/wls.xsd">
  <name>fmw_domain</name>
  <domain-version>10.3.5.0</domain-version>
...
  <server>
    <name>AdminServer</name>
 ...  
    <listen-port>7001</listen-port>
    <listen-port-enabled>true</listen-port-enabled>
    <web-server>
      <!--<frontend-host>old-host</frontend-host>-->
      <frontend-host>fmwhost-vm</frontend-host>

2 comments :

Anonymous said...

There is no "frontend-host" entry in the xml file. It is in wlserver i believe

Anonymous said...

This maybe the case when FrontEnd host hasn't been set yet. If it is set, it will be saved in the config.xml.