1 (edited by zaggynl 2016-02-24 18:08:59)

Topic: Installation help on FreeBSD jail on FreeNAS

======== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.4
- Linux/BSD distribution name and version: FreeBSD 9.3-RELEASE-p31
- 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: see below
====

Hi, thanks for the installation script, make installing a lot easier!
Had to make a few changes otherwise it would get stuck:

Use newer OpenSSL version in ports, otherwise spamassassin doesn't compile:
echo WITH_OPENSSL_PORT=yes > /etc/make.conf

fix apache startup after running iRedmail.sh:
cd /usr/ports/devel/apr1
make deinstall
make clean config install
selected: ipv6, devrandom, bdm, gbdm, mysql and ssl
ok on next
service apache24 start

Current installation progress:
/mail and /SOGo links work

/iredadmin shows internal server error, /mail shows a high number of emails about sogo:

2016-02-24 04:34:00.496 sogo-tool[98502:101326] Table 'sogo.sogo_sessions_folder' doesn't exist
/usr/local/GNUstep/Local/Tools/Admin/sogo-tool: Uncaught exception ExecutionFailed, reason: Table 'sogo.sogo_sessions_folder' doesn't exist
Feb 24 04:34:00 sogo-ealarms-notify [98501]: [ERROR] <0x0x80bc28f70[GCSAlarmsFolder]> -[GCSAlarmsFolder recordsForEntriesFromDate:toDate:]: cannot execute fetch: <MySQL4Exception: 0x80bc2d0e0> NAME:ExecutionFailed REASON:Table 'sogo.sogo_alarms_folder' doesn't exist
Feb 24 04:34:00 sogo-ealarms-notify [98501]: [ERROR] <0x0x80bf33110[GCSAlarmsFolder]> -[GCSAlarmsFolder deleteRecordsForEntriesUntilDate:]: cannot delete record: <MySQL4Exception: 0x80bc2d860> NAME:ExecutionFailed REASON:Table 'sogo.sogo_alarms_folder' doesn't exist

httpd-error.log on /iredadmin browser attempt:

[Wed Feb 24 11:04:48.728943 2016] [wsgi:error] [pid 97025] [client 192.168.1.215:54603] Truncated or oversized response headers received from daemon process 'iredadmin': /usr/local/www/iredadmin/iredadmin.py

----

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

2

Re: Installation help on FreeBSD jail on FreeNAS

zaggynl wrote:

Use newer OpenSSL version in ports, otherwise spamassassin doesn't compile:
echo WITH_OPENSSL_PORT=yes > /etc/make.conf

Fixed in iRedMail development edition moment ago.

zaggynl wrote:

fix apache startup after running iRedmail.sh:
cd /usr/ports/devel/apr1
...
selected: ipv6, devrandom, bdm, gbdm, mysql and ssl

iRedMail-0.9.4 has them all selected. The point is, what's wrong with Apache (with default iRedMail settings)?

zaggynl wrote:

2016-02-24 04:34:00.496 sogo-tool[98502:101326] Table 'sogo.sogo_sessions_folder' doesn't exist
/usr/local/GNUstep/Local/Tools/Admin/sogo-tool: Uncaught exception ExecutionFailed, reason: Table 'sogo.sogo_sessions_folder' doesn't exist

A known "issue/bug" of SOGo. Restarting sogo service will trigger sogo to create required sql tables, that fixes it.

zaggynl wrote:

[Wed Feb 24 11:04:48.728943 2016] [wsgi:error] [pid 97025] [client 192.168.1.215:54603] Truncated or oversized response headers received from daemon process 'iredadmin': /usr/local/www/iredadmin/iredadmin.py

Could you please post full/context log? This log cannot help figure out the cause.

3 (edited by zaggynl 2016-02-24 23:28:30)

Re: Installation help on FreeBSD jail on FreeNAS

Thanks for responding.

Fixed in iRedMail development edition moment ago.

Thanks.

iRedMail-0.9.4 has them all selected. The point is, what's wrong with Apache (with default iRedMail settings)?

Had the same issue as person here: http://www.iredmail.org/forum/post46572.html#p46572
AH00526: Syntax error on line 1 of /usr/local/etc/apache24/Includes/awstats.conf:
Can't load driver file apr_dbd_pgsql.so
When attempting to start apache24

A known "issue/bug" of SOGo. Restarting sogo service will trigger sogo to create required sql tables, that fixes it.

Confirmed, thanks.

Could you please post full/context log? This log cannot help figure out the cause.

When browsing to https://hostip/iredadmin I receive an "Internal Server Error" page.
I have attached /var/log/httpd-error.log to this post.

Post's attachments

httpd-error.log 3.89 kb, 2 downloads since 2016-02-24 

You don't have the permssions to download the attachments of this post.

4

