I found how to set a virtual apache server to run as the domain owner’s user. For example, on one of my domains, porthuronnow.com I have apache running as porthuronnow.
What I can’t figure out is why files uploaded via FTP with this same user have the owner 1010 and the group 1006. It’s similar for all my other servers. It doesn’t make sense to me since those aren’t even a user or group on my server.
I want files uploaded with the porthuronnow user to be owned by porthuronnow so that the apache server running as porthuronnow has full access to them.
Hmm, that sounds unusual… a user shouldn’t have the ability to create files as another user, only root can do that.
You said you’re seeing that same issue with multiple domains – is the file always using the owner 1010, regardless of what FTP user is uploading the file?
That’s just an example… another virtual server has the files owned by 1006 and the group as 1004. I have no problem writing the files with FTP the only issue is that I want the server to own the files too…
Hrm, I’m not even sure where to start, I’ve never heard of anything like that happening before
You had mentioned this above:
I found how to set a virtual apache server to run as the domain owner's user. For example, on one of my domains, porthuronnow.com I have apache running as porthuronnow.
What you’re describing there is the default on Virtualmin… after performing an install using the install.sh script, Virtualmin would setup Apache to use the FCGID execution mode, as well as configuring it to run everything as your Virtual Server owner.
I suppose my question is, what changes had you made when you configured your system to do all that? Do you know if you made any changes to ProFTPd, or to anything outside of Apache?
When I log in with FTP I see the numbers as the user / group.
When I log in with SFTP I see porthuronnow as the user and group. That’s strange.
Either way… the issue I’m trying to resolve is when I try to install a WordPress plugin from WordPress’s dashboard, it asks for the FTP info, which means it doesn’t have write access.
If the server is running as the same user as the file owner, this won’t happen…
Well I just changed that setting to CGI wrapper (run as virtual server owner) and now I can install WordPress plugins fine. Is that how it’s supposed to be set?
I’m not sure why they are all set to mod_php by default. I’ll have to have a look at my server template I guess. What can I put in the template to make that the default for new servers?