1 (edited by thallesf 2015-12-16 15:24:08)

Topic: Problems with Apache

==== Required information ====
- iRedMail version (check /etc/iredmail-release):
- Linux/BSD distribution name and version:
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):
- Web server (Apache or Nginx):
- Manage mail accounts with iRedAdmin-Pro?
- Related log if you're reporting an issue:
======== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.3
- Linux/BSD distribution name and version: Ubuntu 15.10
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):  MySQL
- Web server (Apache or Nginx): Apache
- Manage mail accounts with iRedAdmin-Pro? No
- Related log if you're reporting an issue:

I installed the server , everything is running smoothly until the account created here with the new email, but I'm having trouble with the Apache. If I turn off the SSL certificate it works, but if I turn on it returns an error and does not start .

The error is: "Job for apache2.service failed because the control process exited with error code. See "systemctl status apache2.service" and "journalctl -xe" for details."

Unit apache2.service has begun starting up.
Dec 16 02:08:00 mail apache2[2564]: * Starting web server apache2
Dec 16 02:08:00 mail apache2[2564]: *
Dec 16 02:08:00 mail apache2[2564]: * The apache2 configtest failed.
Dec 16 02:08:00 mail apache2[2564]: Output of config test was:
Dec 16 02:08:00 mail apache2[2564]: AH00526: Syntax error on line 26 of /etc/apache2/sites-enabled/default-ssl.conf:
Dec 16 02:08:00 mail apache2[2564]: Invalid command 'HSTS', perhaps misspelled or defined by a module not included in the server confi
Dec 16 02:08:00 mail apache2[2564]: Action 'configtest' failed.
Dec 16 02:08:00 mail apache2[2564]: The Apache error log may have more information.
Dec 16 02:08:00 mail systemd[1]: apache2.service: Control process exited, code=exited status=1
Dec 16 02:08:00 mail systemd[1]: Failed to start LSB: Apache2 web server.


The line is:

    SSL Engine Switch:
                   Enable/Disable SSL for this virtual host.
                SSLEngine on
HSTS (mod_headers is required) (15768000 seconds = 6 months)
Header always set Strict-Transport-Security "max-age=15768000"
SSLCipherSuite ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:D$
SSLHonorCipherOrder on


I'm pretty new to Email and Apache servers , so if you me can help me I will be very grateful.

I'm sorry for bad english , i'm from Brazil and i did that text with the help of the google translator

@EDIT|  Another problem that happens when i install iRedMail is that I can't connect to my TeamSpeak3 server




====

----

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

2

Re: Problems with Apache

thallesf wrote:

HSTS (mod_headers is required) (15768000 seconds = 6 months)

Please comment out this line by inserting a '#' at the beginning of this line, then restart Apache service.

3

Re: Problems with Apache

ZhangHuangbin wrote:
thallesf wrote:

HSTS (mod_headers is required) (15768000 seconds = 6 months)

Please comment out this line by inserting a '#' at the beginning of this line, then restart Apache service.

Inserting the '#' did not solve the problem , I had to put on the bottom line too ("Header always set Strict-Transport-Security "max-age=15768000""), then worked, but still without the certificate and the Chrome saying that the site is not safe : /

Dec 16 03:07:57 mail apache2[3636]: * Starting web server apache2
Dec 16 03:07:57 mail apache2[3636]: *
Dec 16 03:07:57 mail apache2[3636]: * The apache2 configtest failed.
Dec 16 03:07:57 mail apache2[3636]: Output of config test was:
Dec 16 03:07:57 mail apache2[3636]: AH00526: Syntax error on line 27 of /etc/apache2/sites-enabled/default-ssl.conf:
Dec 16 03:07:57 mail apache2[3636]: Invalid command 'Header', perhaps misspelled or defined by a module not included in the server configuration
Dec 16 03:07:57 mail apache2[3636]: Action 'configtest' failed.
Dec 16 03:07:57 mail apache2[3636]: The Apache error log may have more information.
Dec 16 03:07:57 mail systemd[1]: apache2.service: Control process exited, code=exited status=1
Dec 16 03:07:57 mail systemd[1]: Failed to start LSB: Apache2 web server.

This is the log, after inserting the '#' in the line you asked

4

Re: Problems with Apache

Enable apache module 'headers' please:

# a2enmod headers
# service apache2 restart

5

Re: Problems with Apache

I did it, now the other line is working but the line "HSTS (mod_headers is required) (15768000 seconds = 6 months) " keeps giving error.

I need to do any more configuration ?

