Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm running two webservers in a single host. One of them is a Tomcat running in a reverse proxy configuration. The front webserver is a nginx that proxies request to the Tomcat.

So far, is working ok.

A location in a domain, let's say is server by Tomcat. I'd like the photos to be server by nginx. The files are stored in a folder, but the files are written by Tomcat application and the files end up with owner tomcat and group tomcat.

The nginx process is running in www-data group, so it cannot retrieve the files.

How can I accomplish that the the webservers runs under the same group? Is a good practice to use newgrp before starting the webservers, so both runs under the same group?


share|improve this question

Have you considered just adding your nginx user to the tomcat group? Seems like an easy solution...

share|improve this answer
Thanks. I didn't realize of that option. – user59614 Nov 11 '10 at 14:17

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.