User avatar
davef21370
Posts: 897
Joined: Fri Sep 21, 2012 4:13 pm
Location: Earth But Not Grounded

Managing Website On RPi

Fri Nov 20, 2015 4:00 pm

I've installed Apache, PHP, etc. on the Pi and left it running headless as I want to build a little website.
However, using WinSCP to move files from my laptop to the Pi I get the error....

Permission denied.
Error code: 3
Error message from server: Permission denied

...as I'm not logged in as root and the location is var/www/html/

What's the best way to handle this?

Dave.
Apple say... Monkey do !!

User avatar
rpdom
Posts: 17275
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Managing Website On RPi

Fri Nov 20, 2015 9:17 pm

Make sure the pi user is in the www-data group

User avatar
davef21370
Posts: 897
Joined: Fri Sep 21, 2012 4:13 pm
Location: Earth But Not Grounded

Re: Managing Website On RPi

Sat Nov 21, 2015 10:41 am

Thanks for the reply, unfortunately I'm getting the same result.
I used "sudo usermod -g www-data pi" and checked with "groups pi" which showed "pi : www-data" among other things but I still get the permission denied error.

Any more help greatly appreciated.

Dave.
Apple say... Monkey do !!

User avatar
DougieLawson
Posts: 39301
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Managing Website On RPi

Sat Nov 21, 2015 4:15 pm

sudo -i
cd /var/www
chown -R www-data.www-data *
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

User avatar
davef21370
Posts: 897
Joined: Fri Sep 21, 2012 4:13 pm
Location: Earth But Not Grounded

Re: Managing Website On RPi

Sat Nov 21, 2015 5:50 pm

Thanks Dougie but still no permission from WinSCP, gonna leave it, not worth the hassle.

Regards.
Dave.
Apple say... Monkey do !!

User avatar
davef21370
Posts: 897
Joined: Fri Sep 21, 2012 4:13 pm
Location: Earth But Not Grounded

Re: Managing Website On RPi

Sun Nov 22, 2015 12:19 pm

Got it sorted...

sudo usermod -G www-data pi
pi@raspberrypi ~ $ sudo chown -R pi.www-data /var/www/html
pi@raspberrypi ~ $ sudo chmod -R g+w /var/www/html

...thanks all.

Dave.
Apple say... Monkey do !!

Return to “Networking and servers”