# Installation in KVM

**URL:** <https://discourse.mailinabox.email/t/installation-in-kvm/1266>\
**Category:** Help with Setup/Upgrade\
**Created:** [May 24, 2016, 4:35pm UTC](https://discourse.mailinabox.email/t/installation-in-kvm/1266 "2016-05-24T16:35:42Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![arnold\_mad](https://discourse.mailinabox.email/letter_avatar_proxy/v4/letter/a/c0e974/32.png) [@arnold\_mad](https://discourse.mailinabox.email/u/arnold_mad)\
**Post date:** [May 24, 2016, 4:35pm UTC](https://discourse.mailinabox.email/t/installation-in-kvm/1266/1 "2016-05-24T16:35:43Z")

</div>

Hi !

I’m new to MIAB and want to try it on an existing Server inside a KVM.  
The basic setup of MIAB is done but when I check the status page it says that the ports are not accessible from outside:

Incoming Mail (SMTP/postfix) is running but is not publicly accessible at x.x.x.x:25.

but when I do the following from my home PC I see that the port is open and responding:  
telnet x.x.x.x 25  
Trying x.x.x.x…  
Connected to [box.maderthaner.net](http://box.maderthaner.net).  
Escape character is ‘^]’.  
220 [box.maderthaner.net](http://box.maderthaner.net) ESMTP Hi, I’m a Mail-in-a-Box (Ubuntu/Postfix; see [https://mailinabox.email/](https://mailinabox.email/))

so from that side it looks ok-ish. Can I savely ignore the errors as they happen for all ports (25,587,993,4190) ?

The other problem I have is that I run multiple other HTTPS enabled sites on my server and need to forward / proxy now the MIAB user interface into KVM. Does anyone have a working Apache2 Config for this or some guidance for it ?

Thanks !

yours

Arnold

---

<div class="post-metadata">

**Author:** ![arnold\_mad](https://discourse.mailinabox.email/letter_avatar_proxy/v4/letter/a/c0e974/32.png) [@arnold\_mad](https://discourse.mailinabox.email/u/arnold_mad)\
**Post date:** [May 24, 2016, 5:16pm UTC](https://discourse.mailinabox.email/t/installation-in-kvm/1266/2 "2016-05-24T17:16:19Z")

</div>

regarding the SSL I think I found a solution by obtaining a certificate from starssl and put it in my main Apache Server (that one that is connected to the internet) and configure the SSL connection between the apache server and the KVM MIAB NGINX server with the following config:  
ServerName [box.maderthaner.net](http://box.maderthaner.net)

```
ProxyRequests On
SSLProxyEngine On
SSLProxyEngine on
SSLProxyVerify none 
SSLProxyCheckPeerCN off
SSLProxyCheckPeerName off
SSLProxyCheckPeerExpire off

ProxyPass / https://192.168.122.99/
ProxyPassReverse / https://192.168.122.99/

SSLEngine on
	SSLCertificateFile /etc/myssl/box.maderthaner.net/2_box.maderthaner.net.crt
SSLCertificateKeyFile /etc/myssl/box.maderthaner.net/private.key
```

---

<div class="post-metadata">

**Author:** ![murgero](https://discourse.mailinabox.email/user_avatar/discourse.mailinabox.email/murgero/32/750_2.png) [@murgero](https://discourse.mailinabox.email/u/murgero)\
**Post date:** [May 24, 2016, 5:53pm UTC](https://discourse.mailinabox.email/t/installation-in-kvm/1266/3 "2016-05-24T17:53:48Z")

</div>

When installing MIAB in a VM (KVM, Xen, QEMU, etc) try to do a 1-1 NAT with a WAN ip address to MIAB for best results, IPTABLES is your best friend.

If you cannot give the MIAB server a wan ip, or nat to it, then try using a VPS hosting provider like DigitalOcean, VPSCheap, etc.

---

<div class="post-metadata">

**Author:** ![arnold\_mad](https://discourse.mailinabox.email/letter_avatar_proxy/v4/letter/a/c0e974/32.png) [@arnold\_mad](https://discourse.mailinabox.email/u/arnold_mad)\
**Post date:** [May 24, 2016, 6:06pm UTC](https://discourse.mailinabox.email/t/installation-in-kvm/1266/4 "2016-05-24T18:06:22Z")

</div>

I know that I could use DO or similar but I have a server on the net which is quite powerful but already hosts some websites (and it would be a waist of money to buy another server just for emailing).  
The thing is that the checks say that it doesn’t work but I can send/receive emails already. Anyone knows how this checks are performed ?

---

<div class="post-metadata">

**Author:** ![murgero](https://discourse.mailinabox.email/user_avatar/discourse.mailinabox.email/murgero/32/750_2.png) [@murgero](https://discourse.mailinabox.email/u/murgero)\
**Post date:** [May 25, 2016, 9:04pm UTC](https://discourse.mailinabox.email/t/installation-in-kvm/1266/5 "2016-05-25T21:04:36Z")

</div>

As long as MIAB can reach the internet AND the proper ports are open your your firewall / KVM host, you should be fine.

---

<div class="post-metadata">

**Author:** ![murgero](https://discourse.mailinabox.email/user_avatar/discourse.mailinabox.email/murgero/32/750_2.png) [@murgero](https://discourse.mailinabox.email/u/murgero)\
**Post date:** [May 25, 2016, 9:05pm UTC](https://discourse.mailinabox.email/t/installation-in-kvm/1266/6 "2016-05-25T21:05:07Z")

</div>

Also talk to your service provider about your PTR record (As it will be needed to receive email from some places)

---

<div class="post-metadata">

**Author:** ![murgero](https://discourse.mailinabox.email/user_avatar/discourse.mailinabox.email/murgero/32/750_2.png) [@murgero](https://discourse.mailinabox.email/u/murgero)\
**Post date:** [May 25, 2016, 9:11pm UTC](https://discourse.mailinabox.email/t/installation-in-kvm/1266/7 "2016-05-25T21:11:12Z")

</div>

Apache to do internal redirect to mail in a box KVM ip address might work:

[http://pastebin.com/AFWTF8Ak](http://pastebin.com/AFWTF8Ak)

Put the above config under sites-enabled/site\_config\_file.conf  
That will need apache rewrite and proxy modules installed and enabled.

or iptables to nat port 8080 to port 443 on your KVM (8080 or whatever port, like 4433 as an example)

But anyway, the above config is what I use in apache to redirect external BOSH requests to internal XMPP server for a service I run called airchat.urgero.org works for me like a dream.

---

<div class="post-metadata">

**Author:** ![system](https://discourse.mailinabox.email/uploads/default/original/2X/4/4d0933d13c456b7e57f296aa6cc344525b6f0c70.png) [@system](https://discourse.mailinabox.email/u/system)\
**Post date:** [June 1, 2016, 9:11pm UTC](https://discourse.mailinabox.email/t/installation-in-kvm/1266/8 "2016-06-01T21:11:14Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
