I have an apache2 server running on a Raspberry Pi with Buster, version 10. It forwards port 80 to port 443 for https connections. Works great. I am trying to add Nagios to this server. I have installed it and (obviously incorrectly) configured it. When I run:
jordan@megabyte:~ $ sudo apache2ctl -S
Here is my output:
VirtualHost configuration:
*:443 mydomain.com (/etc/apache2/sites-enabled/default-ssl.conf:2)
*:8080 megabyte.mydomain.com (/etc/apache2/sites-enabled/nagios4.conf:1)
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex ssl-stapling: using_defaults
Mutex ssl-cache: using_defaults
Mutex default: dir="/var/run/apache2/" mechanism=default
Mutex mpm-accept: using_defaults
Mutex authdigest-opaque: using_defaults
Mutex watchdog-callback: using_defaults
Mutex rewrite-map: using_defaults
Mutex ssl-stapling-refresh: using_defaults
Mutex authdigest-client: using_defaults
PidFile: "/var/run/apache2/apache2.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
Define: ENABLE_USR_LIB_CGI_BIN
User: name="www-data" id=33
Group: name="www-data" id=33
To me, it looks like Nagios should be listening on port 8080 (as planned) but when I do
jordan@megabyte:~ $ nc -l -p 8080
It does not error out, suggesting that nothing is listening on port 8080. And:
jordan@megabyte:/etc/apache2 $ sudo netstat -nltp | grep 8080
returns nothing, confirming the first test (after killing the nc) I have tried restarting apache and even rebooting. I'd be glad to post any requested files, I just don't know which ones are relevant anymore.
So, the URL for nagios is:
http://hostname:8080/nagios4
I was missing the 4
also, I added Listen directives right before the VirtualHost directives:
listen 8080
<VirtualHost *:8080>
That got it working