1 (edited by mekitron 2018-07-06 17:54:43)

Topic: Separate Main Website & Mail

======== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 0.9.8 MariaDB edition
- Linux/BSD distribution name and version: Ubuntu 18.04 LTS on Optimized DigitalOcean droplet
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MariaDB/MySQL
- Web server (Apache or Nginx): Default Nginx
- Manage mail accounts with iRedAdmin-Pro? No
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

I recently installed iRedMail, and it works very well. There are no issues at all. I can send and reveive emails without any issues.

However, it doesn't let me host my website on mydomain.com as it redirects to mydomain.com/mail when typed.

I only want iRedMail to work on mail.mydomain.com and before I had done anything wrong I posted my concern here. I want to know what exactly I have to do to get this done without messing up my server? Should it be DNS changes? Host main website on a different IP, or create virtual hosts using Nginx on same server?

Thank you very much for help.

----

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

2

Re: Separate Main Website & Mail

Check file /var/www/html/index.html, this is where the redirection happens. You can remove this file if you want.

3

Re: Separate Main Website & Mail

I only commented out the contents of /var/www/html/index.html and wrote <h1>My Mail</h1> but then mail.mydomain.com also started showing 'My Mail' heading. It won't redirect until /mail is explicitly appended to mail.mydomain.com.

Is it possible to learn how iRedMail symlinks both mydomain.com and mail.mydomai.com under Nginx?

Many thanks.

4

Re: Separate Main Website & Mail

Default virtual host configured in Nginx by iRedMail is a catch-all domain, any domain points to your server IP address will get web pages under /var/www/html. If you want to host both mydomain.com and mail.mydomain.com, please add your own virtual host config file under /etc/nginx/sites-available/ (and create symbol links to /etc/nginx/sites-enabled/).

5 (edited by mekitron 2018-07-09 18:42:57)

Re: Separate Main Website & Mail

ZhangHuangbin wrote:

Any domain points to your server IP address will get web pages under /var/www/html.

If one uses two different IPs for mydomain.com and mail.mydomain.com, will there be any issues while sending and receiving emails?

Thanks.

6

Re: Separate Main Website & Mail

I'm afraid i don't quite understand your questions in last post. sad

7

Re: Separate Main Website & Mail

mekitron wrote:
ZhangHuangbin wrote:

Any domain points to your server IP address will get web pages under /var/www/html.

Does this mean if one uses a different IP of mydomain.com then there won't be any issue with sending and receiving emails? Will different IPs create any problem while setting up Let's Encrypt certificates?

Certificates are not tied to an IP address and mail is handled by the server defined in the MX record for mydomain.com. I haven't tried it, but there shouldn't be an issue hosting your website in /var/www/html as Zhang has said. If you have multiple IP addresses pointing to your iRedMail server and you want to host your website on the same server, it's a matter of configuring your server to serve the website on 1.2.3.4 and the webmail on 4.3.2.1.

If that's not the answer you're looking for, then I'm afraid I also don't understand you last post either.

8 (edited by mekitron 2018-07-09 18:44:44)

Re: Separate Main Website & Mail

I corrected my question. I want to assign different IPs to mydomain.com and mail.mydomain.com

9

Re: Separate Main Website & Mail

ZhangHuangbin wrote:

Check file /var/www/html/index.html, this is where the redirection happens. You can remove this file if you want.

I removed this file and mail.mydomain.com stopped working.