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

Is there a configuration that changes the directory where apache web server temporarily places uploaded files? I have access to httpd/conf.d

I'm on a machine where /tmp is very size constrained and have a requirement to allow file uploads that are larger than the available space on /tmp.

Environment: fedora 18, apache web server 2.4.6-2, passenger and ruby on rails.

EDIT: there's some discussion around the office that it's passenger (because this is a ruby on rails app) not apache that determines the location of the temporary file upload. I'm going under the assumption that it's apache but please correct me if I'm wrong.

share|improve this question
up vote 1 down vote accepted

The temporary file location seems to be set by the scripting program that you choose. In PHP, for example, the temporary upload location is set by the upload_temp_dir directive.

upload_temp_dir = /somewhere/else

As far as Ruby on Rails goes, I found this ServerFault question that describes it as a change to the 'tmpdir' property of Rails' initializer object.

class Dir
  def self.tmpdir

To parrot the user who answered this question in the other thread, make sure that the folder you specify is writable by the user for Apache.

share|improve this answer
thanks for the link to that other question as well. It ended up being solved by setting the TMPDIR env variable so I didn't need to monkey patch Dir but you sent me in the right direction. – GSP Oct 11 '13 at 12:21

FYI the php.ini file says:

; Temporary directory for HTTP uploaded files (will use system default if not
; specified).
;upload_tmp_dir =

so its 'tmp' vs 'temp'. This at least worked for me.

share|improve this answer

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.