Quota issues

Hi Guys, My Virtualmin server is misreporting some quotas.

I have a virtual server that the filmanager indicates is using 7.4GB but when I look at the virtualmin stats they only show that 3.72GB is being used.

Any Ideas

Status: 
Closed (fixed)

Comments

Also I have tried to click System settings -> Bandwidth monitoring -> Recompute Stats but that doesn't seem to do anything.

Also I tried Limits and Validation -> Check Disk Quotas -> Check Now and that didn't help either

Another thing that I have tried is setting the etc/mtab instead of etc/fstab under Webmin -> Disk and Network File Systems -> Module Config -> System Configuration and no change.

A new bit of info just to hand, I have discovered that the website that is having the quota issues, when uploading files to it, stamps them with "www-data" as the owner of the files and not the admin account of the virtual server which it would seem is causing the quotas to be out. I changed the file permissions over to the virtual server admin account and ran the Check Disk Quota util and discovered that it began registering the amount used for the virtual server.

I would therefore like to change my original problem from problem with quota to how do I get the files uploaded to be stamped with the virtual servers admin account rather then the current www-data account when they are uploaded?

How are you doing the upload exactly? If it is via a PHP app, and it is running via mod_php mode, then you will see files saved as the www-data user. The solution is to switch the domain to use fcgid or cgi mode to run PHP scripts, at Server Configuration -> Website Options.

Well I just checked all those settings and they are set correctly. I guess the problem stems from the same issue that I had posted days ago titles "Assign PHP.ini" where the virtual servers are using the global PHP.ini

any chance one of you could remote into the server and take a peak? it's 6:00pm here now so say in the next 4 hours or so?

Thanks for taking a look at the server but the same problem persists, I had to undo the changes you made to the php5.conf file because the php scripts on the websites began behaving incorrectly, especially the one that runs drupal and webFM for file handling all 0of a sudden after your changes we could no longer upload files move files or create directories.

any ideas as to what the cause might be?

The issue might be that previous uploads and directories were owned by the www-data user, and once I fixed the PHP config so that scripts run as the domain owner, this causes permissions problems. I think the correct fix is to put back my change, and then to make sure all files under public_html in each domain with problems are owned by the domain's user.

I had seen this issue before.

Are the domains set to do fastcgi or cgi mode?

If they are create a file (any name as long as it ends in .php -- I usually use phpinfo.php) and add the following code:

<?php
phpinfo();
system('id');
?>

Make sure it is someplace where you can get to it via your browser then open that up so we get the contents of it. (for an example here is mine -- http://www.esminefield.com/phpinfo.php )

Now then...

1) Is there a cgi-fcgi section? If yes then move onto question 3.

2) Is there an apache2handler section? If yes then you have my issue for sure. For some reason mod_php5 is overridding mod_fcgid even when the proper lines are in place.

Do you have any servers that are set to use mod_php5?
If yes then I don't know what to do for you.

If no then go to Webmin -> Servers -> Apache Webserver -> Global Configuration -> Configure Apache Modules -> Remove the checkmark next to php5 and then click Enable Selected Modules. That will disable mod_php5 and allow mod_fcgid to take over. Please note that this disables the use of mod_php5 globally and it will disappear from the domain options.

I don't actually know how to resolve the issue without disabling mod_php5 completely. If someone has a better fix I'm open to correction on this.

3) If you answered yes to 1 then can you tell us what the line reads at the very bottom of the page. It is an echo from the system id command. It will tell us what user php ran as. In my script above it is "uid=1001(esminefield) gid=1001(esminefield) groups=1001(esminefield)" but we don't need all of that. The part in parenthesis is enough. For the most part it shouldn't read www-data but if it does then you may have a configuration issue elsewhere.

Great Just tried it and now both my quota and PHP issues are sorted, thanks for your help

Automatically closed -- issue fixed for 2 weeks with no activity.