Etherpad + apache reverse proxy

548 views
Skip to first unread message

sergey arlashin

unread,
Jun 26, 2010, 5:06:56 PM6/26/10
to EtherPad Open Source Discussion
Hi!
My Etherpad is up and running on localhost:9000 on my server. So I'm
trying to get it to work with Apache reverse proxy to be able to
access it from the Internet.
I added the following lines to the httpd config:

<VirtualHost *:80>
ServerName etherpad
ErrorLog /var/log/httpd-etherpad-error_log
CustomLog /var/log/httpd-etherpad-access_log common
ProxyPass / http://localhost:9000/
ProxyPassReverse / http://localhost:9000/
ProxyPreserveHost on
<Proxy *>
Options FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Proxy>
</VirtualHost>

I added host etherpad to my hosts file as well.

And when I try to get the url http://etherpad/ in my browser it
redirects me to etherpad.com
In the etherpad.log I see

"request: 2010-06-26 21:00:44.159+0200 127.0.0.1
etherpad get / http 36f2fe262977b53d
302 9e2a2f95a6e9463a Mozilla/5.0 (Windows; U; Wiows NT 6.1;
ru; rv:1.9.2.4) Gecko/20100611 Firefox/3.6.4"

When I disable "ProxyPreserveHost on" line in httpd.conf I get html
which contains:

EtherPad: Open-Sourced!
Create new pad

But the "Create new pad" URL leads to http://localhost:9000/ep/pad/newpad
. Of course I cannot get http://localhost:9000/ep/pad/newpad from
outside.
Could you tell me what I am doing wrong? Why I get "http://localhost:
9000/" URLs in the page body instead of "http://etherpad/" URLs ? And
why it redirects me to etherpad.com when I use "ProxyPreserveHost on"
in httpd.conf.

With Best Regards,
Arlashin Sergey









Brian Herman

unread,
Jun 26, 2010, 5:12:17 PM6/26/10
to etherpad-open-...@googlegroups.com
This might be a problem with the fact you are using apache + reverse proxy not an etherpad problem.
http://httpd.apache.org/lists.html

Anyone else an expert in apache?
Thanks,
Brian Herman

brianjherman.com
Research Assistant
University Of Illinois at Chicago
brian...@acm.org
Consultant
University of Chicago

John McLear

unread,
Jun 26, 2010, 6:50:21 PM6/26/10
to etherpad-open-...@googlegroups.com

Can apache be avoided on your deployment?

On Jun 26, 2010 10:12 PM, "Brian Herman" <brian...@gmail.com> wrote:

This might be a problem with the fact you are using apache + reverse proxy not an etherpad problem.
http://httpd.apache.org/lists.html

Anyone else an expert in apache?
Thanks,
Brian Herman

brianjherman.com
Research Assistant
University Of Illinois at Chicago
brian...@acm.org
Consultant
University of Chicago

On Sat, Jun 26, 2010 at 4:06 PM, sergey arlashin <s.arl...@gmail.com> wrote: > > Hi! > My Ether...

Sebastian Bauer

unread,
Jun 28, 2010, 6:40:27 PM6/28/10
to EtherPad Open Source Discussion
May be interesting to know, if you have also set up the
crossdomain.xml file properly according to your setup?

