1

I'm following a simple installation guide and I have a noob question. The software I'm installing is Movim (the guide: https://github.com/movim/movim/wiki/Install-Movim)

The 'Downloading' part of the guide instructs me to: sudo -s -u www-data

When I run this command I get a:

root@linux:/var/www# sudo -s -u www-data

bash: /root/.bashrc: Permission denied

www-data@linux:/var/www$ 

I have tried changing /etc/passwd from the nologin to /bin/bash:

www-data:x:33:33:www-data:/var/www:/bin/bash

But I get the same error. If I proceed anyway with copying the source code from the repository using git I get:

www-data@linux:/var/www$ git clone https://github.com/movim/movim.git 

fatal: could not create work tree dir 'movim'.: Permission denied

What am I doing wrong? Without making the system insecure, what can I do to proceed?

Thanks!

15
  • Are you sure you should be installing this? It seems like you need some experience running web servers to operate this Movim thing.
    – wjandrea
    May 1, 2016 at 4:09
  • 1
    Let's say I have some experience. Probably the best way to get better is by doing exactly this, no? :)
    – Bluebeep
    May 1, 2016 at 4:21
  • 1
    the first error is because you are running in root. maybe that is why the second is failing.... I would open a terminal under the users account not under root and see if you have the same issues
    – John Orion
    May 1, 2016 at 4:22
  • @JohnOrion I just tried it out of curiousity and got bash: /home/username/.bashrc: Permission denied
    – wjandrea
    May 1, 2016 at 4:26
  • 1
    That was fantastic John Orion! Thank you! I don't get that first error anymore. But I still have the second one I'm now not sure if I should change the user or group for /var/www coz right now I have: drwxr-xr-x 3 root root 4096 Apr 29 14:18 www
    – Bluebeep
    May 1, 2016 at 4:28

1 Answer 1

1

To solve issue one you need to be in a user terminal not a root terminal when you make the command.

The command sudo -s -u www-data is changing the user to www-data but in the root home directory which .bashrc is not accessible to the user www-data.

The second issue is that your /var/www directory has the wrong permissions and is set for root as owner and root as group . This should be set to www-data for both.

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

once you have made these changes you should have less issues

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .