Khnemu
By:
Khnemu

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

January 17, 2015 2.3k views

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

4 comments
  • From my experience I do not recommend you to have both apache and nginx on the same droplet. May I ask why you need them both?

  • Don't know. I opened my droplet Ubuntu Lamp x64. So both of them already installed i think. I also use openvpn and teamspeak server on my droplet. What do you suggest? Should I uninstall one of two? After that might be able to use all of these applications with my website and mail on apache or nginx?

  • You created a LAMP droplet, LAMP stands for Linux, Apache, Mysql, PHP. Since you don't need Apache to serve you a website you should remove it using sudo apt-get purge apache2.

  • Or can I go with lamp (without nginx) and able to use website,mail,openvpn and teamspeak with apache?

1 Answer
Have another answer? Share your knowledge.