I found out that etherpad sometimes will do some strange redirects if
the hostname will be parsed in some manner.. In our case etherpad had
problems, parsing hostnames with 4 slots (http://one.two.three.four)
and always redirected to http://three.four

Your problem may be related. Maybe your hostname (etherpad) matches
one of the hostname rules since etherpad.com is written inside the
allow superdomains and crossdomain.xml and therefore redirects..

It doesn't seem to be a mis-configuration in Apache, though.

// One new thought (I just leave the upper part for completeness):
Since, "ProxyPreserveHost on" seems to work:

I think "etherpad" is not in your superdomains, nor
crossdomains.xml ?? If it redirects to localhost, it does this,
because the hostname it has been called with, is not in the list of
allowed domains..

Best,
Sebastian

On 26 Jun., 23:06, sergey arlashin <s.arlas...@gmail.com> wrote:
> Hi!
> My Etherpad is up and running on localhost:9000 on my server. So I'm
> trying to get it to work with Apache reverse proxy to be able to
> access it from the Internet.
> I added the following lines to the httpd config:
>
> <VirtualHost *:80>
>     ServerName etherpad
>     ErrorLog /var/log/httpd-etherpad-error_log
>     CustomLog /var/log/httpd-etherpad-access_log common
>     ProxyPass /http://localhost:9000/
>     ProxyPassReverse /http://localhost:9000/
>     ProxyPreserveHost on
>     <Proxy *>
>             Options FollowSymLinks MultiViews
>             AllowOverride All
>             Order allow,deny
>             allow from all
>     </Proxy>
> </VirtualHost>
>
> I added host etherpad to my hosts file as well.
>
> And when I try to get the urlhttp://etherpad/ in my browser it
> redirects me to etherpad.com
> In the etherpad.log I see
>
> "request: 2010-06-26 21:00:44.159+0200   127.0.0.1
> etherpad        get     /       http    36f2fe262977b53d
> 302     9e2a2f95a6e9463a        Mozilla/5.0 (Windows; U; Wiows NT 6.1;
> ru; rv:1.9.2.4) Gecko/20100611 Firefox/3.6.4"
>
> When I disable "ProxyPreserveHost on" line in httpd.conf  I get html
> which contains:
>
> EtherPad: Open-Sourced!
> Create new pad
>
> But the "Create new pad" URL leads tohttp://localhost:9000/ep/pad/newpad

John McLear

unread,
Jun 30, 2010, 5:25:59 AM6/30/10
to etherpad-open-...@googlegroups.com
Sounds feasable, I have a good working nginx config I can publish, can you put together a good working guide for apache and then we will put together one big guide for putting a webserver in front of jetty?

Sergey Arlashin

unread,
Jun 30, 2010, 8:18:58 AM6/30/10
to etherpad-open-...@googlegroups.com
The problem was in  globals.js file. I should have added my hostname there.

2010/6/30 John McLear <john...@gmail.com>

Sebastian Bauer

unread,
Jul 1, 2010, 3:39:09 AM7/1/10
to EtherPad Open Source Discussion
Sounds good :) Write me a mail, so I won't forget ;) I'm still not
finished with enabling HTTPS on my apache for etherpad, since this is
no requirement for our use case, currently. Thus I've changed all
HTTPS URLs in the sources to be HTTP urls.

So I'ld like to figure out enabling proper HTTPS support, too.

@Sergey: sorry, that's what I meanth with adding it to the
"superdomains" list. But most importantly: it's working :)

On 30 Jun., 11:25, John McLear <johnym...@gmail.com> wrote:
> Sounds feasable, I have a good working nginx config I can publish, can you
> put together a good working guide for apache and then we will put together
> one big guide for putting a webserver in front of jetty?
>
> On Mon, Jun 28, 2010 at 11:40 PM, Sebastian Bauer <gjlnetw...@googlemail.com
>
> > wrote:
> > May be interesting to know, if you have also set up the
> > crossdomain.xml file properly according to your setup?
>
> > I found out that etherpad sometimes will do some strange redirects if
> > the hostname will be parsed in some manner.. In our case etherpad had
> > problems, parsing hostnames with 4 slots (http://one.two.three.four)
> > and always redirected tohttp://three.four
> > > And when I try to get the urlhttp://etherpad/in my browser it

Joe Corneli

unread,
Jul 1, 2010, 1:46:24 PM7/1/10
to etherpad-open-...@googlegroups.com
Hey John:

Config files would be nice things to add to the contrib directory
too.

Joe

Reply all
Reply to author
Forward
0 new messages