Apache in OpenEMR docker container

Hello all,

I’m evaluating 5.0.2 for deploying in a small clinic. We already have a website hosting by a 3rd party vendor. We thought of bringing it in house to run side by side with openemr. I’m not exactly well versed with Apache, much less when it runs inside a container. Could some kind soul point out to me how to configure virtual hosts in the openemr container?

The thing that trips me is that /etc/apache2/ does not have the usual “sites-enabled” folder. I tried to add another block of <VirtualHost *:8066> in the openemr.conf but it doesn’t seem to work. I had tried this:

<VirtualHost *:8066>
DocumentRoot /var/www/localhost/htdocs/test

Thanks,
–cuong

It probably /did/ work – test it by connecting to the container and checking for the local port to be open – but if you want to expose ports from the guest container on the host, you need to look at the docker-compose file that launched OpenEMR too.

Hi Asher,

Thanks for replying. I did map port 8066 (8066:8066) in the docker compose file and verify it afterwards (docker port shows 8066/tcp -> 0.0.0.0:8066). After that I exec-ed into the openemr container and added a virtual host to /etc/apache2/conf.d/openemr.conf. The “new” site index file is in /var/www/localhost/test.

Did I miss anything? One thing I’ve noticed though: openemr.conf already has a DocumentRoot outside the VitualHost (80) block. If I move it inside the block then I can’t bring up openemr as it reverts to using the DocumentRoot defined in /etc/apache2/httpd.conf

–cuong

I did the following and it worked!

Create a new conf file and add the virtual host in there. Also add the listen port directive on top.

1 Like