1 (edited by Maverick87Shaka 2015-11-03 02:57:54)

Topic: iRedMail with Apache running other websites/domain. Issue with one!

======== Required information ====
- iRedMail version: 0.9.2
- Linux/BSD distribution name and version: Debian8 (jessie) 64Bit
- Store mail accounts in which backend: MySQL
- Web server: Apache 2.4.10 Debian
- Manage mail accounts with iRedAdmin-Pro?
====
Hi everybody,
I'm switching from a self configured web server only ( LAMP ) to a iRedMail to start using the email service on my own server.
I made a clean install of the server with the Debian 8 and then I run the installation of iRedMail and the email side works really good. ( thanks iRedMail! )

I've imported my "old" website vhost in the sites-available, and then I made the classics ln -s of them and restarted apache! This is the problem!
I have 4 more website/domain to manage, but i don't know why, three of them works good, one is making something really strange.
If I try to navigate to "MyDomain3.com" i was redirected to the roundcube webmail ( normally accessible via "MyFQDN/mail" )  and not to my /var/www/MyDomadin3

All the other MyDomain** has exactly the same file only changed in ServerName,ServerAlias and of course the file location in the two lines.

Another strange things it's that I cant login in the awstats, when I point my browser to the url of my awstats I have the pop-up to enter username/password, but the postamaster@FQDN doesn't works! And the strange things is confirmed on file iRedMail.tips the url/user/and password

----

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

2

Re: iRedMail with Apache running other websites/domain. Issue with one!

Maverick87Shaka wrote:

If I try to navigate to "MyDomain3.com" i was redirected to the roundcube webmail ( normally accessible via "MyFQDN/mail" )  and not to my /var/www/MyDomadin3

Does it have proper DocumentRoot?

Maverick87Shaka wrote:

Another strange things it's that I cant login in the awstats, when I point my browser to the url of my awstats I have the pop-up to enter username/password, but the postamaster@FQDN doesn't works! And the strange things is confirmed on file iRedMail.tips the url/user/and password

Please reset your password to a salted MD5 password hash. Here's the tutorial:
http://www.iredmail.org/docs/reset.user.password.html

3 (edited by Maverick87Shaka 2015-11-03 10:49:33)

Re: iRedMail with Apache running other websites/domain. Issue with one!

ZhangHuangbin wrote:
Maverick87Shaka wrote:

If I try to navigate to "MyDomain3.com" i was redirected to the roundcube webmail ( normally accessible via "MyFQDN/mail" )  and not to my /var/www/MyDomadin3

Does it have proper DocumentRoot?

Maverick87Shaka wrote:

Another strange things it's that I cant login in the awstats, when I point my browser to the url of my awstats I have the pop-up to enter username/password, but the postamaster@FQDN doesn't works! And the strange things is confirmed on file iRedMail.tips the url/user/and password

Please reset your password to a salted MD5 password hash. Here's the tutorial:
http://www.iredmail.org/docs/reset.user.password.html

I followed the guide to reset my password, using generated MD5 with openssl passwd -1 MyPwd and update with:
sql> USE vmail;
sql> UPDATE mailbox SET password='{MD5}TheCodeGenerated' WHERE username='postmaster@mydomain.com';

But I continue to be unable to login on awstats with my account postamaster.
The browser continue to ask me to insert user and password.

################################

BTW, for the other problem of integrating other website I try again on a new fresh install of Ubuntu 14.04, installed iRedMail first and then copy all my website to /var/www/, gived the owning to www-data to avoid any kind of problem, and checked again all the documentroot of my vhost file ( I have a different file for each domain )

In this new installation, 2 website of my total of 4 is now working.
On two of this domain when i try to connect i was redirected to:
1 => browser pointing to w_w_w.MYdomain1.c_o_m or simple domain1.c_o_m => redirected to http_S://MYdomain1.c_o_m/mail with a prompt of webmail roundcube login
2 => browser pointing to w_w_w.domain2.c_o_m or simple domain2.c_o_m =>redirected to http_S://domain2.c_o_m/mail with a prompt of webmail/roundcube.

Seems that the config of webamil/roundcube is quite "verbose" and "override" my vhost ServerName & ServerAlias instead looking only for FQDN/mail where the FQDN is the one asked during the iRedMail setup and the one with all generated link


here attached the two .conf file inside sites-available, one of working website, the other with exactly the same style doesn't working redirecting to roundcube!!
al the document root are valid!

The problem of login into awstats remain also on the new server with Ubuntu 14.04!

Post's attachments

rampc.conf 424 b, 1 downloads since 2015-11-03 

soccorsosanfilippo.conf 489 b, 1 downloads since 2015-11-03 

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

4

Re: iRedMail with Apache running other websites/domain. Issue with one!

The Awstats login issue, should be solved with a salted MD5 password hash. I'm not sure whether you reset it to a correct one.

About web site redirection, check /var/www/index.html first, it will redirect requests to webmail. But if you have correct DocumentRoot, it won't be triggerred.

By the way, do you enable your Apache vhost config file with 'a2enconf' command? e.g. 'a2enconf rampc'.

