1

Topic: Adding Apache Support After Initial Install

==== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.8
- Linux/BSD distribution name and version: Ubunti 16.04
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx):Want Apache
- Manage mail accounts with iRedAdmin-Pro? No
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

How do I go about setting up Apache support after setting up iRedMail initially?  The set up script did not list Apache as a web server option (just nginx) so I selected not to install a web server.  Everything has been set up and is working fine... I would now like to enable the iRedadmin and also allow for webmail use....

So, how can I install Apache support?

Thanks,

Brent Warkentin

----

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

2

Re: Adding Apache Support After Initial Install

Unless you plan on hosting more than mail on your iredmail instance why not just install nginx. Zhang has the nginx configuration pretty modular and is easy to work with.

-Ron

3

Re: Adding Apache Support After Initial Install

rrosson wrote:

Unless you plan on hosting more than mail on your iredmail instance why not just install nginx. Zhang has the nginx configuration pretty modular and is easy to work with.

-Ron

Ok so do I re-run the install script or is the install done with manual run apt-get commands?

Thanks,

Brent Warkentin

4

Re: Adding Apache Support After Initial Install

Add lines below in file "iRedMail-0.9.8/config", then re-run the install script.

export WEB_SERVER='NGINX'
export USE_IREDADMIN='YES'
export USE_ROUNDCUBE='YES'

5 (edited by jbobier 2018-07-25 15:36:05)

Re: Adding Apache Support After Initial Install

rrosson wrote:

Unless you plan on hosting more than mail on your iredmail instance why not just install nginx. Zhang has the nginx configuration pretty modular and is easy to work with.

-Ron

What should we do if we do run a small site with several domains and services (including Apache) and want to use iRedMail because it looks amazing?

6 (edited by selea 2018-07-25 19:15:58)

Re: Adding Apache Support After Initial Install

<IfModule mod_ssl.c>
<VirtualHost *:443>
        ServerName mail.domain.se
        ServerAdmin admin@domain.se
        ServerAlias sub.domain.se
        DocumentRoot /var/www/html
        #LogLevel info ssl:warn

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
        Header always set Strict-Transport-Security "max-age=63072000; includeSubdomains;"
        Header set Content-Secure-Policy "default-src 'self'; upgrade-insecure-requests;"
        #Include conf-available/serve-cgi-bin.conf
Alias /iredadmin/static "/opt/www/iredadmin/static/"
WSGIScriptAlias /iredadmin "/opt/www/iredadmin/iredadmin.py/"
Alias /mail "/opt/www/roundcubemail/"
Alias /rainloop "/opt/www/rainloop/"
Alias /awstats/icon "/usr/share/awstats/icon/"
Alias /awstatsicon "/usr/share/awstats/icon/"
ScriptAlias /awstats "/usr/lib/cgi-bin/"
SSLEngine on
SSLProtocol all -SSLv2 -SSLv3 -TLSv1 -TLSv1.1

SSLCertificateFile /etc/rapidssl/certificate.crt
SSLCertificateKeyFile /etc/rapidssl/certificate.key
SSLCACertificateFile /etc/rapidssl/rapidssl.2018.crt
</VirtualHost>

</IfModule>

This is my apache config, adapt it to your needs

And yes, I do agree that it is sad that apache support is dropped by iRedmail. Apache and Nginx is comparable when it comes to performance if you are using Apache2.4 with prefork. Apache is also easier (atleast for me) to configure and maintain.

7

Re: Adding Apache Support After Initial Install

selea wrote:
...

This is my apache config, adapt it to your needs

And yes, I do agree that it is sad that apache support is dropped by iRedmail. Apache and Nginx is comparable when it comes to performance if you are using Apache2.4 with prefork. Apache is also easier (atleast for me) to configure and maintain.

Awesome! Thanks, that will save me a bunch of searching around for files. The other idea that I had was just to configure Nginx to run on a different port. Seems kind of redundant to run another web server just for iredmail, but maybe that it is easier in the long run.

8

Re: Adding Apache Support After Initial Install

It may be easier to setup the server in this order:

- Setup new server and install iRedMail
- Setup your website

9

Re: Adding Apache Support After Initial Install

It may be easier to setup the server in this order:

- Setup new server and install iRedMail
- Setup your website

10

Re: Adding Apache Support After Initial Install

selea wrote:
<IfModule mod_ssl.c>
<VirtualHost *:443>
        ServerName mail.domain.se
        ServerAdmin admin@domain.se
        ServerAlias sub.domain.se
        DocumentRoot /var/www/html
        #LogLevel info ssl:warn

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
        Header always set Strict-Transport-Security "max-age=63072000; includeSubdomains;"
        Header set Content-Secure-Policy "default-src 'self'; upgrade-insecure-requests;"
        #Include conf-available/serve-cgi-bin.conf
Alias /iredadmin/static "/opt/www/iredadmin/static/"
WSGIScriptAlias /iredadmin "/opt/www/iredadmin/iredadmin.py/"
Alias /mail "/opt/www/roundcubemail/"
Alias /rainloop "/opt/www/rainloop/"
Alias /awstats/icon "/usr/share/awstats/icon/"
Alias /awstatsicon "/usr/share/awstats/icon/"
ScriptAlias /awstats "/usr/lib/cgi-bin/"
SSLEngine on
SSLProtocol all -SSLv2 -SSLv3 -TLSv1 -TLSv1.1

