Help with ZoneMinder

Hello Virtualmin People,
I’ve just re-built my system with Ubuntu Server 16.04.2 and installed Webmin (like I always do) and Virtualmin (new to me).
I’ve set up three virtual hosts with Virtualmin and they are all working fine. Loving the ease of set up with Virtualmin.

Here’s the thing, I use ZoneMinder for my IP camera.
ZoneMinder is installed and running and not giving any error messages on start up, I created it’s MySQL database on install and it’s connecting to it just fine.
ZoneMinder is viewed and managed through a browser based console.
It’s default web output is the Apache default server /zm (with Ubuntu it’s always /var/www/zm).
When I visit my http://example.com/zm all I get is a blank page. Same when I visit http://my-example-ip/zm.
When I right click, view source code in my browser of the blank page I can see the code of index.php of ZoneMinder.
My server doesn’t seem to be parsing php into HTML like it should be?
It looks to me like Virtualmin has somehow disabled the Apache default server because it has told Apache to not serve PHP or MySQL from outside the home directory? Something to do with suexec maybe?

I thought about tricking Apache by making another Virtualmin virtual host with an MySQL database the same as the ZoneMinder one, “ZM” but I got a warning about the database already existing and wasn’t sure if it would be overwritten with blank data if I proceeded.
Can anyone tell me whether that happens?

I also wasn’t sure how to change the Virtualmin virtual host document root to var/www either. I know how to do that when I’m not using Virtualmin, and using Webmin, I don’t think Virtualmin allows for that? and I was wanting to stick with Virtualmin.

I’m stuck for ideas on what to try next.
Any ideas would be much appreciated.

Cheers,
Andrew

Hello Andrew,

Lets be sure first that PHP is indeed running on your virtual server before going on further.

Create a simple file called info.php with this code:

<?php phpinfo(); ?>

Upload it to the server created in Virtualmin and check if you get an output. If you can see PHP code in your browser then it means its not rendering PHP.

There is no need to use /var/www either or install your application there. That will surely not work.

Virtualmin is creating accounts usually under
/home/user

This means that PHP is also executed in your Virtual Servers, but not by default in your Apache config under /var/www

That should only display the default Apache page but its not actually configured to be used with Virtualmin so it will not render PHP either if you are actually trying to run things from the default location. You can of course, but then you don’t need Virtualmin either…

Make you you are installing and uploading the files under the same host you created in Virtualmin like:
/home/yourdomain/public_html

If you load the IP of your server by default it will show the first account you created with Virtualmin. If you are coming from Webmin, Webmin will use all the defaults (hence you are looking the Apache default path…), but with Virtualmin the approach is different. Virtualmin creates apache virtual hosts under each user account, every user with its own separated configuration like:
home/user1
home/user2

And same is true for its PHP configuration like:
home/user1/etc0/php5/php.ini
home/user2/etc/php5/php.ini

Or where you would run your web application:
home/user1/public_html

You can of course change all paths as desired.

Hello Volk, thanks for your reply.
I solved the issue by doing the following.
I reinstalled Ubuntu server, then installed ZoneMinder then Virtualmin.
By doing it in this order it all works.