OPNsense Forum

English Forums => General Discussion => Topic started by: uslte on June 16, 2020, 09:54:31 PM

Title: WebHosting on OPNSense
Post by: uslte on June 16, 2020, 09:54:31 PM
I have searched and searched and have not found the answers I have been looking for so I thought a shout out might be in order.

What I am trying to do is use a mini-pc with OPNSense installed (which is working splendidly) and host a media server like emby  (https://emby.media/).  Additionally, I would like to use it as a web server. 

I have seen much about NGINX, but there are many warnings not to use it in this way due to security issues and PHP active  queries.

Thanks in advance for the help and advice.
Title: Re: WebHosting on OPNSense
Post by: marjohn56 on June 16, 2020, 11:38:01 PM
Opnsense is Hardened FreeBSD, so there is no choice. If it was me I'd run both as VMs, one VM for Opnsense and I would use Ubuntu to host the webserver on a second VM. One Virtual switch connected to one of your NICs as the LAN side and another for the WAN side for Opnsense. There are various Hypervisors around, I've used ESXI on baremetal in the past to do what you want to do, not the most friendly to set up but it works. VirtualBox is fine, but if you are running Windows10  Pro you can use HyperV which is pretty easy to set up - I use it for testing some scenarios.
Title: Re: WebHosting on OPNSense
Post by: fabian on June 17, 2020, 07:09:57 AM
You can use the nginx plugin for basic PHP execution but OPNsense is quite limited. For example, there is no database server running except redis and you can use sqlite.

Also if your web application runs on OPNsense and has a security flaw, it can mean that your whole network gets compromised.

This plugin feature has been added for home users where power consumption is an important factor but in enterprise environments you should use separate servers to deploy the application.
Title: Re: WebHosting on OPNSense
Post by: uslte on June 17, 2020, 08:26:28 PM
Quote from: marjohn56 on June 16, 2020, 11:38:01 PM
Opnsense is Hardened FreeBSD, so there is no choice. If it was me I'd run both as VMs, one VM for Opnsense and I would use Ubuntu to host the webserver on a second VM. One Virtual switch connected to one of your NICs as the LAN side and another for the WAN side for Opnsense. There are various Hypervisors around, I've used ESXI on baremetal in the past to do what you want to do, not the most friendly to set up but it works. VirtualBox is fine, but if you are running Windows10  Pro you can use HyperV which is pretty easy to set up - I use it for testing some scenarios.

This is exactly what my thoughts were.  Thanks for the feedback!