Re: Installation help on FreeBSD jail on FreeNAS

[Wed Feb 24 15:22:37.086764 2016] [wsgi:error] [pid 24703] [client 192.168.1.210:60145] Truncated or oversized response headers received from daemon process 'iredadmin': /usr/local/www/iredadmin/iredadmin.py

Didn't see this error before, no idea yet.
Does it work if you run iRedAdmin manually from console? e.g.

cd /usr/local/www/iredadmin/
python iredadmin.py

5 (edited by zaggynl 2016-02-26 18:24:02)

Re: Installation help on FreeBSD jail on FreeNAS

$ cd /usr/local/www/iredadmin/
$ python iredadmin.py 
Traceback (most recent call last):
  File "iredadmin.py", line 9, in <module>
    from libs import iredbase
  File "/usr/local/www/iRedAdmin-0.5/libs/iredbase.py", line 18, in <module>
    import iredutils
  File "/usr/local/www/iRedAdmin-0.5/libs/iredutils.py", line 14, in <module>
    import settings
ImportError: No module named settings
$ 
$ su
root@iredmail:/usr/local/www/iredadmin # python iredadmin.py 
http://0.0.0.0:8080

Seems to be a rights issue?

edit:

-r--------   1 root       iredadmin   1.5k Feb 24 02:01 settings.pyc

tried:

root@iredmail:/usr/local/www/iredadmin # chown iredadmin:iredadmin settings.pyc

Still internal server error
httpd.log:

[Fri Feb 26 11:22:26.614946 2016] [ssl:warn] [pid 1223] AH01906: www.example.com:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Fri Feb 26 11:22:26.615141 2016] [ssl:warn] [pid 1223] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Fri Feb 26 11:22:26.637952 2016] [ssl:warn] [pid 1224] AH01906: www.example.com:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Fri Feb 26 11:22:26.637990 2016] [ssl:warn] [pid 1224] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Fri Feb 26 11:22:26.698422 2016] [mpm_prefork:notice] [pid 1224] AH00163: Apache/2.4.18 (FreeBSD) OpenSSL/1.0.2f mod_wsgi/4.4.22 Python/2.7.11 configured -- resuming normal operations
[Fri Feb 26 11:22:26.698495 2016] [core:notice] [pid 1224] AH00094: Command line: '/usr/local/sbin/httpd -D NOHTTPACCEPT'
[Fri Feb 26 11:22:35.048783 2016] [wsgi:error] [pid 1229] [client 192.168.1.210:47009] Truncated or oversized response headers received from daemon process 'iredadmin': /usr/local/www/iredadmin/iredadmin.py
[Fri Feb 26 11:22:35.707513 2016] [core:notice] [pid 1224] AH00052: child pid 1225 exit signal Segmentation fault (11)

6

Re: Installation help on FreeBSD jail on FreeNAS

zaggynl wrote:

ImportError: No module named settings

