Solved

bind to specific IP address -upd

  • 9 December 2021
  • 6 replies
  • 250 views

Userlevel 2
Badge +2

I wish to use IP aliases on my server, and only bind to a specific one.

Currently IFS binds to 0.0.0.0:PORT, is there a way to configure binding to IP:Port (ideally from resolving a hostname, but could be static)?

 

icon

Best answer by Charith Epitawatta 10 December 2021, 15:20

View original

This topic has been closed for comments

6 replies

Userlevel 7
Badge +31

Hi @donbowman,

If I have understood your question correctly, you can specify the IP address or hostname from IFS MWS Admin Console like this in IFSAPP10:

By default the listen address is left empty and an empty listen address means the server binds to all available IP addresses. 

Have a look at the “Configuring Listen Address” section in following document from Oracle as well regarding setting a listen address and it’s implications:

https://docs.oracle.com/cd/E13222_01/wls/docs81/ConsoleHelp/servers.html#1153607

In IFSAPP9 and IFSAPP8, you need to do this from the installer. 

Hope this helps!

Userlevel 2
Badge +2

Thanks very much. In IFSAPP9, how would I update it after the fact w/o reinstalling?

Userlevel 7
Badge +31

Hi @donbowman,

I don’t actually remember if you can change the listen address via a reconfiguration. That would be the first thing to try though and see if you are allowed to change it. If I remember correct, you should be allowed to change the listen address in IFSAPP9 from the installer. 

If it doesn’t allow you to do it via a reconfiguration, following would be your options.

  1. If you have access to Oracle Weblogic Console, you can do it directly from there. However this change would not be reflected in Configuration XML file in IFS, so it would be better to document the change somewhere for your own benefit that this change was done. Furthermore, when you do a reconfiguration or install a delivery, there’s a risk of changes done from Weblogic Console getting overwritten. So you may have to check it after every delivery installation/reconfiguration.
  2. Create a new Managed Server with listen address specified and delete the old one later - this is a fairly easy option, especially if you don’t have a horizontal cluster.  You can do this from the installer. If you have a horizontal cluster, then you would have to recreate the cluster too.
  3. Delete the instance and recreate it using the delete option in the installer - this would erase the whole Welogic domain and create a new one. Take a copy of the Configuration XML file before deleting the instance so that you can refer to it when recreating the new instance. 

Please take backups before attempting something like this, so if something goes wrong, you can fallback. Also you can try this in a non production environment first. 

Hope this helps!

Userlevel 2
Badge +2

Your instructions seem to work for IFS MainServer1 and IntServer1 but we cannot start wlsconsole for AdminServer or modify the Listen-Address in the IFS Admin Console. Can you provide any pointers?

 

 

Userlevel 7
Badge +31

Hi @donbowman,

I don’t think you can do the same for the Admin Server. I looked at \\<IFS_HOME>\wls_domain\<InstanceID>\config\config.xml which is the main config file in Weblogic, but it appears there is no way to do this for Admin Server. 

Badge +1

@Charith Epitawatta I looked into the config.xml and didn’t see anything. 
 

It seems /repository/installer/templates/httpd/ files generate an apache config with the variables that exist in build.properties.

In mws_log which appears to be from at install time, I can see logs like:
FINE: Replacing in …..  \templates\httpd\mod_mws_ohs_ssl.conf: @OHS_LISTEN_ADDRESS --> ${ifs.system.host}

And in mod_mws_ohs_ssl.conf you can see the variables @OHS_LISTEN_ADDRESS for the apache name virtual host configuration but the listen directive is only
“Listen @OHS_LISTEN_PORT”

Is it possible to edit these template files after the install and somehow re-run/re-generate the Apache/OWS configuration?

I suspect /if/ mod_mws_ohs_ssl.conf was edited from
Listen @OHS_LISTEN_PORT
to
Listen 10.x.x.x:@OHS_LISTEN_PORT
or 
Listen @OHS_LISTEN_ADDRESS:@OHS_LISTEN_PORT
and the configuration was regenerated from the templates, it should then only bind to the specific address as desired.

I tried reconfigure/restart - that didn’t seem to do it.

Without that listen directive being modified, I suspect that the httpd process will always attempt to bind to all addresses on @OHS_LISTEN_PORT