Why am I getting connection refused error when typing my IP address /webmail after setting up squirrelmail, postfix and dovecot on centos7?

April 14, 2018 101 views
Apache Linux Basics Applications DigitalOcean Cloud Firewalls CentOS

To build the email server I followed this article: https://hostpresto.com/community/tutorials/how-to-setup-an-email-server-on-centos7/

Basically, I want to build an email server using Apache, Postfix, and Dovecot with the squirrelmail as the webmail service. When I finish the instructions in the article provided above I go to the IP address/webmail and get a connection refused error in my browser. I know that Apache is working since I get the proper test page when going to the IP address. I have configured the DNS properly as well with the domain name.

I looked into it further and found something about a default firewall that comes with the centos7 clean install. So i tried to open it up by using the commands in the article:
firewall-cmd --permanent --add-service=smtp
firewall-cmd --permanent --add-port=587/tcp
firewall-cmd --permanent --add-port=465/tcp
firewall-cmd --permanent --add-port=110/tcp
firewall-cmd --permanent --add-service=pop3s
firewall-cmd --permanent --add-port=143/tcp
firewall-cmd --permanent --add-service=imaps
firewall-cmd --permanent --add-service=http
firewall-cmd --reload

However the firewall-cmd command is not found.

I don't know what else to try to get this thing going or if there is a setting on the droplets that are preventing me from doing this. Usually google helps but I have run out of stuff to search for. Any help is greatly appreciated! Thank you :)

I am using the most basic droplet (1g) with centos7

1 Answer

It looks like firewall-cmd might be a reference to which ever firewall service you're using on your droplet?
If firewall-cmd returned with command is not found that means that nothing was applied to your firewall.

After some researching it looks like you may need to be run as root.

Try running the firewall commands as follows:

sudo firewall-cmd --permanent --add-service=smtp
sudo firewall-cmd --permanent --add-port=587/tcp
sudo firewall-cmd --permanent --add-port=465/tcp
sudo firewall-cmd --permanent --add-port=110/tcp
sudo firewall-cmd --permanent --add-service=pop3s
sudo firewall-cmd --permanent --add-port=143/tcp
sudo firewall-cmd --permanent --add-service=imaps
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --reload
Have another answer? Share your knowledge.