I have a web and mail server running Ubuntu 12.04. I installed iRedMail and had it running fine, but this morning mail was not connecting and none of my sites worked. I checked some logs which told me to run mysqladmin flush-hosts. That may have put the sites online, but they went up and down and I'm not sure it did anything.
Mar 28 15:13:19 server1 roundcube: MDB2 Error: unknown error (-1): _doConnect: [Error message: Host 'server1.MY_DOMAIN.TLD' is not allowed to connect to this MySQL server] [Native code: 1130] [Native message: Host 'server1.MY_DOMAIN.TLD' is not allowed to connect to this MySQL server]
Then I found this and wondered why it didn't say localhost. Shouldn't localhost be trying to connect to mysql?
Here's /etc/hostname/
server1
Here's /etc/hosts
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
127.0.0.1 localhost.localdomain localhost
# Auto-generated hostname. Please do not remove this comment.
MY.IP.222.333 server1.MY_DOMAIN.TLD server1
::1 localhost ip6-localhost ip6-loopback
My hunch is that there is something wrong with these files, as requests should be coming from localhost
.
EDIT: I've looked around in config files for something not pointing to 127.0.0.1 or localhost, but no joy, they all do.
I'm using Ubuntu 12.04 with iRedMail installed and ClamD removed using this tutorial
Edit: This pptp script was the problem. Particularly,
iptables -t nat -A POSTROUTING -j SNAT --to $ip
# saves iptables routing rules and enables them on-boot
iptables-save > /etc/iptables.conf
Where $ip
is my server's public IP. After I enable that, I can VPN tunnel through the server, but all web traffic seems to lead back to itself? I would appreciate if someone knows another way.