1 (edited by mr.cocco 2012-06-01 17:17:15)

Topic: settings.ini permission issues

==== Provide required information ====
- iRedMail version and backend (LDAP/MySQL/PGSQL): 1.7.2 iRedAdmin-Pro-LDAP
- Linux/BSD distribution name and version: CentOS release 5.5 (Final)
- Any related log? Log is helpful for troubleshooting.

[Wed May 23 20:58:18 2012] [error] [client 10.91.254.254] mod_wsgi (pid=7384): Target WSGI script '/var/www/servicepanel/iredadmin.py' cannot be loaded as Python module.
[Wed May 23 20:58:18 2012] [error] [client 10.91.254.254] mod_wsgi (pid=7384): Exception occurred processing WSGI script '/var/www/servicepanel/iredadmin.py'.
[Wed May 23 20:58:18 2012] [error] [client 10.91.254.254] Traceback (most recent call last):
[Wed May 23 20:58:18 2012] [error] [client 10.91.254.254]   File "/var/www/servicepanel/iredadmin.py", line 9, in ?
[Wed May 23 20:58:18 2012] [error] [client 10.91.254.254]     from libs import iredbase
[Wed May 23 20:58:18 2012] [error] [client 10.91.254.254]   File "/var/www/servicepanel/libs/iredbase.py", line 34, in ?
[Wed May 23 20:58:18 2012] [error] [client 10.91.254.254]     webmaster = cfg.general.get('webmaster', 'root')
[Wed May 23 20:58:18 2012] [error] [client 10.91.254.254]   File "/usr/lib/python2.4/site-packages/web.py-0.34-py2.4.egg/web/utils.py", line 71, in __getattr__
[Wed May 23 20:58:18 2012] [error] [client 10.91.254.254]     raise AttributeError, k
[Wed May 23 20:58:18 2012] [error] [client 10.91.254.254] AttributeError: 'general'

====

Dear support,
attached to this post a file with some differences between my iRedAdmin panel and DEMO panel. IN particular I cannot see current quota usage for users of any domain and I cannot see some statistics link into dashboard.

The log pasted above instead is to be referred to an httpd error: it's logged in ssl_error_log if I not set chmod 555 on settings.ini in iredadmin webfolder.

Thanks for your collaboration.

2

Re: settings.ini permission issues

mr.cocco wrote:

[Wed May 23 20:58:18 2012] [error] [client 10.91.254.254]     raise AttributeError, k
[Wed May 23 20:58:18 2012] [error] [client 10.91.254.254] AttributeError: 'general'

File 'settings.ini' doesn't have correct file owner and permission, it should be owned by iredadmin:iredadmin, permission 0400. Please fix it first.

Could you please attach images directly? I cannot open OpenOffice document on my Mac.

3

Re: settings.ini permission issues

ZhangHuangbin wrote:
mr.cocco wrote:

[Wed May 23 20:58:18 2012] [error] [client 10.91.254.254]     raise AttributeError, k
[Wed May 23 20:58:18 2012] [error] [client 10.91.254.254] AttributeError: 'general'

File 'settings.ini' doesn't have correct file owner and permission, it should be owned by iredadmin:iredadmin, permission 0400. Please fix it first.

Could you please attach images directly? I cannot open OpenOffice document on my Mac.

I have just done:
chmod 0400 settings.ini
chown iredadmin:iredadmin settings.ini
[root@ired01 iredadmin]# ls -la settings.ini
-r-------- 1 iredadmin iredadmin 4629 May 23 14:08 settings.ini

