1

Topic: 500 internal server error for /mail and /iredadmin after fresh install

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.7.1 MARIADB edition.
- Deployed with iRedMail Easy or the downloadable installer? downloadable installer
- Linux/BSD distribution name and version: FreeBSD 14.1-RELEASE-p6
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- 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.
====

No error messages in /var/log/messages, also no error messages in /var/log/php-fpm/php-fpm.log.

In nginx access log:
[04/Dec/2024:21:17:57 +0000] "GET /iredadmin HTTP/2.0" 500 21
[04/Dec/2024:21:18:08 +0000] "GET /mail/ HTTP/2.0" 200 426

If trying to visit any of these urls (/iredmail, /mail) I get page with internal server error, however /netdata works.

Is there any other logs I could check?

So hard to understand what the error is!

----

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

2

Re: 500 internal server error for /mail and /iredadmin after fresh install

Try this:

cd /opt/www/iredadmin/
python3 iredadmin.py

I expect it runs on port 8080 immediately, please visit it with web browser and check the console output.

3

Re: 500 internal server error for /mail and /iredadmin after fresh install

Thanks for your reply!

As /opt/www doesn't exist on my system I assume that it on FreeBSD instead is /usr/local/www/iredadmin as this directory does exist.

/usr/local/www/iredadmin # python3 iredadmin.py
Traceback (most recent call last):
  File "/usr/local/www/iRedAdmin-2.6/iredadmin.py", line 16, in <module>
    app.run()
  File "/usr/local/www/iRedAdmin-2.6/web/application.py", line 357, in run
    return wsgi.runwsgi(self.wsgifunc(*middleware))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/www/iRedAdmin-2.6/web/wsgi.py", line 66, in runwsgi
    return httpserver.runsimple(func, server_addr)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/www/iRedAdmin-2.6/web/httpserver.py", line 152, in runsimple
    server = WSGIServer(server_address, func)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/www/iRedAdmin-2.6/web/httpserver.py", line 173, in WSGIServer
    from cheroot import wsgi
ModuleNotFoundError: No module named 'cheroot'

4

Re: 500 internal server error for /mail and /iredadmin after fresh install

Installing py311-cheroot from ports collection got rid of the error message, but still I get 500 error. This is the output of running the command in the console:

/usr/local/www/iredadmin # python3 iredadmin.py
htt p://0.0.0.0:8080/

5

Re: 500 internal server error for /mail and /iredadmin after fresh install

I think there is something not fully sound with the mariadb as well:

roundcube@127.0.0.1 [roundcubemail]> SELECT * FROM users;
Empty set (0.000 sec)

6

Re: 500 internal server error for /mail and /iredadmin after fresh install

I used htt ps://docs.iredmail.org/install.iredmail.on.freebsd.with.jail.html as the base but what I needed to do to be able to install iRedMail 1.7.1 in jail on FreeBSD 14.1 was the following:

I created jail as described in the guide

But before running the installer I had to manually install mariadb server (which also install the client) from packages/ports

# Install MySQL
pkg install mariadb1011-server-10.11.9

#Then create "admin_iredmail" user and set password as according to the guide about remote mysql server: ht tps://docs.iredmail.org/install.iredmail.with.remote.mysql.server.html

#This is required to stop some error message in /var/log/messages 
cd /usr/ports/security/openssl
make config
#Then select "LEGACY"
make

#Without installing this there are error messages in /var/log/messages
pkg install py311-cheroot-10.0.1

pkg install bash

#Installer script will choke if we don't add the following to 1.7.1/runtime/installer.status: export status_install_port_databases_mariadb106client='DONE'
#This stops the installer from trying and choking on installer mariadb-client as it already got installed when installing the server-component.

#Start bash
bash

#Then run:
USE_EXISTING_MYSQL='YES' \
    MYSQL_SERVER_ADDRESS='192.168.1.100' \
    MYSQL_SERVER_PORT='3306' \
    MYSQL_ROOT_USER='admin_iredmail' \
    MYSQL_ROOT_PASSWD='admin_password' \
    MYSQL_GRANT_HOST='192.168.1.200' \
    LOCAL_ADDRESS='192.168.1.200' \
    bash iRedMail.sh

7

Re: 500 internal server error for /mail and /iredadmin after fresh install

Did you ever consider running iRedMail on a Linux box? sad

8

Re: 500 internal server error for /mail and /iredadmin after fresh install

ZhangHuangbin wrote:

Did you ever consider running iRedMail on a Linux box? sad

No, that never crossed my mind smile


Here is the forum thread where I found information about legacy codecs for openssl: https://forum.iredmail.org/post89732.html#p89732

9

Re: 500 internal server error for /mail and /iredadmin after fresh install

amavisd wouldn't start automatically for me even though it was enabled in rc.conf -- fixing the permission of the config file fixed that:

chmod 644 /usr/local/etc/amavisd.conf