1

Topic: Installing iRedMail has broken web server

==== Required information ====
- iRedMail version: 0.8.5
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): LDAP
- Linux/BSD distribution name and version: Ubuntu 12.04
- Related log if you're reporting an issue:
====

Hi,

I have just installed iRedMail onto my server as per the guide. I previously had my Apache web server running fine on www.mydomain.com and set my host file as such for iRedMail:

127.0.0.1   mail.mydomain.com mydomain localhost localhost.localdomain
109.123.108.113 mydomain

Now, this has iRedMail working fine at mail.mydomain.com, however www.mydomain.com now redirects to www.mydomain.com/mail/, breaking my web server.

I can still access folders on my web server (such as www.mydomain.com/phpmyadmin/) and these work just fine. But the root URL always redirects to mail.

How can I keep the webmail and iRedMail admin etc just on the mail subdomain and keep my web server at mydomain.com running as normal for Apache?

Many thanks!

Sam

----

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

2

Re: Installing iRedMail has broken web server

samiles3 wrote:

Now, this has iRedMail working fine at mail.mydomain.com, however www.mydomain.com now redirects to www.mydomain.com/mail/, breaking my web server.

Hi Sam.

Good troubleshooting methods almost always involve working something backwards to find the fault.

wink

On my FreeBSD install of iRedMail, the first place I went to was the httpd.conf file:

john.blue@mail:/usr/local/etc/apache22 # more httpd.conf

and I found this line:

DocumentRoot "/usr/local/www/apache22/data"

Inside of the "data" directory is an "index.html" file:

john.blue@mail:/usr/local/www/apache22/data # more index.html
<html>
    <head>
        <meta HTTP-EQUIV="REFRESH" content="0; url=/mail/">
    </head>
</html>

As you can see here, there is somewhat of a redirect taking place in the index.html file to point to "/mail".  Here is where my lack of experience with iRedMail is going to betray me .. I can see two scenarios playing out:

a)  installing iRedMail completely wiped out your previous website (doubtful .. but I don't really know all the different ways one can foobar a non-fresh system)

or

b)  iRedMail was smart enough to see that previous html code was existing and simply renamed it as it did with the default index.html file on my install:

john.blue@mail:/usr/local/www/apache22/data # ls -la
total 20
drwxr-xr-x  2 root  wheel  512 Oct  7 15:03 .
drwxr-xr-x  6 root  wheel  512 Oct  7 14:51 ..
-rw-r--r--  1 root  wheel   98 Oct  7 15:03 index.html
-rw-r--r--  1 root  wheel   44 Oct  7 15:03 index.html.2013.10.07.14.49.46
-rw-r--r--  1 root  wheel   26 Oct  7 15:02 robots.txt

I suspect that if you can locate the similarly renamed file like the one on my server, you should be able to call it "index.html" and your website *should* be restored.

Hope that helps and good luck.

3

Re: Installing iRedMail has broken web server

You were right, it had created a index.html file with a redirect. I replaced it with the old one and everything is perfect now. Simple!

4

Re: Installing iRedMail has broken web server

samiles3 wrote:

You were right, it had created a index.html file with a redirect. I replaced it with the old one and everything is perfect now. Simple!

Wonderful!  Thanks for the feedback.

wink