1 (edited by arthurfabre 2012-02-05 22:05:10)

Topic: Setting iredmail as a virtual host

Hello,

I'm trying to set all the iredmail components (Rouncube, iredamin and awstats) to run under a name based virtual host in apache instead of the default one (as apache will also host my website). Am I correct in assuming that all the apache settings that iredmail needs are in the rouncube.conf, iredadmin.conf awstats.conf and ssl.conf files? In other words does the iredadmin installer modify the htppd.conf file?

Thanks a lot!

Arthur

iredmail 0.7.4
Centos 6.2 x64

----

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

2

Re: Setting iredmail as a virtual host

arthurfabre wrote:

Am I correct in assuming that all the apache settings that iredmail needs are in the rouncube.conf, iredadmin.conf awstats.conf and ssl.conf files? In other words does the iredadmin installer modify the htppd.conf file?

You're right.
iRedMail will modify httpd.conf and conf.d/ssl.conf, just a little changes.

Please refer to Apache manuals to setup virtual host.

3

Re: Setting iredmail as a virtual host

Thanks for your reply!
I'll go try that now - if I succeed I'll go ahead and post the <virtualhost> section if anyone else is interested.

4 (edited by arthurfabre 2012-02-08 20:54:10)

Re: Setting iredmail as a virtual host

Ok so I've merged all the files into one to create 2 virtual hosts, one for http and another for https, but I'm having a couple of issues.
Roundcube works fine, but I can't seem to access either dbmailadmin or iredadmin. Here's the file I created:

 
<VirtualHost *:80>
    ServerAdmin postmaster@domain.com
    DocumentRoot /var/www/html/
    ServerName mail.domain.com



#AWSTATS
<Directory /var/www/awstats/>
    DirectoryIndex awstats.pl
    Options ExecCGI
    Order allow,deny
    allow from all
    #allow from 127.0.0.1

    AuthName "Authorization Required"
    AuthType Basic

    AuthBasicProvider ldap
    AuthzLDAPAuthoritative   Off

    AuthLDAPUrl   ldap://127.0.0.1:389/o=domainAdmins,dc=doamin,dc=com?mail?sub?(&(objectclass=mailAdmin)(accountStatus=active))

    AuthLDAPBindDN "cn=vmail,dc=doamin,dc=com"
    AuthLDAPBindPassword "password"

    Require valid-user
</Directory>



#DBMAILADMIN
#WSGIScriptAlias /dbmailadmin /var/www/dbmailadmin/dbmailadmin.py/
#Alias /dbmailadmin/static /var/www/dbmailadmin/static/

WSGIDaemonProcess dbmailadmin user=dbmailadmin threads=15
WSGIProcessGroup dbmailadmin

AddType text/html .py

<Directory /var/www/dbmailadmin/>
    Order allow,deny
    Allow from all
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</Directory>



#IREDMAILADMIN
#WSGIDaemonProcess iredadmin user=iredadmin threads=15
#WSGIProcessGroup iredadmin

AddType text/html .py

<Directory /var/www/iredadmin/>
    Order allow,deny
    Allow from all
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</Directory>



#ROUNDCUBE
Alias / "/var/www/roundcubemail/"
<Directory "/var/www/roundcubemail/">
    Options -Indexes
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</Directory>




</VirtualHost>

<VirtualHost *:443>
    ServerAdmin postmaster@domain.com
    DocumentRoot /var/www/html/
    ServerName mail.domain.com


#ROUNDCUBE
Alias / /var/www/roundcubemail/

#AWSTATS
Alias /awstats/icon /var/www/awstats/icon/
ScriptAlias /awstats /var/www/awstats/

#IREDADMIN
WSGIScriptAlias /iredadmin /var/www/iredadmin/iredadmin.py/
Alias /iredadmin/static /var/www/iredadmin/static/

#DBMAILADMIN
WSGIScriptAlias /dbmailadmin /var/www/dbmailadmin/dbmailadmin.py/
Alias /dbmailadmin/static /var/www/dbmailadmin/static/



SSLEngine on
SSLProtocol +SSLv3 +TLSv1
SSLCACertificateFile path to crt
SSLCertificateFile path to crt
SSLCertificateKeyFile path to key
SSLCertificateChainFile path to crt

</VirtualHost>

Am I missing some directives? Both mail.domain.com/dbmailadmin and /iredadmin report as being not found.

Thanks a lot for everything, this community really is very helpful!

Arthur

5

Re: Setting iredmail as a virtual host

Not sure whether below setting is correct or not:

Alias / /var/www/roundcubemail/

Does iredadmin/dbmailadmin work if you change it to:

Alias /mail /var/www/roundcubemail/

6

Re: Setting iredmail as a virtual host

Ok, that was it, thanks a lot!
I am experiencing yet another problem though (I guess I must be particularly thick)
I can now access both iredadmin and dbmailadmin via http, but an https request returns the source code of the login page and not the actual page itself..
I've tried searching around, but I can't seem to find an actual answer..

(The only changes I've made to my config file were changing the / alias to /mail in both the virtual hosts)

Thanks a lot!
Arthur

7

Re: Setting iredmail as a virtual host

You didn't add below lines in https virtual host, it cannot handle Python files.

WSGIDaemonProcess dbmailadmin user=dbmailadmin threads=15
WSGIProcessGroup dbmailadmin

AddType text/html .py

8

Re: Setting iredmail as a virtual host

Thank you! Everything is now working perfectly!

I will be recommending this to anyone who listens!

9

Re: Setting iredmail as a virtual host

Appreciate your help to promote iRedMail project. Enjoy. smile

10 (edited by der_mythos 2012-02-20 01:54:04)

Re: Setting iredmail as a virtual host

Hi,

I think I have exactly the same problem as arthurfabre.

But unfortunately I have two problems:
1. His vhost file, doesn't work in my Case because I have no ldap installed.
2. I'm not shure which files I have to delete first before I could really start to test my configuration. Am I right, that it's just the files in /etc/apache2/conf.d and the /etc/apache2/sites-availibile/default-ssl ?


What to do about this?

With best regards Robin

Btw: I'm running Debian Squezze.

11

Re: Setting iredmail as a virtual host

der_mythos wrote:

Hi,

I think I have exactly the same problem as arthurfabre.

But unfortunately I have two problems:
1. His vhost file, doesn't work in my Case because I have no ldap installed.
2. I'm not shure which files I have to delete first before I could really start to test my configuration. Am I right, that it's just the files in /etc/apache2/conf.d and the /etc/apache2/sites-availibile/default-ssl ?


What to do about this?

With best regards Robin

Btw: I'm running Debian Squezze.

I'm quite stuck here. Would really appreciate some help.

Best regards Robin

12

Re: Setting iredmail as a virtual host

Hi Robin,

1) You don't need LDAP related settings if you're not running OpenLDAP.
2) Please create a new forum topic and clearly explain what you want, what you did/tried, what (error) message you got. So that others can help you.