1

Topic: Sites Keeps crashing

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

Site works perfectly for a few days then just stops.  Nothing.  All services seem to be running.   Sometimes starts working again after 30-60 minutes.   Using small AWS instance   

Why is this so unstable.  When it works it's nearly perfect.

----

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

2

Re: Sites Keeps crashing

hey,
what site?
Sogo? roundcube? iredadmin?

it will be useful if you'll show us the log of the site when the problem appears again.
thanks

3

Re: Sites Keeps crashing

raz wrote:

hey,
what site?
Sogo? roundcube? iredadmin?

it will be useful if you'll show us the log of the site when the problem appears again.
thanks

The entire site.  enter mail.myserversite.com just hangs.   My test page on var/www/html does not appear.  Receiving no emails.  So that means no access to roundcube, iredadmin.  I uninstalled SOGO.   giving me too me error messages.

I am not sure which log you want.  Tell me specifcally where and which log.   But I'm not sure that is the answer. 

Again,  it works then stops.   Starts again after an hour.   Flaky operation.

4

Re: Sites Keeps crashing

You might be running out of memory on your VPS.

2 GB of memory is recommended for a low traffic production server. Spam/Virus scanning will take most system resource.

5 (edited by bodywise 2017-09-12 01:55:53)

Re: Sites Keeps crashing

Thank you.  That is a valid suggestion.   I am using a "small instance" which is 2 GB.    I loaded up on 15 emails.  That was the whole point.  ALL my emails. 

I reduced that to about 6.  Then I reconfigured the virtual hosting files which are not precisely correct (need to call the private IP address not public addresses).   There was some change after that.  If was running out of memory, how long would that take to recover?    I am trying to construct a mirror site on the east coast.

6

Re: Sites Keeps crashing

bodywise wrote:

Thank you.  That is a valid suggestion.   I am using a "small instance" which is 2 GB.    I loaded up on 15 emails.  That was the whole point.  ALL my emails. 

I reduced that to about 6.  Then I reconfigured the virtual hosting files which are not precisely correct (need to call the private IP address not public addresses).   There was some change after that.  If was running out of memory, how long would that take to recover?    I am trying to construct a mirror site on the east coast.

bodywise,

I'm running iRedMail on a woothosting VPS with 2GB RAM and a 2GB swapfile.  I have 6 domains running with +/- 20 email addresses among them.

Memory usage has never exceeded 1.6 GB; interestingly, memory usage creeps up at times when I know the machine shouldn't be doing anything.  Memory leak?  It decreases by itself over time down to +/- 1GB.

I'm not sure what you are referencing when you speak of reconfiguring the virtual hosting files - I'd look there for your problem given the 2GB is more than enough memory for what you seem to be doing.  Additionally, if I were you, I'd do a vanilla reinstall with SOGo and not delete anything - it may be that the actions you took to delete/remove messed up more than they fixed.

Andrew

7 (edited by bodywise 2017-09-12 07:02:29)

Re: Sites Keeps crashing

Thank you for your response. Appreciate the interest.  So often problems are solved in terms of "what I have or do."

It does appear that memory is not the issue. Deep within the program it appears that Spam and Virus checking defaults to non-checking. In other words, that is not source of memory leak.

This was a significant problem. The site would just die and I would get no emails for a few hours and it would start again.

It is taken me months to learn that virtual hosting using Amazon Web services requires very specific coding. If does not follow exact conventions it does not work perfectly. 1st, you must use the private not public IP address. 

This how a typical AWS virtual host must be written.  This is specific to AWS.  Others may not experience the same problem although I know AWS is very common now.  The directory is not essential but it must be correctly pointed to the exact directory.  I chose to use a much more secure directory. 

So it appears for now the 000-default.conf and default-ssl.conf were the cause of the problem.  Not perfectly coded.  It works now.  And I wrote this in one conf file not two.

<VirtualHost 10.0.x.xxx:443>
    ServerAdmin  me@mydomaine.com
    ServerName mail.xxx.com
    ServerAlias xxx.com
   
    DocumentRoot /var/www/vhosts/xxx.com
    <Directory />
        Options FollowSymLinks
        AllowOverride All
    </Directory>
    <Directory /var/www/vhosts/xxx.com>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>   
    SSLEngine on

    SSLCertificateFile /etc/letsencrypt/live/mail.xxx.com/fullchain.pem
        SSLCertificateKeyFile /etc/letsencrypt/live/mail.xxx.com/privkey.pem

    Alias /iredadmin/static "/opt/www/iredadmin/static/"
    WSGIScriptAlias /iredadmin "/opt/www/iredadmin/iredadmin.py/"
    Alias /mail "/opt/www/roundcubemail/"
    ProxyPass /Microsoft-Server-ActiveSync http://127.0.0.1:20000/SOGo/Microsoft-Server-ActiveSync retry=60 connectiontimeout=5 timeout=3540
    ProxyPass /SOGo http://127.0.0.1:20000/SOGo retry=0
    Alias /awstats/icon "/usr/share/awstats/icon/"
    Alias /awstatsicon "/usr/share/awstats/icon/"
    ScriptAlias /awstats "/usr/lib/cgi-bin/"

</VirtualHost>

BTW, this is the third time I have reinstalled iRedMail.  Not interested in doing that everytime there is a problem.

8

Re: Sites Keeps crashing

Is your IP address blocked in iptables (by Fail2ban)? Run command to check:

iptables -L -n

9 (edited by bodywise 2017-09-12 16:05:42)

Re: Sites Keeps crashing

No iptables is clean.  That was not the issue.  It reallys seems the issue is probably coding the virtual hosting.  For AWS it must conform to certain parameters.  That is why every service seemed to be fine.  There was no UFW block.  I just could not see any evidence of html activity.   It appears to be working flwalesssly again.

These are all learning lessons for everyone including myself.   And my understanding is that the UFW is not enabled by default.  Correct or not?

Only these seem a bit suspect, otherwise all ports are open and perfectly functional.   

Chain FORWARD (policy DROP)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

10

Re: Sites Keeps crashing

iRedMail installs /etc/init.d/iptables on Debian/Ubuntu, you can use it to manage iptables firewall.

11

Re: Sites Keeps crashing

Thank you very much for writing again. That is mildly helpful. But I do implore you to admit that the major problem has nothing to do with the firewall. The major problem was the imperfectly coded virtual hosting.

You must know and warn others the imperfect coding of virtual hosting will lead to major problems. I spent literally months trying to master the coding of virtual hosting. It is always treated as a very casual subject. It is not. It is very complex and must be executed rigorously. I have never seen any write up that explains precisely how to do this. I had to piece this all together with various consultants at Amazon web services.

That having been said, apparently, it is now working flawlessly. I am seeing all my emails. They are being saved. It is referring all my emails locally to Round Cube and to my Outlook. Pop3 mail exactly as I wanted. So I have an audit trail.

I am a professional with the necessity of having an audit trail both immediately and long-term.

Thank you again for your expertly executed program – iRedMail.