5

Re: iRedMail with Apache running other websites/domain. Issue with one!

in dafault configuration of iRedMail on Debian7 the apache "user" is root? I think I made mistake on my first try in Debian becouse i set owner user/group of the domain folder too www-data, isn't it in debian 7?

6

Re: iRedMail with Apache running other websites/domain. Issue with one!

It's 'www-data' by default.

7 (edited by Maverick87Shaka 2015-11-05 20:49:17)

Re: iRedMail with Apache running other websites/domain. Issue with one!

Again here,
I have new, fresh Debian 7 installation, reinstalled iRedMail first as usual and then I have made the same steps to import my webiste, the same .config file for all my domain but using a2ensite to enable the website in apache instead making manual symbolic link ( ln -s ) and now seems works.
I've changed another little things of the default and default-ssl to move my "general" page from original /var/www/ to /var/www/html, but really I don't know if it's related too.
At the moment all my 4 domain seems work, even if I noticed a little performance "drop" but i know the mail process is not so "light", so due to the load of the server I think it's acceptable

Actually, even the rest of the problems seems ok, access to my awstats still not working, I've tried again to generate the new password and "force" into the vmail database but I continue to receive the error message

( I've replaced also the ssl certificate with one that i own that is validated and not annoying my webmail user about certs, it could be related for awstats? ) Unfortunately I haven't try the awstat before replace ssl cert in the apache configuration.

8

Re: iRedMail with Apache running other websites/domain. Issue with one!

Maverick87Shaka wrote:

also now, i can't get access to my awstats, I've tried again to generete the new password and "force" into the vmail databse but i continue to receive the error message

Please show us how you generate new password and update sql record.

Also, if it still doesn't work for you, you may want to switch SQL based authentication for Awstats to file based authentication.

9

Re: iRedMail with Apache running other websites/domain. Issue with one!

ZhangHuangbin wrote:
Maverick87Shaka wrote:

also now, i can't get access to my awstats, I've tried again to generete the new password and "force" into the vmail databse but i continue to receive the error message

Please show us how you generate new password and update sql record.

Also, if it still doesn't work for you, you may want to switch SQL based authentication for Awstats to file based authentication.

Hi,
this is the code that I'm using following the page that you provide:

root@server:~# doveadm pw -s 'MD5' -p 'password345' | awk -F'{MD5}' '{print $2}'
$1$96s0Jt1c$2gMMrvK2ZhvyOfB2RzGI40
root@server:~# ^C
root@server:~# mysql -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2806
Server version: 5.5.46-0+deb7u1 (Debian)

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> USE vmail;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> UPDATE mailbox SET password='{MD5}$1$96s0Jt1c$2gMMrvK2ZhvyOfB2RzGI40' WHERE username='postmaster@local.rampc.it';
Query OK, 1 row affected (0.01 sec)
Rows matched: 1  Changed: 1  Warnings: 0

Something change, because if i try to login to my webmail or iredadmin panel with my postmaster account, I have to use the new passowrd, but if I put as login when prompted in my broeser user: postmaster@local.rampc.it and password345 it's come back the prompt because the password is wrong, tried out with Chrome, Firefox and also IE, all the same things.

So, due to awstats is not security related for me, can I switch only the awstats to plain text using different password ( and maybe login if it's possible ). there is a guide that i can follow to change only awstats to plain text authentication?

thanks again!

10

Re: iRedMail with Apache running other websites/domain. Issue with one!

Maverick87Shaka wrote:

mysql> UPDATE mailbox SET password='{MD5}$1$96s0Jt1c$2gMMrvK2ZhvyOfB2RzGI40' WHERE username='postmaster@local.rampc.it';

Please remove the password scheme '{MD5}'.

11

Re: iRedMail with Apache running other websites/domain. Issue with one!

ZhangHuangbin wrote:
Maverick87Shaka wrote:

mysql> UPDATE mailbox SET password='{MD5}$1$96s0Jt1c$2gMMrvK2ZhvyOfB2RzGI40' WHERE username='postmaster@local.rampc.it';

Please remove the password scheme '{MD5}'.

Now it's working! there is some "security" related problem using a MD5 password on my database? I reed in that guide to reset is not recommended to use a MD5 password.........what do you think about it ? If there is a security related problem can I create a new account only to login in awstats ( maybe also with plain text ) and leave the standard codification for the admin postmaster account?

Thanks again, I made also other test and now all the domain seems works, seams apache2 installed with iRedMail react better with a2ensite rather make a symbolic link manually, I don't know way!

12

Re: iRedMail with Apache running other websites/domain. Issue with one!

Maverick87Shaka wrote:

Now it's working! there is some "security" related problem using a MD5 password on my database? I reed in that guide to reset is not recommended to use a MD5 password.........what do you think about it ? If there is a security related problem can I create a new account only to login in awstats ( maybe also with plain text ) and leave the standard codification for the admin postmaster account?

MD5 password hash is crackable, you can find many MD5 crack tool online. So we recommend and use stronger SSHA512 by default.