1

Topic: nginx and postfix install fails

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.1
- Deployed with iRedMail Easy or the downloadable installer? downloaded
- Linux/BSD distribution name and version: Ubuntu 18.04 LTS
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): LDAP
- Web server (Apache or Nginx): nginx
- Manage mail accounts with iRedAdmin-Pro? Yes
====
I'm trying out the LDAP version now of the server and it seems like the install script is not putting the nginx config files into place so nginx isn't starting.

See "systemctl status nginx.service" and "journalctl -xe" for details.
invoke-rc.d: initscript nginx, action "start" failed.
* nginx.service - A high performance web server and a reverse proxy server
   Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Thu 2020-04-09 15:51:40 EDT; 8ms ago
     Docs: man:nginx(8)
  Process: 2875 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE)

Apr 09 15:51:40 recmail06dev systemd[1]: Starting A high performance web server and a reverse proxy server...
Apr 09 15:51:40 recmail06dev nginx[2875]: nginx: [emerg] socket() [::]:80 failed (97: Address family not supported by protocol)
Apr 09 15:51:40 recmail06dev nginx[2875]: nginx: configuration file /etc/nginx/nginx.conf test failed
Apr 09 15:51:40 recmail06dev systemd[1]: nginx.service: Control process exited, code=exited status=1
Apr 09 15:51:40 recmail06dev systemd[1]: nginx.service: Failed with result 'exit-code'.
Apr 09 15:51:40 recmail06dev systemd[1]: Failed to start A high performance web server and a reverse proxy server.
dpkg: error processing package nginx-full (--configure):
 installed nginx-full package post-installation script subprocess returned error exit status 

The nginx.conf file and the sites-available and sites-enabled aren't getting updated with the iRedmail installer.

Postfix seems to have a similar problem:

etting up postfix (3.3.0-1ubuntu0.2) ...
Installing new version of config file /etc/postfix/makedefs.out ...

Postfix (main.cf) was not set up.  Start with
  cp /usr/share/postfix/main.cf.debian /etc/postfix/main.cf
.  If you need to make changes, edit /etc/postfix/main.cf (and others) as 
needed.  To view Postfix configuration values, see postconf(1).

After modifying main.cf, be sure to run 'service postfix reload'.

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: nginx and postfix install fails

Your server doesn't have IPv6 support, please remove '[::]' from the 'listen' directive in /etc/nginx/sites-enabled/*.conf.

btw, did you disable IPv6 after iRedMail installation? Because it's disabled by default, but iRedMail installer will detect local IPv6 address and enable it.

3

Re: nginx and postfix install fails

DOH! Now I remember running into that the first time I installed it. updated my notes, thanks.

4

Re: nginx and postfix install fails

ZhangHuangbin wrote:

Your server doesn't have IPv6 support, please remove '[::]' from the 'listen' directive in /etc/nginx/sites-enabled/*.conf.

btw, did you disable IPv6 after iRedMail installation? Because it's disabled by default, but iRedMail installer will detect local IPv6 address and enable it.

Sorry to necro this old thread, but I just did a fresh install on Ubuntu Server 22.04,1 LTS and this problem still came up.  Shouldn't the install script be able to do an `ip a` or something, to determine that we don't have ipv6 set up, and modify the `/etc/nginx/sites-enabled/default` file to have the `[::]` line commented out?

The GOOD news is, when I found this thread, commented the line out of the config, and bashed the script again, it seems to have worked.  So thanks for this thread!  smile

5

Re: nginx and postfix install fails

iRedMail installer does check IPv6 and enable it in /etc/nginx/sites-enabled/00-default*.conf, we don't touch /etc/nginx/sites-enabled/default (it's generated by Nginx deb package, not iRedMail installer).