Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

2 Answers

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
add comment

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. –  BeeDee Jan 12 '12 at 6:15
add comment

Your Answer

 
discard

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.