Wrong permissions set for PHP?

Hi there team! We had migrated a complete virtualmin/webmin setup from one system to another. We noticed the permissions were not working correctly on the new system. Whenever someone orders a new website, we have to go through some hoops to get it working. We first need to go to the Apache settings and find the new website. Then we go to the User and Group setting and we have to switch Run CGI Program as User from global configuration instead of Unix user. We have to do the same for the port 443 configuration. After that, we have to go switch the PHP version of the website and then switch it back and then it finally works. Otherwise, if we don't do all the above, we just get an internal server error. Please help, not sure what the correct permissions are and where they need to be applied. Thank you!

Status: 
Active

Comments

Ilia's picture
Submitted by Ilia on Tue, 08/25/2020 - 07:31

Hi,

Virtualmin has an ability to check and even fix permission issues on Limits and Validation/Validate Virtual Servers page. Try using Fix Permissions tab and run config check afterwards. Let us know if it fixes an issue for you.

By the way daemex.io is a very nice looking webiste!

thedaemexco's picture
Submitted by thedaemexco on Tue, 08/25/2020 - 09:22 Pro Licensee

Hi Ilia, thank you for your kind words on the website, It's all managed with Virtualmin software ;)

The Fix Permissions setting is something we've already tried and it didn't seem to fix it. So I think we have the wrong permissions set for PHP itself/web user. We would appreciate if someone can take a look at our permissions! Thank you.

Ilia's picture
Submitted by Ilia on Tue, 08/25/2020 - 14:48

Whenever someone orders a new website, we have to go through some hoops to get it working.

Wait, does this happen on newly created domains as well or on only those that were migrated?

Then we go to the User and Group setting and we have to switch Run CGI Program as User from global configuration instead of Unix user. We have to do the same for the port 443 configuration.

What options change in particular do you refer to?

After that, we have to go switch the PHP version of the website and then switch it back and then it finally works.

It is possible to run it from the script and to fix all domains in batch. For example:

#!/bin/sh
doms=`virtualmin list-domains --name-only --no-alias`
for dom in $doms; do
   virtualmin disable-feature --domain $dom --web --ssl --logrotate --webalizer --virtualmin-awstats --virtualmin-dav
   virtualmin enable-feature --domain $dom --web --ssl --logrotate --webalizer --virtualmin-awstats --virtualmin-dav
done

What OS distro and version is this? Did you install Virtualmin using official install script? How did you migrate?

thedaemexco's picture
Submitted by thedaemexco on Sun, 08/30/2020 - 11:34 Pro Licensee

Hi Ilia,

This happens on all created domains and ones that are migrated as well. By changing php versions, we just go set the php version from the default 7.2 to php 5 and then we switch it back to php 7.2 and then suddenly the internal error is gone when loading the websites. It's some sort of permission error we have with PHP itself, not sure how to resolve this. Looking forward to hearing back from you.

Ilia's picture
Submitted by Ilia on Mon, 08/31/2020 - 05:26

What error exactly get logged?

Do you run latest Webmin 1.955 and Virtualmin 6.12? What distro and version is this?

thedaemexco's picture
Submitted by thedaemexco on Thu, 09/10/2020 - 17:32 Pro Licensee

Hi Ilia,

This is our versioning:

Webmin version 1.942 Usermin version 1.791 Virtualmin version 6.09 Pro Cloudmin version 9.5 Pro

We are running on Centos 7.

Would you guys like a a test user and URL so you can check? Thanks!

Ilia's picture
Submitted by Ilia on Thu, 09/10/2020 - 17:36

Webmin version 1.942 Usermin version 1.791 Virtualmin version 6.09 Pro Cloudmin version 9.5 Pro

You really need to upgrade. These packages are pretty dated, and with bugs.

You can run the following command (a script from your account with additional -s param) to setup/update repos and exit:

wget -O install.sh https://software.virtualmin.com/cgi-bin/install.cgi?serial=5579801\&key=xGMXQx64Cd; /bin/sh install.sh -s

.. afterwards run packages upgrade to update to the latest versions of Webmin and Virtualmin.