and this is my ssl_error_log:
[Thu May 24 11:31:46 2012] [error] [client 10.50.2.2] mod_wsgi (pid=17323): Target WSGI script '/var/www/servicepanel/iredadmin.py' cannot be loaded as Python module.
[Thu May 24 11:31:46 2012] [error] [client 10.50.2.2] mod_wsgi (pid=17323): Exception occurred processing WSGI script '/var/www/servicepanel/iredadmin.py'.
[Thu May 24 11:31:46 2012] [error] [client 10.50.2.2] Traceback (most recent call last):
[Thu May 24 11:31:46 2012] [error] [client 10.50.2.2]   File "/var/www/servicepanel/iredadmin.py", line 9, in ?
[Thu May 24 11:31:46 2012] [error] [client 10.50.2.2]     from libs import iredbase
[Thu May 24 11:31:46 2012] [error] [client 10.50.2.2]   File "/var/www/servicepanel/libs/iredbase.py", line 34, in ?
[Thu May 24 11:31:46 2012] [error] [client 10.50.2.2]     webmaster = cfg.general.get('webmaster', 'root')
[Thu May 24 11:31:46 2012] [error] [client 10.50.2.2]   File "/usr/lib/python2.4/site-packages/web.py-0.34-py2.4.egg/web/utils.py", line 71, in __getattr__
[Thu May 24 11:31:46 2012] [error] [client 10.50.2.2]     raise AttributeError, k
[Thu May 24 11:31:46 2012] [error] [client 10.50.2.2] AttributeError: 'general'


And this is my firefox screenshot

Post's attachments

Cattura.JPG
Cattura.JPG 70.82 kb, file has never been downloaded. 

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

4

Re: settings.ini permission issues

Could you please show me output of below commands:

# ls -l /var/www/
# ls -l /var/www/iredadmin/*

5

Re: settings.ini permission issues

[root@ired01 ~]# ls -al /var/www/
total 140
drwxr-xr-x 20 root      root       4096 May 23 14:13 .
drwxr-xr-x 23 root      root       4096 Mar 23  2011 ..
drwxr-xr-x  3 root      root       4096 May 24 11:19 autodiscover
drwxr-xr-x  9 root      root      12288 May 28 23:01 awstats
drwxr-xr-x  2 root      root       4096 Aug 30  2010 cgi-bin
drwxr-xr-x  3 root      root       4096 Mar 23  2011 error
drwxr-xr-x  2 root      root       4096 May 23 15:46 html
drwxr-xr-x  3 root      root       4096 Mar 23  2011 icons
lrwxrwxrwx  1 root      root         24 May 23 14:13 iredadmin -> iRedAdmin-Pro-LDAP-1.7.2
drwxr-xr-x  8 root      root       4096 Mar 23  2011 iRedAdmin-0.1.3
drwxr-xr-x  9 iredadmin iredadmin  4096 May 11  2011 iRedAdmin-Pro-LDAP-1.4.1
drwxr-xr-x  9 iredadmin iredadmin  4096 Feb 23 00:13 iRedAdmin-Pro-LDAP-1.5.0
drwxr-xr-x  9 iredadmin iredadmin  4096 Oct 13  2011 iRedAdmin-Pro-LDAP-1.6.2
drwxr-xr-x  9 iredadmin iredadmin  4096 May 10 19:52 iRedAdmin-Pro-LDAP-1.6.3
dr-xr-xr-x  9 iredadmin iredadmin  4096 May 10 20:28 iRedAdmin-Pro-LDAP-1.7.0
drwxr-xr-x  9 iredadmin iredadmin  4096 May 23 14:33 iRedAdmin-Pro-LDAP-1.7.2
lrwxrwxrwx  1 root      root         29 Mar 23  2011 phpldapadmin -> /var/www/phpldapadmin-1.2.0.5
drwxr-xr-x 11 root      root       4096 Aug 26  2011 phpldapadmin-1.2.0.5
lrwxrwxrwx  1 root      root         41 Mar 23  2011 phpmyadmin -> /var/www/phpMyAdmin-2.11.10-all-languages
drwxr-xr-x 10 root      root       4096 Dec 26 17:38 phpMyAdmin-2.11.10-all-languages
lrwxrwxrwx  1 root      root         19 Mar  1 01:11 roundcubemail -> roundcubemail-0.7.1
drwxr-xr-x 11 root      root       4096 Mar  1 01:19 roundcubemail-0.3.1
drwxr-xr-x 11 root      root       4096 Mar  1 00:23 roundcubemail-0.3.1_delete
drwxr-xr-x 12 root      root       4096 May 24 15:58 roundcubemail-0.7.1
lrwxrwxrwx  1 root      root         24 May 23 14:10 servicepanel -> iRedAdmin-Pro-LDAP-1.7.2

