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 transitioning a web app (runs on LAMP) from a single host to a configuration with the php/apache app running on a public facing server in a DMZ. The app connects to mysql which is sitting in a private network behind the DMZ. My main criteria I have been given is to keep all user data (in the database or user uploaded files) out of the DMZ entirely and only allow access to it via an ACL. I.e. segregating the application layer from the data layer, both by network and by authentication/access.

I've got this segregation nicely with mysql, but I'm not coming up with any good ideas for how to access file storage on the file server from the web server. I've got it running currently on an NFS export mounted on the web server, but that leaves the file server and all its data open to anyone with access to the web server (basically) without authentication.

I realize that any serious solution is probably going to involve significant development time, and I'm prepared to do that. Also prepared to spend some money on an off-the-shelf solution if needed to get the job done right. I feel like I'm missing something blindingly obvious here.

share|improve this question
up vote 2 down vote accepted

You really can't have it both ways: If you want to access a resource on the file server from the web server you need to open a firewall hole for it.
There's really no difference punching the hole for NFS versus MySQL -- If someone breaks into your web server they can get your MySQL database (or at least grab the credentials and access any DB that user can get to). Similarly if they break into the web server they can access anything the web server is authorized to get to, subject to whatever restrictions you put on the NFS export.

About the best thing you can do in this situation is restrict the NFS export to the minimum practical window of the file server (protecting you from a compromise of the web server), and use strong authentication for the NFS client, via Kerberos for example (protecting you from a collateral breach of the DMZ). There are also a few questions here tagged with which talk about authorization and authentication concerns, security, etc. that can give you a few pointers on this.

share|improve this answer
Thank you, you've confirmed my suspicions. Are there any other options than NFS/SMB for file transfer or am I stuck with a network share type solution? – Stephen Jan 30 '13 at 16:52

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.