I'm setting up monit on a new site, which I'll refer to as mywebsite.com during this question. I've set up the config to access monit's web interface page, but I can't connect to it. I've got a basic firewall running with iptables, and I think I've made a hole for monit, but I can't connect to monit's web interface, and I don't know why.
I haven't set up anything to monitor yet: my monit config looks like this:
## Start monit in the background (run as a daemon):
set daemon 120 # check services at 2-minute intervals
set httpd port 2812 and
use address mywebsite.com
allow localhost
allow admin:password
I've restarted monit with these rules.
I've made a rule for monit in my iptables config, which looks like this:
#monit interface
-A OUTPUT -p tcp --dport 2812 -j ACCEPT
-A INPUT -p tcp --dport 2812 -j ACCEPT
I've then imported these rules into /sbin/iptables-restore
. I can see the monit entry when I do sudo /sbin/iptables -L
:
...
ACCEPT tcp -- anywhere anywhere tcp dpt:2812
...
But, when I go to http://mywebsite.com:2812
i get Error code: ERR_EMPTY_RESPONSE
in the browser.
Any ideas, anyone? I don't even know if the problem is anything to do with iptables. Thanks in advance, Max
EDIT: I tried changing the 'localhost' line in the monit config thus:
set httpd port 2812 and
use address mywebsite.com
allow mywebsite.com
allow admin:password
but it didn't make any difference.