I’ve some good news for you!
After researching the server-configuration I found the way how the web-fronted is working. So I also found the way to configure an IP binding for the OH web-services.
Here a short summary for you:
1. Edit your etc/jetty.xml
Search for this part:
<!-- =========================================================== -->
<!-- Set connectors -->
<!-- =========================================================== -->
<Call name="addConnector">
<Arg>
<New class="org.eclipse.jetty.server.nio.SelectChannelConnector">
<Set name="port"><Property name="jetty.port" /></Set>
<Set name="maxIdleTime">300000</Set>
<Set name="Acceptors">2</Set>
<Set name="statsOn">false</Set>
<Set name="lowResourcesConnections">20000</Set>
<Set name="lowResourcesMaxIdleTime">5000</Set>
<Set name="forwarded">true</Set>
</New>
</Arg>
</Call>
and add the “host”-Line as followed:
<!-- =========================================================== -->
<!-- Set connectors -->
<!-- =========================================================== -->
<Call name="addConnector">
<Arg>
<New class="org.eclipse.jetty.server.nio.SelectChannelConnector">
<Set name="port"><Property name="jetty.port" /></Set>
<Set name="host"><Property name="jetty.host" /></Set>
<Set name="maxIdleTime">300000</Set>
<Set name="Acceptors">2</Set>
<Set name="statsOn">false</Set>
<Set name="lowResourcesConnections">20000</Set>
<Set name="lowResourcesMaxIdleTime">5000</Set>
<Set name="forwarded">true</Set>
</New>
</Arg>
</Call>
Do the same in the Sector for SSL. Just add the same “host”-Line under the “port”-Line. After that it should look like this:
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- To add a HTTPS SSL connector -->
<!-- mixin jetty-ssl.xml: -->
<!-- java -jar start.jar etc/jetty.xml etc/jetty-ssl.xml -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<Call name="addConnector">
<Arg>
<New class="org.eclipse.jetty.server.ssl.SslSelectChannelConnector">
<!-- prevent poodle attack see also https://groups.google.com/d/msg/scmmanager/sX_Ydy-wAPA/-Dvs5i7RHtQJ -->
<Arg>
<New class="org.eclipse.jetty.http.ssl.SslContextFactory">
<Set name="ExcludeProtocols">
<Array type="java.lang.String">
<Item>SSLv3</Item>
</Array>
</Set>
</New>
</Arg>
<Set name="port"><Property name="jetty.port.ssl" /></Set>
<Set name="host"><Property name="jetty.host" /></Set>
<Set name="maxIdleTime">30000</Set>
<Set name="Acceptors">2</Set>
<Set name="AcceptQueueSize">100</Set>
<Set name="Keystore"><SystemProperty name="jetty.config" default="." />/etc/keystore</Set>
<Set name="Password">OBF:1mpj1ci31jqi1jv81chf1mtj</Set>
<Set name="KeyPassword">OBF:1mpj1ci31jqi1jv81chf1mtj</Set>
</New>
</Arg>
</Call>
2. Edit your /etc/default/openhab.conf
Add this two lines changing <IP>
through the IP you want to bind OH.
# set ip for HTTP(S) server
HOST=<IP>
3. Edit your /etc/init.d/openhab
Add -Djetty.host=$HOST
to your java-command so that it looks like this:
java -Dosgi.clean=true -Declipse.ignoreApp=true -Dosgi.noShutdown=true -Djetty.port=$HTTP_PORT -Djetty.host=$HOST -Djetty.port.ssl=$HTTPS_PORT -Djetty.home=. -Dlogback.configurationFile=configurations/logback.xml -Dfelix.fileinstall.dir=addons -Djava.library.path=lib -Djava.security.auth.login.config=./etc/login.conf -Dorg.quartz.properties=./etc/quartz.properties -Dequinox.ds.block_timeout=240000 -Dequinox.scr.waitTimeOnBlock=60000 -Djava.awt.headless=true -jar $cp -console &> /dev/null
4. Restart / Reboot
Restart the service or the host itself. Attention! This is only working if you start/stop OH with the init.d-Script, not with start.sh!
Please give it a try. If you need assistance, don’t hesitate to contact me.