# Proxying junebug through Apache

**URL:** <https://www.ruby-forum.com/t/proxying-junebug-through-apache/114418>\
**Category:** Ruby\
**Created:** [September 12, 2007, 3:03pm UTC](https://www.ruby-forum.com/t/proxying-junebug-through-apache/114418 "2007-09-12T15:03:23Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![n1c](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/3ec8ea/32.png) [@n1c](https://www.ruby-forum.com/u/n1c)\
**Post date:** [September 12, 2007, 3:03pm UTC](https://www.ruby-forum.com/t/proxying-junebug-through-apache/114418/1 "2007-09-12T15:03:23Z")

</div>

I’m trying to configure Junebug to be served through Apache following  
the instructions at [http://www.junebugwiki.com/Junebug\_Installation](http://www.junebugwiki.com/Junebug_Installation).

The only change I’ve made from the std Apache config is to serve the  
wiki on port 8000 like so  
\<Virtualhost \*:80 \*:8000\>

However when I visit [http://mysite:8000](http://mysite:8000) I get a “Unable to connect”  
message in Firefox. The app is served fine on its default port of 3301.

Any ideas? I’m not too clued up on Apache config.

thx  
Nick

---

<div class="post-metadata">

**Author:** ![n1c](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/3ec8ea/32.png) [@n1c](https://www.ruby-forum.com/u/n1c)\
**Post date:** [September 12, 2007, 3:20pm UTC](https://www.ruby-forum.com/t/proxying-junebug-through-apache/114418/2 "2007-09-12T15:20:31Z")

</div>

> The only change I’ve made from the std Apache config is to serve the  
> wiki on port 8000 like so  
> \<Virtualhost \*:80 \*:8000\>
> 
> However when I visit [http://mysite:8000](http://mysite:8000) I get a “Unable to connect”  
> message in Firefox. The app is served fine on its default port of 3301.
> 
> Any ideas? I’m not too clued up on Apache config.

Is apache listening on :8000, too? There should be a file in the  
apache.conf file similar to “Listening”. If you add :8000 there, you  
might be successful.

---

<div class="post-metadata">

**Author:** ![n1c](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/3ec8ea/32.png) [@n1c](https://www.ruby-forum.com/u/n1c)\
**Post date:** [September 12, 2007, 3:45pm UTC](https://www.ruby-forum.com/t/proxying-junebug-through-apache/114418/3 "2007-09-12T15:45:13Z")

</div>

Thanks. That moved me forward a bit.

Now I’m receiving the error:  
Forbidden

You don’t have permission to access / on this server

Looking in the junebug error log I see a line which says:  
[warn] proxy: No protocol handler was valid for the URL /. If you are  
using a DSO version of mod\_proxy, make sure the proxy submodules are  
included in the configuration using LoadModule.

Not sure what I should be checking next?

thx  
Nick

Phil wrote:

> > The only change I’ve made from the std Apache config is to serve the  
> > wiki on port 8000 like so  
> > \<Virtualhost \*:80 \*:8000\>
> > 
> > However when I visit [http://mysite:8000](http://mysite:8000) I get a “Unable to connect”  
> > message in Firefox. The app is served fine on its default port of 3301.
> > 
> > Any ideas? I’m not too clued up on Apache config.
> 
> Is apache listening on :8000, too? There should be a file in the  
> apache.conf file similar to “Listening”. If you add :8000 there, you  
> might be successful.

---

<div class="post-metadata">

**Author:** ![n1c](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/3ec8ea/32.png) [@n1c](https://www.ruby-forum.com/u/n1c)\
**Post date:** [September 12, 2007, 4:13pm UTC](https://www.ruby-forum.com/t/proxying-junebug-through-apache/114418/4 "2007-09-12T16:13:41Z")

</div>

> Forbidden
> 
> You don’t have permission to access / on this server
> 
> Looking in the junebug error log I see a line which says:  
> [warn] proxy: No protocol handler was valid for the URL /. If you are  
> using a DSO version of mod\_proxy, make sure the proxy submodules are  
> included in the configuration using LoadModule.
> 
> Not sure what I should be checking next?

mod\_proxy’s documentation, probably.

That, or the file permissions of junebug’s directory (the apache user,  
or, at least, the groups apache belongs to should have at least read  
access to the directories and files).

Otherwise, I’d be as stumped as you by now.

---

<div class="post-metadata">

**Author:** ![n1c](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/3ec8ea/32.png) [@n1c](https://www.ruby-forum.com/u/n1c)\
**Post date:** [September 12, 2007, 4:32pm UTC](https://www.ruby-forum.com/t/proxying-junebug-through-apache/114418/5 "2007-09-12T16:32:43Z")

</div>

On 9/12/07, Nick C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> included in the configuration using LoadModule.  
> You need to load mod\_proxy and mod\_proxy\_http. My LoadModule’s look like  
> this:

LoadModule proxy\_module libexec/apache22/mod\_proxy.so  
LoadModule proxy\_http\_module libexec/apache22/mod\_proxy\_http.so

For the permissions, you need something like this inside your  
 block:

\<Proxy \*\>  
Order Allow,Deny  
Allow from all

Most of this you can find by reading the Apache docs under setting up  
reverse proxies (which is what this is).

---

<div class="post-metadata">

**Author:** ![n1c](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/3ec8ea/32.png) [@n1c](https://www.ruby-forum.com/u/n1c)\
**Post date:** [September 12, 2007, 4:26pm UTC](https://www.ruby-forum.com/t/proxying-junebug-through-apache/114418/6 "2007-09-12T16:26:42Z")

</div>

On 9/12/07, Nick C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I’m trying to configure Junebug to be served through Apache following  
> the instructions at [http://www.junebugwiki.com/Junebug\_Installation](http://www.junebugwiki.com/Junebug_Installation).
> 
> The only change I’ve made from the std Apache config is to serve the  
> wiki on port 8000 like so  
> \<Virtualhost \*:80 \*:8000\>

I have junebug proxied behind Apache 2.2. Here’s my vhost setup:

\<VirtualHost \*:80\>  
ServerName [wiki.mydomain.com](http://wiki.mydomain.com)  
ProxyRequests Off  
ProxyPass / [http://localhost:3301/](http://localhost:3301/)  
ProxyPassReverse / [http://localhost:3301/](http://localhost:3301/)  
ProxyPreserveHost On  
SetEnv force-proxy-request-1.0 1  
SetEnv proxy-nokeepalive 1

Also, don’t forget to change junebug so it listens only on localhost  
if you want to force everything to go through the proxy.

---

<div class="post-metadata">

**Author:** ![n1c](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/3ec8ea/32.png) [@n1c](https://www.ruby-forum.com/u/n1c)\
**Post date:** [September 12, 2007, 7:35pm UTC](https://www.ruby-forum.com/t/proxying-junebug-through-apache/114418/7 "2007-09-12T19:35:42Z")

</div>

On 9/12/07, Nick C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I’m going in circles here…
> 
> Bob, I tried your vhost setup, no luck though.
> 
> I’ve set permissions on the junebug folder to be the same owner and  
> group as the Apache user (www-data). No difference.

The permissions don’t have anything to do with the proxy setup. Try it  
with all the rewrite stuff commented out. Does that make a difference?

> ```
> Order allow,deny
> 
> ```
> 
> RewriteLogLevel 0
> 
> The error I’m now receiving is “503 Service Temporarily Unavailable”  
> which apparently usually means that Apache can’t find anything in the  
> place its being told to look. If I go to port 3301 in my browser Junebug  
> is running just fine.
> 
> mmmmph.

The 503 means that it can’t talks to [http://localhost:3301](http://localhost:3301). Is Junebug  
listening on localhost? Or is it only bound to an external interface?  
Stop and restart your browser.

You’re getting close…

---

<div class="post-metadata">

**Author:** ![n1c](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/3ec8ea/32.png) [@n1c](https://www.ruby-forum.com/u/n1c)\
**Post date:** [September 12, 2007, 7:18pm UTC](https://www.ruby-forum.com/t/proxying-junebug-through-apache/114418/8 "2007-09-12T19:18:08Z")

</div>

I’m going in circles here…

Bob, I tried your vhost setup, no luck though.

I’ve set permissions on the junebug folder to be the same owner and  
group as the Apache user (www-data). No difference.

I load my original file in, which now looks like this:

\<Virtualhost \*:80 \*:8000\>  
ServerName my.server.name

ProxyRequests Off

#Proxy ACL  
\<Proxy \*\>  
Order allow,deny  
Allow from all

#Proxy directives  
ProxyPass / [http://localhost:3301/](http://localhost:3301/)  
ProxyPassReverse / [http://localhost:3301/](http://localhost:3301/)  
ProxyPreserveHost On

#Turn rewriting on  
RewriteEngine On  
RewriteLogLevel 0

#Redirect non-static documents  
RewriteCond %{DOCUMENT\_ROOT}%{REQUEST\_FILENAME} !-f  
RewriteRule ^/(.\*)$ [http://localhost:3301](http://localhost:3301)%{REQUEST\_URI} [P,QSA,L]

DocumentRoot /home/nick/cvwiki/public/

ErrorLog /home/nick/cvwiki/error-cvwiki.log  
CustomLog /home/nick/cvwiki/access-cvwiki.log combined

The error I’m now receiving is “503 Service Temporarily Unavailable”  
which apparently usually means that Apache can’t find anything in the  
place its being told to look. If I go to port 3301 in my browser Junebug  
is running just fine.

mmmmph.

Nick

Bob S. wrote:

> On 9/12/07, Nick C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > included in the configuration using LoadModule.  
> > You need to load mod\_proxy and mod\_proxy\_http. My LoadModule’s look like  
> > this:
> 
> LoadModule proxy\_module libexec/apache22/mod\_proxy.so  
> LoadModule proxy\_http\_module libexec/apache22/mod\_proxy\_http.so
> 
> For the permissions, you need something like this inside your  
> block:
> 
> \<Proxy \*\>  
> Order Allow,Deny  
> Allow from all
> 
> Most of this you can find by reading the Apache docs under setting up  
> reverse proxies (which is what this is).

---

<div class="post-metadata">

**Author:** ![n1c](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/3ec8ea/32.png) [@n1c](https://www.ruby-forum.com/u/n1c)\
**Post date:** [September 12, 2007, 7:59pm UTC](https://www.ruby-forum.com/t/proxying-junebug-through-apache/114418/9 "2007-09-12T19:59:41Z")

</div>

Bob S. wrote:

> On 9/12/07, Nick C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > I’m going in circles here…
> > 
> > Bob, I tried your vhost setup, no luck though.
> > 
> > I’ve set permissions on the junebug folder to be the same owner and  
> > group as the Apache user (www-data). No difference.
> 
> The permissions don’t have anything to do with the proxy setup. Try it  
> with all the rewrite stuff commented out. Does that make a difference?
> 
> > ```
> > Order allow,deny
> > 
> > ```
> > 
> > RewriteLogLevel 0
> > 
> > The error I’m now receiving is “503 Service Temporarily Unavailable”  
> > which apparently usually means that Apache can’t find anything in the  
> > place its being told to look. If I go to port 3301 in my browser Junebug  
> > is running just fine.
> > 
> > mmmmph.
> 
> The 503 means that it can’t talks to [http://localhost:3301](http://localhost:3301). Is Junebug  
> listening on localhost? Or is it only bound to an external interface?  
> Stop and restart your browser.
> 
> You’re getting close…

Bob, I LOVE YOU!!

Changing host in config.yml to 127.0.0.1 fixed it!

Thx  
Nick
