# Help with Apache, proxy and virtual hosts?

**URL:** <https://forum.xojo.com/t/help-with-apache-proxy-and-virtual-hosts/9664>\
**Category:** Web\
**Created:** [July 19, 2013, 2:27pm UTC](https://forum.xojo.com/t/help-with-apache-proxy-and-virtual-hosts/9664 "2013-07-19T14:27:27Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeremy\_Cowgar](https://forum.xojo.com/user_avatar/forum.xojo.com/jeremy_cowgar/32/4590_2.png) [@Jeremy\_Cowgar](https://forum.xojo.com/u/Jeremy_Cowgar)\
**Post date:** [July 19, 2013, 2:27pm UTC](https://forum.xojo.com/t/help-with-apache-proxy-and-virtual-hosts/9664/1 "2013-07-19T14:27:27Z")

</div>

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](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:

```auto
<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?

---

<div class="post-metadata">

**Author:** ![Mike\_D](https://forum.xojo.com/user_avatar/forum.xojo.com/mike_d/32/266_2.png) [@Mike\_D](https://forum.xojo.com/u/Mike_D)\
**Post date:** [July 19, 2013, 3:48pm UTC](https://forum.xojo.com/t/help-with-apache-proxy-and-virtual-hosts/9664/2 "2013-07-19T15:48:17Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Brad\_Hutchings](https://forum.xojo.com/user_avatar/forum.xojo.com/brad_hutchings/32/143_2.png) [@Brad\_Hutchings](https://forum.xojo.com/u/Brad_Hutchings)\
**Post date:** [July 19, 2013, 3:50pm UTC](https://forum.xojo.com/t/help-with-apache-proxy-and-virtual-hosts/9664/3 "2013-07-19T15:50:12Z")

</div>

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](http://localhost:9001) for the browser to access. Check the web activity in the browser to see if this is happening.

---

<div class="post-metadata">

**Author:** ![Jeremy\_Cowgar](https://forum.xojo.com/user_avatar/forum.xojo.com/jeremy_cowgar/32/4590_2.png) [@Jeremy\_Cowgar](https://forum.xojo.com/u/Jeremy_Cowgar)\
**Post date:** [July 19, 2013, 6:13pm UTC](https://forum.xojo.com/t/help-with-apache-proxy-and-virtual-hosts/9664/4 "2013-07-19T18:13:52Z")

</div>

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:

```auto
	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](http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#envsettings)

From that page:

> [@](#):
>
> For circumstances where mod\_proxy is sending requests to an origin server that doesn’t properly implement keepalives or HTTP/1.1, there are two environment variables that can force the request to use HTTP/1.0 with no keepalive.

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.

---

<div class="post-metadata">

**Author:** ![olivierV](https://forum.xojo.com/letter_avatar_proxy/v4/letter/o/919ad9/32.png) [@olivierV](https://forum.xojo.com/u/olivierV)\
**Post date:** [May 11, 2015, 8:39am UTC](https://forum.xojo.com/t/help-with-apache-proxy-and-virtual-hosts/9664/5 "2015-05-11T08:39:03Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![olivierV](https://forum.xojo.com/letter_avatar_proxy/v4/letter/o/919ad9/32.png) [@olivierV](https://forum.xojo.com/u/olivierV)\
**Post date:** [May 11, 2015, 8:59am UTC](https://forum.xojo.com/t/help-with-apache-proxy-and-virtual-hosts/9664/6 "2015-05-11T08:59:20Z")

</div>

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?

![](https://dl.dropboxusercontent.com/u/24945071/Capture%20d%E2%80%99%C3%A9cran%202015-05-11%20%C3%A0%2010.54.10.png)

---

<div class="post-metadata">

**Author:** ![Greg\_O\_Lone](https://forum.xojo.com/user_avatar/forum.xojo.com/greg_o_lone/32/49_2.png) [@Greg\_O\_Lone](https://forum.xojo.com/u/Greg_O_Lone)\
**Post date:** [May 11, 2015, 11:42pm UTC](https://forum.xojo.com/t/help-with-apache-proxy-and-virtual-hosts/9664/7 "2015-05-11T23:42:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![NatP](https://forum.xojo.com/letter_avatar_proxy/v4/letter/n/9f8e36/32.png) [@NatP](https://forum.xojo.com/u/NatP)\
**Post date:** [January 15, 2020, 3:10pm UTC](https://forum.xojo.com/t/help-with-apache-proxy-and-virtual-hosts/9664/8 "2020-01-15T15:10:13Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://forum.xojo.com/uploads/default/original/1X/455b4dcc0e61630e9f81940004ddffa49c432a46.png) [@system](https://forum.xojo.com/u/system)\
**Post date:** [October 29, 2020, 4:45pm UTC](https://forum.xojo.com/t/help-with-apache-proxy-and-virtual-hosts/9664/9 "2020-10-29T16:45:37Z")

</div>


