Report this

What is the reason for this report?

iRedMail receive/sends fail (apache2-nginx ports conflict?)

Posted on January 17, 2015

I installed iredmail with nginx>mysql options. But now nginx port seems 80 and apache not restart. Tried to change apache conf files listen ports and virtualhost ports to 8080 (in ports.conf and 000-default.conf) and try to restart . It restarted apache but in both ways I could not receive and send mails. Only when i restart droplet, mails receive and send. In normal times it does not.I rolled back conf changes.

How should i do that? Last status like this.

Note: I’ll use mail server with my website. (same droplet)

root@KHNEMU-DROPLET:~# service nginx restart
 * Restarting nginx nginx                                                                                                                                                             [ OK ]
root@KHNEMU-DROPLET:~# sudo service apache2 restart
 * Restarting web server apache2                                                                                                                                                             (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
(98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
AH00015: Unable to open logs
Action 'start' failed.
The Apache error log may have more information.
                                                                                                                                                                                      [fail]
 * The apache2 instance did not start within 20 seconds. Please read the log files to discover problems

root@KHNEMU-DROPLET:~# sudo netstat -lnpt
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.1:907           0.0.0.0:*               LISTEN      2162/python
tcp        0      0 0.0.0.0:587             0.0.0.0:*               LISTEN      1866/master
tcp        0      0 127.0.0.1:908           0.0.0.0:*               LISTEN      2162/python
tcp        0      0 127.0.0.1:909           0.0.0.0:*               LISTEN      2162/python
tcp        0      0 127.0.0.1:9998          0.0.0.0:*               LISTEN      1089/amavisd-new (m
tcp        0      0 0.0.0.0:110             0.0.0.0:*               LISTEN      977/dovecot
tcp        0      0 178.62.189.239:943      0.0.0.0:*               LISTEN      2162/python
tcp        0      0 127.0.0.1:10031         0.0.0.0:*               LISTEN      1893/perl
tcp        0      0 0.0.0.0:143             0.0.0.0:*               LISTEN      977/dovecot
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      3073/nginx
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      974/sshd
tcp        0      0 0.0.0.0:24              0.0.0.0:*               LISTEN      977/dovecot
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      1866/master
tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      3073/nginx
tcp        0      0 0.0.0.0:4190            0.0.0.0:*               LISTEN      977/dovecot
tcp        0      0 127.0.0.1:7777          0.0.0.0:*               LISTEN      1720/python
tcp        0      0 0.0.0.0:993             0.0.0.0:*               LISTEN      977/dovecot
tcp        0      0 0.0.0.0:995             0.0.0.0:*               LISTEN      977/dovecot
tcp        0      0 127.0.0.1:904           0.0.0.0:*               LISTEN      2162/python
tcp        0      0 127.0.0.1:10024         0.0.0.0:*               LISTEN      1089/amavisd-new (m
tcp        0      0 127.0.0.1:905           0.0.0.0:*               LISTEN      2162/python
tcp        0      0 127.0.0.1:10025         0.0.0.0:*               LISTEN      1866/master
tcp        0      0 127.0.0.1:906           0.0.0.0:*               LISTEN      2162/python
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      1042/mysqld
tcp6       0      0 :::587                  :::*                    LISTEN      1866/master
tcp6       0      0 :::110                  :::*                    LISTEN      977/dovecot
tcp6       0      0 :::143                  :::*                    LISTEN      977/dovecot
tcp6       0      0 :::22                   :::*                    LISTEN      974/sshd
tcp6       0      0 :::24                   :::*                    LISTEN      977/dovecot
tcp6       0      0 :::25                   :::*                    LISTEN      1866/master
tcp6       0      0 :::4190                 :::*                    LISTEN      977/dovecot
tcp6       0      0 :::993                  :::*                    LISTEN      977/dovecot
tcp6       0      0 :::995                  :::*                    LISTEN      977/dovecot



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

This comment has been deleted

Hello there,

If you’re using a reverse proxy with Apache and Nginx both services need to listen on different ports in order to prevent such issues.

https://www.digitalocean.com/community/tutorials/how-to-configure-nginx-as-a-web-server-and-reverse-proxy-for-apache-on-one-ubuntu-18-04-server

Regards

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.