SSLCertificateFile /etc/rapidssl/certificate.crt
SSLCertificateKeyFile /etc/rapidssl/certificate.key
SSLCACertificateFile /etc/rapidssl/rapidssl.2018.crt
</VirtualHost>

</IfModule>

This is my apache config, adapt it to your needs

And yes, I do agree that it is sad that apache support is dropped by iRedmail. Apache and Nginx is comparable when it comes to performance if you are using Apache2.4 with prefork. Apache is also easier (atleast for me) to configure and maintain.

I'm fairly new to iRedMail or any server-based item whatsoever. I had apache2 already running with a website and web app serving. I was in dire need of an email service package so I do not run into installing the MTA, MUA... individually, ended up installing iRedMail neglecting the documentation.

Now, I have Nginx and Apache running side by side and none serving what I expect them to serve. How can I completely remove Nginx (to avoid further server complication) and configure iRedMail 1.2.1 to run with the existing Apache 2 web server? It seems like this post is the closest I can get to, but I still need clearer step-by-step instructions to pull this off.

Sorry for giving life to this post, but I'm in some mess in my production server sad

11

Re: Adding Apache Support After Initial Install

Better run iRedMail on a dedicate server for mail service only.

12

Re: Adding Apache Support After Initial Install

ZhangHuangbin wrote:

Better run iRedMail on a dedicate server for mail service only.

I realized that now. What is the best way to uninstall iRedMail so I can deal with it in a dedicated server?

13

Re: Adding Apache Support After Initial Install

Unfortunately, you have to remove related softwares and their data and config files manually.

14

Re: Adding Apache Support After Initial Install

selea wrote:
<IfModule mod_ssl.c>
<VirtualHost *:443>
        ServerName mail.domain.se
        ServerAdmin admin@domain.se
        ServerAlias sub.domain.se
        DocumentRoot /var/www/html
        #LogLevel info ssl:warn

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
        Header always set Strict-Transport-Security "max-age=63072000; includeSubdomains;"
        Header set Content-Secure-Policy "default-src 'self'; upgrade-insecure-requests;"
        #Include conf-available/serve-cgi-bin.conf
Alias /iredadmin/static "/opt/www/iredadmin/static/"
WSGIScriptAlias /iredadmin "/opt/www/iredadmin/iredadmin.py/"
Alias /mail "/opt/www/roundcubemail/"
Alias /rainloop "/opt/www/rainloop/"
Alias /awstats/icon "/usr/share/awstats/icon/"
Alias /awstatsicon "/usr/share/awstats/icon/"
ScriptAlias /awstats "/usr/lib/cgi-bin/"
SSLEngine on
SSLProtocol all -SSLv2 -SSLv3 -TLSv1 -TLSv1.1

SSLCertificateFile /etc/rapidssl/certificate.crt
SSLCertificateKeyFile /etc/rapidssl/certificate.key
SSLCACertificateFile /etc/rapidssl/rapidssl.2018.crt
</VirtualHost>

</IfModule>

This is my apache config, adapt it to your needs

And yes, I do agree that it is sad that apache support is dropped by iRedmail. Apache and Nginx is comparable when it comes to performance if you are using Apache2.4 with prefork. Apache is also easier (atleast for me) to configure and maintain.

Hey I'm actually using your config but I get a Internal Server error if I go to "/iredadmin". More over in the apache error.log file I found these

 

 [Tue May 04 12:21:52.098499 2021] [wsgi:info] [pid 7296:tid 140234037589760] [client 116.73.183.216:51294] mod_wsgi (pid=7296, process='', application='mail.prudent-solutions.co.in|/iredadmin'): Loading Python script file '/opt/www/iredadmin/iredadmin.py'.
