I am temporarily setting up OH on a Mac Mini but it already runs other web applications so that 8080 and 80 are not available. I can’t see how to change the port number. I found a post suggesting that it is in the startup.sh or jetty files but I’ve not seen it yet.
No, you just misunderstood my answer. The link is an example for a manual installation method. It is not an answer to your initial question.
You need to search for a solution to change the port on the manual installation method.
Searched for 8080 string in all the files and there is a setenv command file which looks for envariable
OPENHAB_HTTP_PORT
However when I tried to set that in the startup script it did not seem to help.
Never mind - had plenty of debugging today with the raspberry pi option which crashes on shutdown when running of a SSD. Plain rasberrian stretch does not do this.
Maybe that will get sorted before this. I need to keep the other applications running on their existing ports for now.
OK - so can someone give me a hand getting openHab to run off alternative web ports please. I’m running on MacOs and I’ve tried setting the alternative port numbers as enviroment variables in the startup.sh file.
If this works, then you’ll need to find the correct environment to set. I’m not very familar with macos, but I believe globally applied environment variables can be set in /etc/launchd.conf
Adding this here to maybe help other new users (like myself).
Had the same problem on a Windows 8.1 machine. Could not get to the Web UI using http://localhost:8080. Realized/remembered that I have security camera software that uses that port – which I preferred to not have to change.
Could not find anywhere how to change the Openhab port on Windows. Here’s what finally worked (at least when running OpenHAB2 as a service):
Add the following two lines just below “set.default.OPENHAB_HOME=C:\OpenHab2”:
OPENHAB_HTTP_PORT=8085
OPENHAB_HTTPS_PORT=8443
The following may or may not be necessary (I have not yet confirmed if it is needed or not but I made this change it is working when run as a service):
Open/edit “C:\OpenHab2\runtime\bin\setenv.bat”
wrapper.java.additional.16=-Dorg.osgi.service.http.port=8080
change to:
wrapper.java.additional.16=-Dorg.osgi.service.http.port=8085
Then, follow setup/install instructions:
Using: “zulu8.28.0.1-jdk8.0.163-win_x64” (default installation is Program Files directory).
Have not done further testing but initially the above did not seem to work when running the start.bat script but did work when running as a service. Changing only the setenv.bat entry alone did not work by itself, which is why I concluded it may not be necessary at all to run s a service.