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

A tomcat server that is run as root (i.e. web app using port 80) needs access to an NFS share to store uploaded files, which the root account does not have access to. Unsurprisingly, when the web application attempts to store a file, a permission exception is thrown.

Can I mount the share as a non-root user, so that the web server is able to access the share without permissions issues?

share|improve this question

On the NFS server, change the export and add a -maproot=some_user option. This will make it so any "root" user accessing the share will be given the access rights "some_user" would normally have.

share|improve this answer
Unfortunately, while this is probably the solution, this isn't a possibility due to IT's policies... :( – brass-kazoo Jan 12 '12 at 2:05

An alternative solution could be to run tomcat on a port >1000 so it can run as the user with access to the NFS share.

An Apache or nginx instance could then serve on port 80 and proxy the requests to the web application.

share|improve this answer
Seconded/voted up; running tomcat as root is strongly discouraged. – Brett Dikeman Jan 12 '12 at 6:15

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.