07-27-2023, 11:38 AM
I'm running WordPress on my VPS with CentOS 7 LAMP stack.I've followed [this guide][1] to set permissions, i.e. I've run
`sudo chown apache:apache -R *`
to ensure that my wordpress directory is owned by `apache:apache`.
I've also set WordPress directory and file permissions with these commands:
`find . -type d -exec chmod 755 {} \;`
`find . -type f -exec chmod 644 {} \; `
(I had to prefix the above commands with `sudo`)
Normally I manage the server by logging in through SSH using `myuser`, where `myuser` belongs to the `apache` group and the `wheel` group.
I have 3 problems:
1. Any file CRUD command in the WordPress directory still requires me to prefix the command with `sudo`, or else I get a permission error. Since `myuser` belongs to `apache` and `apache` owns the directory, I'm confused as to why I still need to prefix the commands with `sudo`.
2. Similar to problem 1, any `git` command such as a `git pull` requires me to prefix the command with `sudo` or else I get a permission error.
3. When I try to automatically update theme files from my WordPress dashboard web interface, I get permission errors. Interestingly, I'm able to install/update plugins via the WordPress dashboard without any permissions errors.
Any ideas on what I'm missing?
[1]:
`sudo chown apache:apache -R *`
to ensure that my wordpress directory is owned by `apache:apache`.
I've also set WordPress directory and file permissions with these commands:
`find . -type d -exec chmod 755 {} \;`
`find . -type f -exec chmod 644 {} \; `
(I had to prefix the above commands with `sudo`)
Normally I manage the server by logging in through SSH using `myuser`, where `myuser` belongs to the `apache` group and the `wheel` group.
I have 3 problems:
1. Any file CRUD command in the WordPress directory still requires me to prefix the command with `sudo`, or else I get a permission error. Since `myuser` belongs to `apache` and `apache` owns the directory, I'm confused as to why I still need to prefix the commands with `sudo`.
2. Similar to problem 1, any `git` command such as a `git pull` requires me to prefix the command with `sudo` or else I get a permission error.
3. When I try to automatically update theme files from my WordPress dashboard web interface, I get permission errors. Interestingly, I'm able to install/update plugins via the WordPress dashboard without any permissions errors.
Any ideas on what I'm missing?
[1]:
[To see links please register here]