1

Topic: Add domain/subdomain

==== Required information ====
- iRedMail version: 0.8.3
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MYSQL
- Linux/BSD distribution name and version: CentOS x64 6.4
- Related log if you're reporting an issue: subdomain problem
I added few subdomains but mail.domain.name does not work. I have added it to dns zone and added a virtualhost in httpd.conf but whenever i try to connect to mail.domain.name it redirects me to /var/www/html. Looking into the logs i cannot see anything related and I dont remember to had this problems with older versions.
I`ve also read http://www.iredmail.org/forum/topic3907 … hosts.html but still no fix because as soon as I modify the roundcubemail.conf the other subdomains fail to load or get redirected to wrong paths.

Added to /etc/httpd/conf/httpd.conf
#mail.domain.name
<VirtualHost *:80>
   ServerAdmin root@localhost
    DocumentRoot /var/www/roundcubemail
    ServerName mail.domain.namme
    ErrorLog /var/log/httpd/mail.domain.name-errorr.log
    CustomLog /var/log/httpd/mail.domain.name-access.log common
</VirtualHost>

2

Re: Add domain/subdomain

Show us what you added please.

3 (edited by ColdAsIce 2013-03-31 07:04:33)

Re: Add domain/subdomain

The following lines were added into /etc/httpd/conf/httpd.conf

#10.0.0.100 - 10.0.0.200 - default catch all
<VirtualHost *:80>
        ServerAdmin root@localhost
        DocumentRoot /var/www/html
        ErrorLog /var/log/httpd/10.0.0.100-200-errorr.log
        CustomLog /var/log/httpd/10.0.0.100-200-access.log common
</VirtualHost>

#subdomain1.domain.name
<VirtualHost *:80>
        ServerAdmin root@localhost
        DocumentRoot /var/www/subdomain1.domain.name
        ServerName subdomain1.domain.name
        ErrorLog /var/log/httpd/subdomain1.domain.name-errorr.log
        CustomLog /var/log/httpd/subdomain1.domain.name-access.log common
</VirtualHost>

#www.domain.name
<VirtualHost *:80>
        RewriteEngine On
        RewriteCond %{HTTP_HOST} !^www\.(.*)$ [NC]
        RewriteRule ^(.*)$ http://www.domain.name$1 [R=301,L]
        ServerName www.domain.name
        ServerAlias domain.name
        DocumentRoot /var/www/www.domain.name
        ErrorLog /var/log/httpd/www.domain.name-error.log
        CustomLog /var/log/httpd/www.domain.name-access.log common
</VirtualHost>

#mail.domain.name
<VirtualHost *:80>
        ServerAdmin root@localhost
        DocumentRoot /var/www/roundcubemail
        ServerName mail.domain.name
        ErrorLog /var/log/httpd/mail.domain.name-errorr.log
        CustomLog /var/log/httpd/mail.domain.name-access.log common
</VirtualHost>

1) http : 10.0.0.100 - 10.0.0.200 - works ok
2) http : subdomain1.domain.name - works ok
3) http : domain.name - works ok
4) http : mail.domain.name - does not work, it redirects me to SSL version of /var/www/html

I`ve rolled back all files from /etc/httpd/conf.d/ to default configuration, doubled checked DNS zones to see if I missed anything and nothing.

4

Re: Add domain/subdomain

ColdAsIce wrote:

#10.0.0.100 - 10.0.0.200 - default catch all
<VirtualHost *:80>

Does mail.domain.name work if you change above catch-all domain to "<VirtualHost _default_:80>"?
Reference: http://httpd.apache.org/docs/2.2/vhosts/examples.html

5

Re: Add domain/subdomain

I`ve modified the default catch all line with <VirtualHost _default_:80>, restarted httpd but no effect, mail.domain.name is still redirected to SSL version of /var/www/html/
Also i have discovered that all SSL versions of domain.name, subdomain1.domain.name are redirected to the same page ( SSL version of /var/www/html )
I will install a virtual machine with an older version ( i know this problem wasnt present in 0.7.3 ) and check the differences.

6 (edited by ColdAsIce 2013-04-01 16:01:47)

Re: Add domain/subdomain

I`ve managed to do a workaround by not forcing users to use HTTPS for roundcube ( $rcmail_config['force_https'] = false; );
Its not a good option but at least it works, still need to investigate why HTTPS://mail.domain.name isnt redirected to correct adress.