Archive for June 2008

iptables for asterisk

If you’re running Asterisk on a VPS or a dedicated server then setting up your iptables firewall can be a tricky.

I thought I’d post my firewall script to help get you started. I save this script as /usr/local/bin/firewall.sh and then add a line to run it from /etc/rc.local

It allows SSH’ing to the machine plus rules required for SIP connections (you will need other rules if you use IAX) plus some basic “bad stuff” filtering.

I’ve commented it so, hopefully, you’ll be able to figure out and chages you need.

Continue reading ‘iptables for asterisk’ »

ssh: connect to host … port 22: Connection refused - UPDATE

As someone pointed out here another possibilty for these kind off error messages is that, if you’ve just changed the SSH port from 22 to something else for security, then there’s a good chance your firewall may be blocking the connection.

Redhat5/CentOS5 cetainly has a firewall enabled as default. Try ‘iptables –list’ to see if you’ve got iptables running

vps monitoring

If you have your website, e-mail system, etc. running on your own VPS or dedicated server it’s good to know when that server is unavailable so you can contact your server provider asap.

The best way to do this is use an external monitoring company. I’ve been using Hyperspin for a couple of months now and it’s been working great.

You can pick what services/ports on your server to monitor (SMTP, HTTP, HTTPS, etc.) and you can chose how to be alerted when they are not available. Obviously you need to make sure that you’re alerted via an out of band method (in other words don’t rely on an e-mail to an e-mail account on your VPS to know that your VPS is down!)

The Hyperspin website isn’t very pretty but overall their system is reliable and easy to use.