Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #175891

Re: chgrp with user

From Andy Smith <andy@strugglers.net>
Newsgroups linux.debian.user
Subject Re: chgrp with user
Date 2016-12-23 15:20 +0100
Message-ID <sRyRr-7Wo-1@gated-at.bofh.it> (permalink)
References <sRfvs-3YW-37@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi Xen,

On Thu, Dec 22, 2016 at 06:24:59PM +0100, Xen wrote:
> I am trying to get a webserver to run under my regular user, or at
> least to have the website's files under control of my regular user,
> but the webserver runs as www-data.

You've been shown how to put yourself in the www-data group so that
you can make the files group-writable and still edit them with your
normal user.

Other solutions include:

- Run a separate web server on a high port, so that it can listen on
  this port without needing special privileges. Proxy to this server
  from your main web server that listens on port 80. In this way the
  main web server does not need PHP and touches no files, it just
  listens on port 80 and proxies connections. The other web server
  runs as an unprivileged user and reads the files.

- If using apache, you can make each vhost run as a different
  unprivileged user with a different MPM such as apache2-mpm-itk.
  Other web servers may have similar features.

- You could run PHP under FastCGI which would let you potentially
  run each site's FastCGI server as a different user. Although this
  would mean that every page would have to come through FastCGI
  with no opportunity for simple static file serving.

  Here's an example of php-fpm under nginx on jessie:

  https://www.howtoforge.com/tutorial/installing-nginx-with-php-fpm-and-mariadb-lemp-on-debian-jessie/

  That example doesn't show how to have different users. This one
  does; it is for Ubuntu but you can pretty easily get the idea:

  https://www.digitalocean.com/community/tutorials/how-to-host-multiple-websites-securely-with-nginx-and-php-fpm-on-ubuntu-14-04

Cheers,
Andy

-- 
https://bitfolk.com/ -- No-nonsense VPS hosting

Back to linux.debian.user | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

chgrp with user Xen <list@xenhideout.nl> - 2016-12-22 18:40 +0100
  Re: chgrp with user Dan Ritter <dsr@randomstring.org> - 2016-12-22 20:10 +0100
    Re: chgrp with user Xen <list@xenhideout.nl> - 2016-12-23 01:20 +0100
      Re: chgrp with user Greg Wooledge <wooledg@eeg.ccf.org> - 2016-12-23 14:10 +0100
        Re: chgrp with user Xen <list@xenhideout.nl> - 2016-12-27 12:30 +0100
  Re: chgrp with user deloptes <deloptes@gmail.com> - 2016-12-23 00:50 +0100
    Re: chgrp with user Xen <list@xenhideout.nl> - 2016-12-23 01:20 +0100
      Re: chgrp with user Nicolas George <george@nsup.org> - 2016-12-23 09:40 +0100
        Re: chgrp with user Xen <list@xenhideout.nl> - 2016-12-27 13:30 +0100
          Re: chgrp with user Gene Heskett <gheskett@shentel.net> - 2016-12-27 16:00 +0100
            Re: chgrp with user Xen <list@xenhideout.nl> - 2016-12-27 16:40 +0100
              Re: chgrp with user deloptes <deloptes@gmail.com> - 2016-12-27 21:10 +0100
                Re: chgrp with user Greg Wooledge <wooledg@eeg.ccf.org> - 2016-12-27 22:50 +0100
                Re: chgrp with user Xen <list@xenhideout.nl> - 2016-12-27 23:00 +0100
                Re: chgrp with user Xen <list@xenhideout.nl> - 2016-12-27 23:20 +0100
                Re: chgrp with user Xen <list@xenhideout.nl> - 2016-12-28 13:40 +0100
                Re: chgrp with user deloptes <deloptes@gmail.com> - 2016-12-28 20:20 +0100
                Re: chgrp with user Xen <list@xenhideout.nl> - 2016-12-29 09:10 +0100
                Re: chgrp with user Xen <list@xenhideout.nl> - 2016-12-27 22:50 +0100
  Re: chgrp with user Andy Smith <andy@strugglers.net> - 2016-12-23 15:20 +0100

csiph-web