[root@ired01 ~]# ls -al /var/www/iredadmin/*
-rw-r--r--  1 iredadmin iredadmin    49 May 15 11:12 /var/www/iredadmin/AUTHORS
-rw-r--r--  1 iredadmin iredadmin 15618 May 15 11:12 /var/www/iredadmin/ChangeLog.ldap
-rw-r--r--  1 iredadmin iredadmin   550 May 15 11:12 /var/www/iredadmin/EULA
-rw-r--r--  1 iredadmin iredadmin   402 May 15 11:12 /var/www/iredadmin/iredadmin.py
-rw-r--r--  1 iredadmin iredadmin   416 May 15 11:12 /var/www/iredadmin/README
-r--------  1 iredadmin iredadmin  4629 May 23 14:08 /var/www/iredadmin/settings.ini
-rw-r--r--  1 iredadmin iredadmin  4302 May 15 11:12 /var/www/iredadmin/settings.ini.ldap.sample

/var/www/iredadmin/controllers:
total 32
drwxr-xr-x 6 iredadmin iredadmin 4096 May 15 11:12 .
drwxr-xr-x 9 iredadmin iredadmin 4096 May 23 14:33 ..
drwxr-xr-x 2 iredadmin iredadmin 4096 May 15 11:12 amavisd
-rw-r--r-- 1 iredadmin iredadmin  927 May 15 11:12 decorators.py
-rw-r--r-- 1 iredadmin iredadmin    0 May 15 11:12 __init__.py
drwxr-xr-x 2 iredadmin iredadmin 4096 May 15 11:12 ldap
drwxr-xr-x 2 iredadmin iredadmin 4096 May 15 11:12 panel
drwxr-xr-x 2 iredadmin iredadmin 4096 May 15 11:12 policyd
-rw-r--r-- 1 iredadmin iredadmin  981 May 15 11:12 utils.py

/var/www/iredadmin/docs:
total 12
drwxr-xr-x 3 iredadmin iredadmin 4096 May 15 11:12 .
drwxr-xr-x 9 iredadmin iredadmin 4096 May 23 14:33 ..
drwxr-xr-x 2 iredadmin iredadmin 4096 May 15 11:12 samples

/var/www/iredadmin/i18n:
total 188
drwxr-xr-x 15 iredadmin iredadmin   4096 May 15 11:12 .
drwxr-xr-x  9 iredadmin iredadmin   4096 May 23 14:33 ..
-rw-r--r--  1 iredadmin iredadmin    778 May 15 11:12 babel.cfg
drwxr-xr-x  3 iredadmin iredadmin   4096 May 15 11:12 de_DE
drwxr-xr-x  3 iredadmin iredadmin   4096 May 15 11:12 en_US
drwxr-xr-x  3 iredadmin iredadmin   4096 May 15 11:12 es_ES
drwxr-xr-x  3 iredadmin iredadmin   4096 May 15 11:12 fi_FI
drwxr-xr-x  3 iredadmin iredadmin   4096 May 15 11:12 fr_FR
-rw-r--r--  1 iredadmin iredadmin 108655 May 15 11:12 iredadmin.po
drwxr-xr-x  3 iredadmin iredadmin   4096 May 15 11:12 it_IT
-rwxr-xr-x  1 iredadmin iredadmin   5501 May 15 11:12 msgfmt.py
drwxr-xr-x  3 iredadmin iredadmin   4096 May 15 11:12 nl_NL
drwxr-xr-x  3 iredadmin iredadmin   4096 May 15 11:12 pl_PL
drwxr-xr-x  3 iredadmin iredadmin   4096 May 15 11:12 pt_BR
drwxr-xr-x  3 iredadmin iredadmin   4096 May 15 11:12 ru_RU
drwxr-xr-x  3 iredadmin iredadmin   4096 May 15 11:12 sl_SI
-rw-r--r--  1 iredadmin iredadmin   2503 May 15 11:12 translation.sh
drwxr-xr-x  3 iredadmin iredadmin   4096 May 15 11:12 zh_CN
drwxr-xr-x  3 iredadmin iredadmin   4096 May 15 11:12 zh_TW

/var/www/iredadmin/libs:
total 84
drwxr-xr-x 6 iredadmin iredadmin  4096 May 15 11:12 .
drwxr-xr-x 9 iredadmin iredadmin  4096 May 23 14:33 ..
drwxr-xr-x 2 iredadmin iredadmin  4096 May 15 11:12 amavisd
-rw-r--r-- 1 iredadmin iredadmin   555 May 15 11:12 __init__.py
-rwxr-xr-x 1 iredadmin iredadmin  7770 May 15 11:12 iredbase.py
-rw-r--r-- 1 iredadmin iredadmin  4997 May 15 11:12 ireddate.py
-rw-r--r-- 1 iredadmin iredadmin 12933 May 15 11:12 iredutils.py
-rwxr-xr-x 1 iredadmin iredadmin  3569 May 15 11:12 languages.py
drwxr-xr-x 2 iredadmin iredadmin  4096 May 15 11:12 ldaplib
-rw-r--r-- 1 iredadmin iredadmin  2599 May 15 11:12 mailparser.py
-rw-r--r-- 1 iredadmin iredadmin  4200 May 15 11:12 md5crypt.py
drwxr-xr-x 2 iredadmin iredadmin  4096 May 15 11:12 panel
drwxr-xr-x 2 iredadmin iredadmin  4096 May 15 11:12 policyd
-rw-r--r-- 1 iredadmin iredadmin  7615 May 15 11:12 settings.py

/var/www/iredadmin/static:
total 28
drwxr-xr-x 4 iredadmin iredadmin 4096 May 15 11:12 .
drwxr-xr-x 9 iredadmin iredadmin 4096 May 23 14:33 ..
drwxr-xr-x 4 iredadmin iredadmin 4096 May 15 11:12 default
-rwxr-xr-x 1 iredadmin iredadmin  298 May 15 11:12 .htaccess
drwxr-xr-x 2 iredadmin iredadmin 4096 May 15 11:12 js
-rw-r--r-- 1 iredadmin iredadmin 8162 May 15 11:12 logo.png

/var/www/iredadmin/templates:
total 12
drwxr-xr-x 3 iredadmin iredadmin 4096 May 15 11:12 .
drwxr-xr-x 9 iredadmin iredadmin 4096 May 23 14:33 ..
drwxr-xr-x 7 iredadmin iredadmin 4096 May 23 15:01 default

/var/www/iredadmin/tools:
total 16
drwxr-xr-x 2 iredadmin iredadmin 4096 May 15 11:12 .
drwxr-xr-x 9 iredadmin iredadmin 4096 May 23 14:33 ..
-rw-r--r-- 1 iredadmin iredadmin 7035 May 15 11:12 dump_disclaimer.py

6

Re: settings.ini permission issues

Try this command to fix it:

# chmod -R 0555 /var/www/iredadmin/
# chmod 0400 /var/www/iredadmin/settings.ini

7

Re: settings.ini permission issues

ZhangHuangbin wrote:

Try this command to fix it:

# chmod -R 0555 /var/www/iredadmin/
# chmod 0400 /var/www/iredadmin/settings.ini

I did it but without success.
FYI, during my setup, I have changed the aliases in ssl.conf:
WSGIScriptAlias /servicepanel "/var/www/servicepanel/iredadmin.py/"
Alias /servicepanel/static "/var/www/servicepanel/static/"

and created the softlink for servicepanel, like iredadmin.

