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.

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

1 Answer

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
    "/your_directory/"
  end
end

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
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.