1

Topic: error during installation - how to recover?

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release):       0.9.8
- Linux/BSD distribution name and version:               Debian stretch
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):   LDAP
- Web server (Apache or Nginx):                              Nginx
- Manage mail accounts with iRedAdmin-Pro?           no
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====
Just tried to install.  System is not a new install, but I removed all mail related packages. 
Got an error message during installation:

...
Setting up php-ldap (1:7.0+49) ...
Setting up postfix-ldap (3.1.8-0+deb9u1) ...
Adding ldap map entry to /etc/postfix/dynamicmaps.cf
Setting up uwsgi-plugin-python (2.0.14+20161117-3+deb9u2) ...
Setting up nginx-full (1.10.3-1+deb9u2) ...
Job for nginx.service failed because the control process exited with error code.
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 Sun 2018-12-16 17:52:47 UTC; 9ms ago
     Docs: man:nginx(8)
  Process: 17837 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=1/FAILURE)
  Process: 17835 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)

Dec 16 17:52:45 carotid nginx[17837]: nginx: [emerg] bind() to [::]:80 fail…use)
Dec 16 17:52:46 carotid nginx[17837]: nginx: [emerg] bind() to 0.0.0.0:80 f…use)
Dec 16 17:52:46 carotid nginx[17837]: nginx: [emerg] bind() to [::]:80 fail…use)
Dec 16 17:52:46 carotid nginx[17837]: nginx: [emerg] bind() to 0.0.0.0:80 f…use)
Dec 16 17:52:46 carotid nginx[17837]: nginx: [emerg] bind() to [::]:80 fail…use)
Dec 16 17:52:47 carotid nginx[17837]: nginx: [emerg] still could not bind()
Dec 16 17:52:47 carotid systemd[1]: nginx.service: Control process exited, …us=1
Dec 16 17:52:47 carotid systemd[1]: Failed to start A high performance web …ver.
Dec 16 17:52:47 carotid systemd[1]: nginx.service: Unit entered failed state.
Dec 16 17:52:47 carotid systemd[1]: nginx.service: Failed with result 'exit…de'.
Hint: Some lines were ellipsized, use -l to show in full.
dpkg: error processing package nginx-full (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up php-mbstring (1:7.0+49) ...
...

and of course at the end:

...
Errors were encountered while processing:
 nginx-full
E: Sub-process /usr/bin/dpkg returned an error code (1)
<< ERROR >> Installation failed, please check the terminal output.

Perhaps this is because apache2 was still installed, or because I forgot to stop it before installing?
(I chose nginx in spite of being familiar with apache2, because it was the only option given, and because I thought the two could be installed side by side as long as they are not run simultaneously.)

In any case, do I now need to uninstall everything in order to start again, or is there a method to repair the nearly complete installation?

TIA

----

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

2

Re: error during installation - how to recover?

Apache is listening on port 80/443, but Nginx is trying to bind to same ports. This is the cause.
It's recommended to use a fresh new server OS for iRedMail installation.

3

Re: error during installation - how to recover?

ZhangHuangbin wrote:

Apache is listening on port 80/443, but Nginx is trying to bind to same ports. This is the cause.
It's recommended to use a fresh new server OS for iRedMail installation.

OK thanks.  I guessed it might be that.  I decided the install script starts by using dpkg or apt to install packages, so it should be safe to simply re-run `bash iRedMail.sh` rather than uninstalling the 204 packages...

I stopped apache and re-ran the script.  It seems to have completed, but

  • gave a series of error messages:  ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "No such file or directory")

  • subsequently, nginx fails to run: nginx: [emerg] could not build map_hash, you should increase map_hash_bucket_size: 32 \ nginx: configuration file /etc/nginx/nginx.conf test failed .

I tried swapping the file nginx.conf.2018.12.16.19.58.36 into nginx.conf, but now get a new error xwhen I start nginx: 'nginx: [emerg] no port in upstream "php_workers" in /etc/nginx/templates/fastcgi_php.tmpl:13'

I have now removed the apache2 installation, and am wondering whether it is safe to try re-running the iRedMail.sh install script.  I suppose it cannot do any harm...

4

Re: error during installation - how to recover?

I suggest rebuild a fresh new server OS for installation, you will realize how easy it is. smile

5

Re: error during installation - how to recover?

ZhangHuangbin wrote:

I suggest rebuild a fresh new server OS for installation, you will realize how easy it is. smile

Thank you.

That is what I have done.  Installation proceeded successfully on a re-imaged machine.  The applications do not all run, but I had better start a separate thread for that.