1

Topic: Using Nginx to host websites on the same server as iRedMail

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version: 14.2.1
- Deployed with iRedMail Easy or the downloadable installer?  Donwloaded Installer
- Linux/BSD distribution name and version: FreeBSD 13
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro?  Not yet
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

Hello iRedMail community,

My first post here so please be gentle. I have iRedMail installed on an AWS EC2 instance. I would like to host websites for several very low traffic domains that I own on the same server. Are there any compelling reasons as to why I should not? Is there some guidance out there as to best practices should I choose to host some domains as the same server I host iRedMail on?

Thanks for any thoughts.

----

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

2

Re: Using Nginx to host websites on the same server as iRedMail

John Ullom wrote:

Are there any compelling reasons as to why I should not?

Sure you can host extra web domains on iRedMail.

John Ullom wrote:

Is there some guidance out there as to best practices should I choose to host some domains as the same server I host iRedMail on?

Check files under /etc/nginx/sites-enabled/ for example. smile

3

Re: Using Nginx to host websites on the same server as iRedMail

I have a question.

I am running iredmail on ubuntu 22.04 with nginx.

I would like to create another website e.g. mywebsite.com so I have followed the following steps.

1. created a folder /var/www/mywebsite.com
2. created a static index.html file within my root folder above
3. create a mywebsite.com.conf under /etc/nginx/sites-available/mywebsite.com.conf
below is my server config

server{
     root /var/www/mywesite.com
     index index.html
     server_name mywebsite.com

}

4. created a symlink sudo ln  -s /etc/nginx/mywebsite.com.conf /etc/sites-enabled/
5. ran nginx -t and test is successful
6. restarted nginx sudo systemctl restart nginx

7. opened my browser to access the new site from t mywebsite.com and it failed to load or even find the server.

Please what am I doing wrong.

thanks

4

Re: Using Nginx to host websites on the same server as iRedMail

Did you set the DNS records?

5

Re: Using Nginx to host websites on the same server as iRedMail

After upgrading of roundcubemail 1.42 to 1.5.5 session time of is not working. Even after one hours session of login session shall be active. session timedout is already configured.

// Session lifetime in minutes
$config['session_lifetime'] = 10;

6

Re: Using Nginx to host websites on the same server as iRedMail

Cthulhu wrote:

Did you set the DNS records?

I am running this locally on my ubuntu 22.04 server.
I have set hostname as mywebsite.com
and I have also updated hosts file with 127.0.1.1 as mywebsite.com while 127.0.0.1 as localhost

thanks

7

Re: Using Nginx to host websites on the same server as iRedMail

this is not what DNS records are meant to be

as i said before, you need to set proper DNS records for each hosted domain, includeing subdomains, dki, spf, mx, etc etc

8

Re: Using Nginx to host websites on the same server as iRedMail

Cthulhu wrote:

this is not what DNS records are meant to be

as i said before, you need to set proper DNS records for each hosted domain, includeing subdomains, dki, spf, mx, etc etc

Does it mean that without proper DNS record I can't run another site on nginx. I thought with virtual hosts it will be simple to host more than just iredmail (roundcube and admin) on the server.

Please I am testing this on localhost before I can migrate to proper production environment.

thanks

9

Re: Using Nginx to host websites on the same server as iRedMail

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version: 1.6.8
- Deployed with iRedMail Easy or the downloadable installer?  Donwloaded Installer
- Linux/BSD distribution name and version: Ubuntu MATE 1.26.0 (Ubuntu 22.04.4 LTS)
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro?  Not yet
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

Another first time user...  Kid Gloves please and assume lack of knowledge.

I have a registered domain with DNS and MX records.

Fresh install of Ubuntu, fresh download of iRedMail 1.6.8 from the web site.

Install ran perfectly.

Set up an SSL certificate with Certbot/Letsencrypt and added it to site/iredmail without a problem.

Forwarded ports through the router...

<Everything going well>

I have a second machine on which I installed both Plex and Emby media servers.
It responds to connection on the LAN, but not from the WAN - most likely because of the SSL certificate.

I installed both on the same machine as iRedmail. Neither of the application responds on either the LAN or WAN... 

UFW is not active as the router controls access.
Ports are mapped correctly through the router to either machine (having chosen different ports.

I can't seem to set up the certificate path on the media servers on the iRedMail machine because the certificates are owned by root and in other user accounts I can't see the folder they are in.

Suggestions or ideas welcome.