Virtualmin and file Permissions on /public_html

Hi all,
I am facing a problem which seems to be a common but couldnt find the real solution. I am lookin for couple of days on net to find the Solution without success. So first of all, the Situation:
I am using these components

  • VPS Ubuntu 16.04 LTE
  • Webmin version 1.81
  • Virtualmin 6.03
    . Virtualserver with FCGId mode
  • PHP Version 7.1.7

Now the Problem
When i create a virtual Server on virtualmin, it completes the installation without any Problems. Now i install a wordpress on /home/virtualservername/public_html and it runs so far fine. Now i want to install some plugins etc in WP Backend and WP brings a windows and ask for FTP cresidentials. :frowning:
Now i change the ownership from "virtaulservernam:virtualservername to “www-data” on /public_html directory recursive and see that i can update or install the Plugins without giving the ftp Access. It works as it should be. i didnt made any changes on the directory public_html with root Access…

I put in user management of “www-data” the name of Virtualserver as member of secondry group but it wont work. I also tried to change php mode to CGI and Apache but with same result.

Question:
What could be wrong here ? it can not be the solution to change Public_html directory with Ownership of “www-data” cuz in this case the ftp user have no permissions to write on the directory.

It would be nice if someone could give methe hint to fix the problem.
regards
nomi

Shouldn’t change public_html to www-data at all. All files in user public_html should be owned by the user, as is the default for virtualmin. When you use wordpress to update itself or add plugins, it has to know how to access the public_html folder. Put in the user ftp details. If uneasy about allowing WP to ftp in, then download the plugin manually and FTP it to the public_html folder via an FTP program.

So there is nothing wrong with this user Persmission. Not possible that this User which is created by virtualmin could have more rights ? I have put now the FTP Detaisl ins Wordpress config file to easily update and install on WP Backend and it works.

I made this mistake in an other Joomla installation and gave Joomla directory the www-data ownership. Now i changed the ownership to original User (recursiv) and now the page is no more available ,it gives me Error 500. How can i fix this Problem on virtualmin.

After install of Wordpress you just need to go to "Limits and Validation - Validate Virtual Servers , then choose the “Fix Permissions” tab, choose the domain to fix and run it. All files will then be owned by the VS admin and not root and plugins etc will install without any ftp info required…

Virtualmin sets up VirtualHosts with suexec. Ownership of web data should always be domainuser:domaingroup.

If you install WordPress using the Install Scripts interface in Virtualmin, everything, including plugins, should Just Work. You shouldn’t need to change anything, you shouldn’t need to upload anything manually, and you shouldn’t need to configure FTP access in WordPress.

If you upload files via FTP or ssh as root, you will run into a lot of problems, and we don’t recommend it. Login as the domain owner user when you’re working on a domain, and most things will get the right permissions by default. (But, for WordPress, why not just use the Install Script? It’s in the GPL version, and will do all the right things, and can notify you of updates and stuff.)

Thanks for your hints.
@Welshman: i have tried this option but still the same. WP asks till for ftp details.
@Joe: I tried to install WP by using the install scripts but with the same result. WP asks till for the FTP Details even i used the option "Fix Permissions"after instlling the Wordpress.
:frowning:

Look at who actually ‘owns’ the files in the directory. I usually upload WP via an sftp client and install the old fashioned way rather than a script installer, so all files belong to root, if I do not fix permissions as I mentioned earlier I get the ftp credentials demand like your getting.

Hope you sort it. Clear your browser cache while your at it. :slight_smile: Never know your luck.

This is the strange thing what i obersiving. The ownership ist all the time domainuser:domaingroup on all the directories and files.

Now will try to transfer the new WP by ftp, but i dont blieve it works.

SFTP is more secure, winscp.net free client there for Windows, if your that way like I am.

Yes you are right. I am using only sftp. I worte in thread in short words.

Now the conclusion or summary of the thread…

  • Changed the permissios from www-data to domainuser:domaingroup --> no success WP asks for FTP Details by installing or updating
  • Fix the permissions by virtualmin: Validate Virtual Servers --> "Fix Permissions . no success WP asks for FTP Details by installing or updating
  • Installed WP by Install scripts --> no success WP asks for FTP Details by installing or updating
  • checked the directory with ls-l /home/domainame/public_html/ all have the permissions domainuser:domaingroupe
  • Only possible to install Plugins or update to put FTP Details in WP Config file but feeling not well cauz of security issue.
  • I use only sftp Connection.

Loving Virtualmin more and more… :frowning:

Howdy

nomi,

when you installed WP from the Virtualmin script did you uninstall the previous WP?

Did you delete the previous database and create a new database?

Did you move or delete any WP config files before trying to install from Virtualmin script?

If you attempted to over write or install over a broken WP, i believe you may create unexpected results.

I would suspect that the Virtualmin WP script is one of the most widely used of the installers and should work out of the box.

Joe

@Howdy,

I compeletly removed the old WP and database. No Import of any config files etc at all.

Ist there any way to find out the fault within Virtualmin ?

I think you may need to “switch to virtualmin virtual servers admin” before running the Wordpress Installer script. I suspect you are running it as the top lever server/webmin admin or root user. This is a problem i have encountered that produces similar issues sometimes.

Login as virtual server admin then run wp installer script and see if file permissions are now correct.

I think you may need to “switch to virtualmin virtual servers admin” before running the Wordpress Installer script. I suspect you are running it as the top lever server/webmin admin or root user. This is a problem i have encountered that produces similar issues sometimes.

Login as “virtualmin virtual server” admin then run wp installer script and see if file permissions are now correct.

Adamjedgar

Do you mean the loging with domainuser or there is an other Virtualmin damin login. I usually login with root access to webmin/virtualmin. Could you please tell me how to creat the admin Account. I can only create an aditional admin for a specific Domain.

regards