Help with Apache, proxy and virtual hosts?

I am trying to deploy a preview of an app I’ve been working on at work and running into a bit of problems. First, if I run my app and access it directly (http://domain:9001) all works great. However, I wish to have it behind Apache as Apache deals with SSL for us. So, I created an apache config for the virtual host:

<VirtualHost *:443>
        ServerName blah.domain
        ServerAdmin webmaster@domain
        DocumentRoot /var/www/portal6-dev/public_html
        ErrorLog /var/log/apache2/portal6-dev/error.log
        CustomLog /var/log/apache2/portal6-dev/access.log combined

        SSLEngine On
	ProxyRequests Off
	ProxyPreserveHost on
	<Location />
		Order deny,allow
		Allow from all
		ProxyPass http://localhost:9001/
		ProxyPassReverse http://localhost:9001/
	</Location>
</VirtualHost>

When I access it via Apache, all I get is the Launching… message, nothing ever more. No access log, no error log.

Any thoughts?

Sounds like the client’s web browser is able to get data to the RB web app, but perhaps the RB Web app is not able to send information back to the web browser?

The general thought is that your WE app isn’t proxy aware. So it may be sending back fully qualified URLs of the form http://localhost:9001 for the browser to access. Check the web activity in the browser to see if this is happening.

I watched some data go by, things are getting passed back and forth and it was not apparent why things stopped being passed to me. Doing more research into mod_proxy, I finally wound up with a working solution. It has been working now for about 2 hours w/no problems. Before it would err out almost immediately. Here is my final VirtualHost definition:

[code]<VirtualHost *:443>
ServerName host.domain
ServerAdmin webmaster@host.domain
DocumentRoot /var/www/portal6-dev/public_html
SSLEngine On
ErrorLog /var/log/apache2/portal6-dev/error.log
CustomLog /var/log/apache2/portal6-dev/access.log combined

ProxyRequests Off
ProxyPreserveHost on
SetEnv force-proxy-request-1.0 1
SetEnv proxy-nokeepalive 1
<Location />
	Order deny,allow
	Allow from all
	ProxyPass http://localhost:9001/ retry=1
	ProxyPassReverse http://localhost:9001/
</Location>
[/code]

Now, what made things work was:

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

Without that, two of my WE apps fail in the same way, one is almost as basic as a Hello World application. The other, quite a bit more complex. With those two lines, things work great. More information about it can be read here: http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#envsettings

From that page:

Maybe those w/more WE experience can chime in on this solution? I would be interested in knowing if I am just using crutches and something else needs to be done or if this is a proper fix.

With these variables in the long term, it has no problems?

This means that the Xojo web app sends responses named “1.1”, whereas it is actually 1.0 responses? Maybe the team Xojo can inform us? Thanks in advance, this is important.

Or that the Xojo web app sends 1.1 responses but asking each time to close the TCP connection, while the client asks to leave it open. Why?

Persistent connections are not a requirement for http/1.1 compatibility.

Hi all,

I’ve been reading this old post, because I’ve got a situation like Jeremy described, which is taking me so long:
“When I access it via Apache, all I get is the Launching… message, nothing ever more. No access log, no error log.”

but the solution doesn’t work for me.

Is it possible that something has changed in the following years?

Have others had similar experiences, successfully concluded?

thanks