This my screen:

[root@ired01 ~]# chmod -R 0555 /var/www/iredadmin/
[root@ired01 ~]# chmod 0400 /var/www/iredadmin/settings.ini

[root@ired01 ~]# cat /var/log/httpd/ssl_error_log
[Sun May 27 04:02:37 2012] [warn] RSA server certificate CommonName (CN) `*.b2bservice.it' does NOT match server name!?
[Tue May 29 12:32:27 2012] [error] [client 10.50.2.10] mod_wsgi (pid=9971): Target WSGI script '/var/www/servicepanel/iredadmin.py' cannot be loaded as Python module.
[Tue May 29 12:32:27 2012] [error] [client 10.50.2.10] mod_wsgi (pid=9971): Exception occurred processing WSGI script '/var/www/servicepanel/iredadmin.py'.
[Tue May 29 12:32:27 2012] [error] [client 10.50.2.10] Traceback (most recent call last):
[Tue May 29 12:32:27 2012] [error] [client 10.50.2.10]   File "/var/www/servicepanel/iredadmin.py", line 9, in ?
[Tue May 29 12:32:27 2012] [error] [client 10.50.2.10]     from libs import iredbase
[Tue May 29 12:32:27 2012] [error] [client 10.50.2.10]   File "/var/www/servicepanel/libs/iredbase.py", line 34, in ?
[Tue May 29 12:32:27 2012] [error] [client 10.50.2.10]     webmaster = cfg.general.get('webmaster', 'root')
[Tue May 29 12:32:27 2012] [error] [client 10.50.2.10]   File "/usr/lib/python2.4/site-packages/web.py-0.34-py2.4.egg/web/utils.py", line 71, in __getattr__
[Tue May 29 12:32:27 2012] [error] [client 10.50.2.10]     raise AttributeError, k
[Tue May 29 12:32:27 2012] [error] [client 10.50.2.10] AttributeError: 'general'

[root@ired01 ~]# cat /var/log/httpd/ssl_access_log
10.50.2.10 - - [29/May/2012:12:32:24 +0200] "GET /servicepanel HTTP/1.1" 500 639

8

Re: settings.ini permission issues

mr.cocco wrote:

FYI, during my setup, I have changed the aliases in ssl.conf:
WSGIScriptAlias /servicepanel "/var/www/servicepanel/iredadmin.py/"
Alias /servicepanel/static "/var/www/servicepanel/static/"

- You should mention this change at the beginning.
- Try below settings instead, make sure you have "Alias" first, then "WSGIScriptAlias":

Alias /servicepanel/static "/var/www/iredadmin/static/"
WSGIScriptAlias /servicepanel "/var/www/iredadmin/iredadmin.py/"

9

Re: settings.ini permission issues

ZhangHuangbin wrote:
mr.cocco wrote:

FYI, during my setup, I have changed the aliases in ssl.conf:
WSGIScriptAlias /servicepanel "/var/www/servicepanel/iredadmin.py/"
Alias /servicepanel/static "/var/www/servicepanel/static/"

- You should mention this change at the beginning.
- Try below settings instead, make sure you have "Alias" first, then "WSGIScriptAlias":

Alias /servicepanel/static "/var/www/iredadmin/static/"
WSGIScriptAlias /servicepanel "/var/www/iredadmin/iredadmin.py/"

Sorry for my omission.
Same error.

10

Re: settings.ini permission issues

Do you have below line in /etc/httpd/conf.d/iredadmin.conf:

WSGISocketPrefix /var/run/wsgi
WSGIDaemonProcess iredadmin user=iredadmin threads=15
WSGIProcessGroup iredadmin

AddType text/html .py

<Directory /var/www/iredadmin/>
    Order allow,deny
    Allow from all
</Directory>

11

Re: settings.ini permission issues

Missing the first three rows.
Adding those lines solved the issue.

Thank you for your great support.
I'll open another ticket for missing features in iredadmin panel and try to rename this ticket.