The NoMachine web server doesn't start on Ubuntu 20.04 after changing the ports
This problem occurs when changing listen ports for the NoMachine web server on Ubuntu 20.04. Ports can be changed manually or automatically by the installation procedure when the default ports used for web sessions (4080 and 4443) are already in use.
Steps to reproduce
1) edit the /usr/NX/etc/htd.cfg file and change ports from:
Listen 0.0.0.0:4080
Listen 0.0.0.0:4443 https
to for example:
Listen 0.0.0.0:80
Listen 0.0.0.0:443 https
2) Try to restart the NoMachine web server to make changes effective, the web server will not start any longer:
sudo /etc/NX/nxserver --start nxhtd
A possible workaround is to temporary change location of the nxhtd-error.log.
To do that, edit the /usr/NX/etc/htd.cfg file and change ErrorLog key from:
ErrorLog "/usr/NX/var/log/nxhtd-error.log"
to:
ErrorLog "/var/NX/nxhtd/.nx/nxhtd-error.log"
Then create the new log file and set correct permissions:
sudo touch /var/NX/nxhtd/.nx/nxhtd-error.log
sudo chown nxhtd:nxhtd /var/NX/nxhtd/.nx/nxhtd-error.log
sudo chmod 660 /var/NX/nxhtd/.nx/nxhtd-error.log
Note for NoMachine v. 6.10.12
The RewriteRule in the htd.cfg file contains a syntax error which prevents nxhtd from starting when the HTTPS port is changed as explained here: https://www.nomachine.com/TR12Q09492. This trouble report provides also the workaround.
SOLVED, Released in version 7.0.211