Do you have file /usr/local/www/iredadmin/settings.py? (Note: it's "settings.py", not "settings.pyc".)

7

Re: Installation help on FreeBSD jail on FreeNAS

ZhangHuangbin wrote:
zaggynl wrote:

ImportError: No module named settings

Do you have file /usr/local/www/iredadmin/settings.py? (Note: it's "settings.py", not "settings.pyc".)

It does exist:

root@iredmail:/usr/local/www/iredadmin # ls -allh
total 156
dr-xr-xr-x   9 iredadmin  iredadmin    19B Feb 24 02:01 .
drwxr-xr-x   7 root       wheel         8B Feb 23 22:48 ..
-r-xr-xr-x   1 iredadmin  iredadmin    49B Jan 25 13:05 AUTHORS
-r-xr-xr-x   1 iredadmin  iredadmin   7.3k Jan 25 13:05 ChangeLog
-r-xr-xr-x   1 iredadmin  iredadmin    17k Jan 25 13:05 LICENSE
-r-xr-xr-x   1 iredadmin  iredadmin   439B Jan 25 13:05 README
dr-xr-xr-x   6 iredadmin  iredadmin    11B Feb 26 11:06 controllers
dr-xr-xr-x   3 iredadmin  iredadmin     4B Jan 25 13:05 docs
dr-xr-xr-x  18 iredadmin  iredadmin    22B Jan 25 13:05 i18n
-r-xr-xr-x   1 iredadmin  iredadmin   402B Jan 25 13:05 iredadmin.py
dr-xr-xr-x   6 iredadmin  iredadmin    20B Feb 26 11:06 libs
-r-x--x--x   1 iredadmin  iredadmin   3.6k Feb 23 22:48 settings.py
-r-xr-xr-x   1 iredadmin  iredadmin   4.0k Jan 25 13:05 settings.py.ldap.sample
-r-xr-xr-x   1 iredadmin  iredadmin   3.4k Jan 25 13:05 settings.py.mysql.sample
-r-xr-xr-x   1 iredadmin  iredadmin   3.4k Jan 25 13:05 settings.py.pgsql.sample
-r--------   1 iredadmin  iredadmin   1.5k Feb 24 02:01 settings.pyc
dr-xr-xr-x   4 iredadmin  iredadmin     6B Jan 25 13:05 static
dr-xr-xr-x   3 iredadmin  iredadmin     3B Jan 25 13:05 templates
dr-xr-xr-x   2 iredadmin  iredadmin    14B Feb 24 02:01 tools

8

Re: Installation help on FreeBSD jail on FreeNAS

Did you change any files under /usr/local/www/iredadmin?
Default file owner and permission should be:

cd /usr/local/www/
chown -R iredadmin:iredadmin iredadmin
chmod -R 0555 iredadmin
chmod 0400 iredadmin/settings.py*

Also, please show us full content of file "iredadmin.py", and try to run command "python iredadmin.py" under /usr/local/www/iredadmin/ directory.

9

Re: Installation help on FreeBSD jail on FreeNAS

Hi,

zaggynl wrote:

When browsing to https://hostip/iredadmin I receive an "Internal Server Error" page.

I had the same issue and the reason was that mysql was refusing connection from the jail's ip. This is probably because in a jail the source ip is always forced to be the ip assigned to the jail. I solved it by editing /usr/local/etc/my.cnf and uncommenting the bind-address line while changing 127.0.0.1 to the actual jail ip.

HTH & HAND,
Danny.

10 (edited by zaggynl 2016-03-02 03:13:12)

Re: Installation help on FreeBSD jail on FreeNAS

I ran

cd /usr/local/www/
chown -R iredadmin:iredadmin iredadmin
chmod -R 0555 iredadmin
chmod 0400 iredadmin/settings.py*

/usr/local/www/iredadmin contents:

root@iredmail:/usr/local/www/iredadmin # ls -allh
total 156
dr-xr-xr-x   9 iredadmin  iredadmin    19B Feb 24 02:01 .
drwxr-xr-x   7 root       wheel         8B Feb 23 22:48 ..
-r-xr-xr-x   1 iredadmin  iredadmin    49B Jan 25 13:05 AUTHORS
-r-xr-xr-x   1 iredadmin  iredadmin   7.3k Jan 25 13:05 ChangeLog
-r-xr-xr-x   1 iredadmin  iredadmin    17k Jan 25 13:05 LICENSE
-r-xr-xr-x   1 iredadmin  iredadmin   439B Jan 25 13:05 README
dr-xr-xr-x   6 iredadmin  iredadmin    11B Feb 26 11:06 controllers
dr-xr-xr-x   3 iredadmin  iredadmin     4B Jan 25 13:05 docs
dr-xr-xr-x  18 iredadmin  iredadmin    22B Jan 25 13:05 i18n
-r-xr-xr-x   1 iredadmin  iredadmin   402B Jan 25 13:05 iredadmin.py
dr-xr-xr-x   6 iredadmin  iredadmin    20B Feb 26 11:06 libs
-r--------   1 iredadmin  iredadmin   3.6k Feb 23 22:48 settings.py
-r--------   1 iredadmin  iredadmin   4.0k Jan 25 13:05 settings.py.ldap.sample
-r--------   1 iredadmin  iredadmin   3.4k Jan 25 13:05 settings.py.mysql.sample
-r--------   1 iredadmin  iredadmin   3.4k Jan 25 13:05 settings.py.pgsql.sample
-r--------   1 iredadmin  iredadmin   1.5k Feb 24 02:01 settings.pyc
dr-xr-xr-x   4 iredadmin  iredadmin     6B Jan 25 13:05 static
dr-xr-xr-x   3 iredadmin  iredadmin     3B Jan 25 13:05 templates
dr-xr-xr-x   2 iredadmin  iredadmin    14B Feb 24 02:01 tools
root@iredmail:/usr/local/www/iredadmin #

Running python iredadmin.py and browsing to http://LANIP:8080 shows a login page.

I've attached my iredadmin.py to this post.

I tried changing the mysql bind address in my.cnf to LAN ip but that resulted in:

Tue Mar 01 19:46:16.541915 2016] [dbd:error] [pid 29352] (20014)Internal error (specific information not available): AH00629: Can't connect to mysql: Can't connect to MySQL server on '127.0.0.1' (61)

in httpd-error.log

Post's attachments

iredadmin.py 402 b, 1 downloads since 2016-03-01 

You don't have the permssions to download the attachments of this post.

11

Re: Installation help on FreeBSD jail on FreeNAS

I'm confused ...

Is it possible to give me ssh access to fix it remotely? Please contact me via email: zhb _at_ iredmail.org.