A
A
Albert Tobacco2014-08-28 16:48:55
ubuntu
Albert Tobacco, 2014-08-28 16:48:55

How to stop fighting with folder owner in ubuntu?

I work with wordpress, here I am writing in the terminal

sudo chown -R www-data /var/www/wordpress

Then I can download themes, install something from WordPress itself, and so on, but I can’t edit the code of the files.
for this I write
sudo chown -R igor /var/www/wordpress

Yes, now I can edit files, but I can not download and install plugins and themes using WordPress.
Is there an optimal solution?

Answer the question

In order to leave comments, you need to log in

5 answer(s)
N
Nazar Mokrinsky, 2014-08-28
@bighoc

There is an option to run the web server on my own behalf, I also do this, since you can often see 700 file permissions.
In the file /etc/apache2/envvars
Substitute yourself in APACHE_RUN_USER and APACHE_RUN_GROUP
But at the same time you need to understand what kind of code you are running, because you yourself understand.
And so add yourself to the group, and in the source code change the rights when creating files / folders from 700 to 770.

P
Pavel Solovyov, 2014-08-28
@pavel_salauyou

Add user to www-data group

K
Konstantin, 2014-08-28
@fallen8rwtf

777? ))

D
Dmitry, 2014-08-28
@zmeyjr

sudo chmod -R 775 /var/www/wordpress

S
Sergey Petrikov, 2014-08-28
@RicoX

Run Apache or whatever you have as a web server from under the same igor, give all files permissions 755 user igor group www-data and that's it. Or after each edit, do crown -R www-data:www-data /var/www/wordpress, wagon options.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question