[Tue May 04 12:21:52.100486 2021] [wsgi:error] [pid 7296:tid 140234037589760] [client 116.73.183.216:51294] mod_wsgi (pid=7296): Failed to exec Python script file '/opt/www/iredadmin/iredadmin.py'.
[Tue May 04 12:21:52.100503 2021] [wsgi:error] [pid 7296:tid 140234037589760] [client 116.73.183.216:51294] mod_wsgi (pid=7296): Exception occurred processing WSGI script '/opt/www/iredadmin/iredadmin.py'.
[Tue May 04 12:21:52.100524 2021] [wsgi:error] [pid 7296:tid 140234037589760] [client 116.73.183.216:51294] Traceback (most recent call last):
[Tue May 04 12:21:52.100553 2021] [wsgi:error] [pid 7296:tid 140234037589760] [client 116.73.183.216:51294]   File "/opt/www/iredadmin/iredadmin.py", line 8, in <module>
[Tue May 04 12:21:52.100585 2021] [wsgi:error] [pid 7296:tid 140234037589760] [client 116.73.183.216:51294]     from libs import iredbase
[Tue May 04 12:21:52.100596 2021] [wsgi:error] [pid 7296:tid 140234037589760] [client 116.73.183.216:51294]   File "/opt/www/iredadmin/libs/iredbase.py", line 5, in <module>
[Tue May 04 12:21:52.100611 2021] [wsgi:error] [pid 7296:tid 140234037589760] [client 116.73.183.216:51294]     import web
[Tue May 04 12:21:52.100632 2021] [wsgi:error] [pid 7296:tid 140234037589760] [client 116.73.183.216:51294] ImportError: No module named web
[Tue May 04 12:21:52.100680 2021] [headers:debug] [pid 7296:tid 140234037589760] mod_headers.c(899): AH01503: headers: ap_headers_error_filter()
[Tue May 04 12:21:52.100862 2021] [ssl:debug] [pid 7296:tid 140234037589760] ssl_engine_io.c(1102): [client 116.73.183.216:51294] AH02001: Connection closed to child 16 with standard shutdown (server mail.prudent-solutions.co.in:80)
[Tue May 04 12:21:52.383600 2021] [ssl:info] [pid 7296:tid 140234054375168] [client 116.73.183.216:51295] AH01964: Connection to child 14 established (server api.prudent-solutions.co.in:443)
[Tue May 04 12:21:52.383954 2021] [ssl:debug] [pid 7296:tid 140234054375168] ssl_engine_kernel.c(2372): [client 116.73.183.216:51295] AH02043: SSL virtual host for servername mail.prudent-solutions.co.in found
[Tue May 04 12:21:52.383972 2021] [core:debug] [pid 7296:tid 140234054375168] protocol.c(2313): [client 116.73.183.216:51295] AH03155: select protocol from , choices=h2,http/1.1 for server mail.prudent-solutions.co.in
[Tue May 04 12:21:53.292609 2021] [socache_shmcb:debug] [pid 7296:tid 140234054375168] mod_socache_shmcb.c(555): AH00837: socache_shmcb_remove (0x88 -> subcache 8)
[Tue May 04 12:21:53.292638 2021] [socache_shmcb:debug] [pid 7296:tid 140234054375168] mod_socache_shmcb.c(939): AH00852: possible match at idx=0, data=0
[Tue May 04 12:21:53.292649 2021] [socache_shmcb:debug] [pid 7296:tid 140234054375168] mod_socache_shmcb.c(944): AH00853: shmcb_subcache_remove removing matching entry
[Tue May 04 12:21:53.292653 2021] [socache_shmcb:debug] [pid 7296:tid 140234054375168] mod_socache_shmcb.c(570): AH00839: leaving socache_shmcb_remove successfully
[Tue May 04 12:21:53.292663 2021] [ssl:info] [pid 7296:tid 140234054375168] [client 116.73.183.216:51295] AH02008: SSL library error 1 in handshake (server api.prudent-solutions.co.in:443)
[Tue May 04 12:21:53.292678 2021] [ssl:info] [pid 7296:tid 140234054375168] SSL Library Error: error:14094416:SSL routines:ssl3_read_bytes:sslv3 alert certificate unknown (SSL alert number 46)
[Tue May 04 12:21:53.292700 2021] [ssl:info] [pid 7296:tid 140234054375168] [client 116.73.183.216:51295] AH01998: Connection closed to child 14 with abortive shutdown (server mail.prudent-solutions.co.in:80)

Please Help
My apache config

<VirtualHost *:443>
        ServerName mail.prudent-solutions.co.in
        DocumentRoot /var/www/html
        #LogLevel info ssl:warn

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
        Header always set Strict-Transport-Security "max-age=63072000; includeSubdomains;"
        Header set Content-Secure-Policy "default-src 'self'; upgrade-insecure-requests;"
        #Include conf-available/serve-cgi-bin.conf
Alias /iredadmin/static "/opt/www/iredadmin/static/"
WSGIScriptAlias /iredadmin "/opt/www/iredadmin/iredadmin.py/"
Alias /mail "/opt/www/roundcubemail/"
</VirtualHost>

Once Again pls help

15

Re: Adding Apache Support After Initial Install

Why not just use Nginx if you don't need to modify its config files?

16

Re: Adding Apache Support After Initial Install

ZhangHuangbin wrote:

Why not just use Nginx if you don't need to modify its config files?

I'm not interested to do that. Please let me know the Apache configuration for ireadmail. If possible please add Apache support just like Nginx. This would be beneficial for many users who already have apache2 and cannot afford another separate server just for iredmail.

Why not add Apache support when you can add Nginx O.o 

17

Re: Adding Apache Support After Initial Install

You can find Apache related configuration in old iRedMail version.

iRedMail used Apache at the beginning, but we switched to Nginx years ago and  won’t go back.

18

Re: Adding Apache Support After Initial Install

ZhangHuangbin wrote:

You can find Apache related configuration in old iRedMail version.

iRedMail used Apache at the beginning, but we switched to Nginx years ago and  won’t go back.

Oh Ok. Can you please send the link for the file please

19

Re: Adding Apache Support After Initial Install

Check old release tags here:
https://github.com/iredmail/iRedMail/