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.

I have a server running Rails and Tomcat applications with Apache. I currently have a rails app setup to port 80 and a tomcat application on port 8080. I'm attempting to have Apache forward all requests on /uploader to tomcat. The tomcat application works OK when visiting it's own url, but when using the redirect it takes ~60 seconds per request. Here is my httpd file. Any help is really appreciated! Thanks!

<VirtualHost *:80>
  ServerName http://example.com/
  DocumentRoot /Users/lab/WebApplications/app/public   
  PassengerSpawnMethod conservative

    # Speeds up spawn time tremendously -- if your app is compatible. 
    # RMagick seems to be incompatible with smart spawning
    RailsSpawnMethod smart

    # Keep the application instances alive longer. Default is 300 (seconds)
    PassengerPoolIdleTime 1000

    # Keep the spawners alive, which speeds up spawning a new Application
    # listener after a period of inactivity at the expense of memory.
    RailsAppSpawnerIdleTime 0

    # Just in case you're leaking memory, restart a listener 
    # after processing 5000 requests
    PassengerMaxRequests 5000
    # PassengerMaxPoolSize 4
    # PassengerMaxInstancesPerApp 4



 <Directory /Users/lab/WebApplications/app/public>
     AllowOverride all              
Allow from all   
    Options -MultiViews            
  </Directory>
</VirtualHost>


ProxyRequests On
ProxyVia On

SetEnv force-proxy-request-1.0 1
SetEnv proxy-nokeepalive 1

    # Redirect to tomcat
ProxyPass         /uploader  http://localhost:8080/FileSplit
ProxyPassReverse  /uploader  http://localhost:8080/FileSplit
share|improve this question
    
You might capture some traffic with tcpdump to see which side is sitting on the request for 60 seconds. –  Kyle Smith Feb 24 '12 at 19:31
    
It's tenuous, but does changing the localhost to 127.0.0.1 make any difference? –  nickgrim Feb 24 '12 at 20:16
    
you want ProxyRequests Off as that is for enabling forwarding proxying rather than (what you need) reverse proxy with ProxyPass –  Tom H May 14 '12 at 18:13

1 Answer 1

Just a guess, but apache is probably waiting for your app to timeout before you get to the ProxyPass. Try moving this to the top of the file, and see if that makes a difference.

share|improve this answer

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.