Permissions issues for web server

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
Post Reply
crik91
Posts: 48
Joined: Mon Mar 20, 2017 7:51 am

Permissions issues for web server

Post by crik91 »

Hi, I'm using my Raspberry Pi for a lot of functionalities. Recently I'm testing 2 websites on it but I'm having some permissions issues. All websites files are in an external hard drive (that I'm using also for PLEX, Transmission, etc...) in a folder called "www" located in the root of the HDD. I created a symlink to /var/www.
I'm logging via FTP as root user that upload files with root:root ownership, the problem is that I had some permission issues because I think that all files need to be www-data:www-data to work well.
What may I need to fix it? If I change owner of all "www" files I can't manage that via FTP client because I'm logging as root.

Thank you
User avatar
Fourdee
Site Admin
Posts: 2782
Joined: Tue Feb 06, 2007 1:36 pm

Re: Permissions issues for web server

Post by Fourdee »

crik91 wrote:files need to be www-data:www-data to work well.

Code: Select all

chown -R www-data:www-data /var/www
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
crik91
Posts: 48
Joined: Mon Mar 20, 2017 7:51 am

Re: Permissions issues for web server

Post by crik91 »

Yes, I have to do

Code: Select all

chown -R www-data:www-data /var/www
when working on website but I need to do

Code: Select all

chown -R root:root /var/www
when working via FTP client.

The problem is that I need to change ownership every time. :?
Post Reply