Dec 16 03:29:48 mail apache2[4840]: * Starting web server apache2
Dec 16 03:29:49 mail apache2[4840]: *
Dec 16 03:29:49 mail apache2[4840]: * The apache2 configtest failed.
Dec 16 03:29:49 mail apache2[4840]: Output of config test was:
Dec 16 03:29:49 mail apache2[4840]: AH00526: Syntax error on line 26 of /etc/apache2/sites-enabled/default-ssl.conf:
Dec 16 03:29:49 mail apache2[4840]: Invalid command 'HSTS', perhaps misspelled or defined by a module not included in the server configuration
Dec 16 03:29:49 mail apache2[4840]: Action 'configtest' failed.
Dec 16 03:29:49 mail apache2[4840]: The Apache error log may have more information.
Dec 16 03:29:49 mail systemd[1]: apache2.service: Control process exited, code=exited status=1
Dec 16 03:29:49 mail systemd[1]: Failed to start LSB: Apache2 web server.

6

Re: Problems with Apache

thallesf wrote:

I did it, now the other line is working but the line "HSTS (mod_headers is required) (15768000 seconds = 6 months) " keeps giving error.

This is a comment line. Please comment it out.

7

Re: Problems with Apache

ZhangHuangbin wrote:
thallesf wrote:

I did it, now the other line is working but the line "HSTS (mod_headers is required) (15768000 seconds = 6 months) " keeps giving error.

This is a comment line. Please comment it out.


I'm using this way, but browsers still saying that the site is not safe. Must redo any steps to remake the SSL certificate?

8

Re: Problems with Apache

thallesf wrote:

I'm using this way, but browsers still saying that the site is not safe. Must redo any steps to remake the SSL certificate?

Could you please capture a screenshot of your web browser (with this error message) to help us understand this issue?

9

Re: Problems with Apache

That is the problem. I took the screenshot with Tor because I 've accepted with Chrome and he did not show again, but is the same thing.

http://i.imgur.com/R4ue8oV.png

10

Re: Problems with Apache

This is caused by self-signed SSL certificate. The only way to solve it is buying a SSL cert, or get one from https://letsencrypt.org for free.

11

Re: Problems with Apache

ZhangHuangbin wrote:

This is caused by self-signed SSL certificate. The only way to solve it is buying a SSL cert, or get one from https://letsencrypt.org for free.


And how could I turn this off ? From what I 'm going to use it will not be necessary.

12

Re: Problems with Apache

You can solve it by buying a SSL cert, or get one from https://letsencrypt.org for free.
Turning off SSL is not a good idea.

13

Re: Problems with Apache

ZhangHuangbin wrote:

You can solve it by buying a SSL cert, or get one from https://letsencrypt.org for free.
Turning off SSL is not a good idea.

Thank you for real! I used the site you passed and is now running everything perfectly. Thank you for your support smile

14

Re: Problems with Apache

The email itself is working, but the admin interface ( iredadmin ) does not work, gives 404 not found (ursolandia.com/iredadmin/). I researched a lot and tried but could not solve alone. Can you help me again?

15

Re: Problems with Apache

iRedAdmin is accessible via only HTTPS: https://[your_server]/iredadmin/
Did you access via http:// or https://?

16

Re: Problems with Apache

ZhangHuangbin wrote:

iRedAdmin is accessible via only HTTPS: https://[your_server]/iredadmin/
Did you access via http:// or https://?

I am accessing the https , but is giving error by 2 ways

17

Re: Problems with Apache

Did you modify any Apache config file? Changed default virtual host settings?

18 (edited by higorvaz 2016-04-20 23:56:02)

Re: Problems with Apache

Sorry for resurrecting this but I also was facing this problem.
After a fresh install on a Linone cloud VM all worked well, but when I installed a proprietary SSL certificate, LetsEncrypt, the iredadmin URL could not be accessible, and always returned 404 error.

OS: Ubuntu 14.04 LTS
iRedMail: iRedMail-0.9.4

The solution:
# Added IREDADMIN configuration params

# from: /etc/apache2/sites-available/default-ssl.conf
# to:     /etc/apache2/sites-available/000-default-le-ssl.conf

Alias /iredadmin/static "/opt/www/iredadmin/static/"
WSGIScriptAlias /iredadmin "/opt/www/iredadmin/iredadmin.py/"
Alias /mail "/opt/www/roundcubemail/"
Alias /awstats/icon "/usr/share/awstats/icon/"
Alias /awstatsicon "/usr/share/awstats/icon/"
ScriptAlias /awstats "/usr/lib/cgi-bin/"

Hope it helps...

Peace from Brazil,
Higor