Getting rid of those pesky 8080 URLS

551 views
Skip to first unread message

rsignell

unread,
Aug 16, 2010, 7:53:55 PM8/16/10
to IOOS Model Data Interoperability Working Group
Folks,

I've had a request from the NOAA Unified Access Framework for Gridded
Data Project (part of the GEO Integrated Data Environment project) to
see if we can get rid of those pesky port 8080 URLS. This can be
done by putting Tomcat behind a proxy server, so that requests that
come in on port 80 for thredds get routed on the server to port
8080.

The goal is to turn allow URLs like
http://omglnx1.meas.ncsu.edu:8080/thredds
to be simply accessed by the URL:
http://omglnx1.meas.ncsu.edu/thredds

This would actually be pretty useful, as some locations don't allow
folks to access port 8080.

It sounds complicated, but it's really pretty easy. One set of
instructions are here:

http://www.unidata.ucar.edu/projects/THREDDS/tech/reference/TomcatBehindProxyServer.html

Please let me know if you are able to do this (or have troubles).

Thanks,
-Rich

Paul Reuter

unread,
Aug 16, 2010, 8:02:50 PM8/16/10
to ioos_model_...@googlegroups.com
As a friendly caution ---

DO NOT DO THIS:

ProxyRequests On

That will open your machine up to proxy spam -- basically, rouge sites
will use your machine as a middle-man to their nefarious cause, like
scraping the IEEE website for pdfs that your university has privilege
to, but other entities must register to have access to.

We were able to get the 8080 hidden with the following addition to our
httpd.conf file:
<IfModule mod_proxy.c>
ProxyRequests Off
ProxyPreserveHost On

<Location /thredds>
ProxyPass http://hfrnet.ucsd.edu:8080/thredds
ProxyPassReverse http://hfrnet.ucsd.edu:8080/thredds
</Location>

<Proxy http://hfrnet.ucsd.edu:8080/thredds>
AllowOverride None
Order allow,deny
Allow from all
</Proxy>
</IfModule>

Notice our function, non :8080 url: http://hfrnet.ucsd.edu/thredds/
Now simply sudo /etc/init.d/httpd restart and you're in business.

Regards,
Paul

Kyle Wilcox

unread,
Aug 17, 2010, 9:29:22 AM8/17/10
to ioos_model_...@googlegroups.com
I use a similar setup to get rid of the port numbers by commenting out all of the HTTP connectors from tomcat's server.xml and only leaving the AJP Connector. Then setting Apache to proxy through AJP on certain URIs.


server.xml:
<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" URIEncoding="UTF-8" />

<!--
<Connector port="8080" protocol="HTTP"...
...
-->


httpd.conf:
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so

ProxyRequests Off

<Proxy *>
Order deny,allow
Allow from all
</Proxy>

ProxyPass /tomcat/ ajp://localhost:8009/
ProxyPassReverse /tomcat/ ajp://localhost:8009/

ProxyPass /geoserver/ ajp://localhost:8009/geoserver/
ProxyPassReverse /geoserver/ ajp://localhost:8009/geoserver/

ProxyPass /thredds/ ajp://localhost:8009/thredds/
ProxyPassReverse /geoserver/ ajp://localhost:8009/thredds/

ProxyPass /manager/ ajp://localhost:8009/manager/
ProxyPassReverse /manager/ ajp://localhost:8009/manager/

________________________________________
From: ioos_model_...@googlegroups.com [ioos_model_...@googlegroups.com] On Behalf Of Paul Reuter [pre...@gmail.com]
Sent: Monday, August 16, 2010 8:02 PM
To: ioos_model_...@googlegroups.com
Subject: Re: Getting rid of those pesky 8080 URLS

DO NOT DO THIS:

ProxyRequests On

Regards,
Paul

--
You received this message because you are subscribed to the Google Groups "IOOS Model Data Interoperability Working Group" group.
To post to this group, send email to ioos_model_...@googlegroups.com.
To unsubscribe from this group, send email to ioos_model_data_i...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ioos_model_data_interop?hl=en.

SteveCousins

unread,
Aug 17, 2010, 10:22:50 AM8/17/10
to IOOS Model Data Interoperability Working Group
I do the same thing with ProxyPass and ProxyPassReverse and it works.
Mostly. One thing that always gets me is the trailing slash. For
instance if I go to:

http://rocky.umeoce.maine.edu/ncWMS

That page comes up but when I click on any of the links (like the
Godiva2 interface) it takes me to:

http://rocky.umeoce.maine.edu/godiva2.html

which doesn't work. The original address needs the trailing slash
like:

http://rocky.umeoce.maine.edu/ncWMS/

in order for the links to work. I tried to take care of this by having
two sets of ProxyPass/ProxyPassReverse items:

with slash:
ProxyPass /ncWMS/ http://rocky.umeoce.maine.edu:8080/ncWMS/
ProxyPassReverse /ncWMS/ http://rocky.umeoce.maine.edu:8080/ncWMS/

without slash:
ProxyPass /ncWMS http://rocky.umeoce.maine.edu:8080/ncWMS/
ProxyPassReverse /ncWMS http://rocky.umeoce.maine.edu:8080/ncWMS/

but it doesn't work. Anybody else run into this? Any work arounds? I'm
just using mod_proxy. Maybe the other way that Kyle talked about with
mod_proxy_ajp works?

Steve


On Aug 16, 7:53 pm, rsignell <rsign...@gmail.com> wrote:
> Folks,
>
> I've had a request from the NOAA Unified Access Framework for Gridded
> Data Project (part of the GEO Integrated Data Environment project) to
> see if we can get rid of those pesky port 8080 URLS.    This can be
> done by putting Tomcat behind a proxy server, so that requests that
> come in on port 80 for thredds get routed on the server to port
> 8080.
>
> The goal is to turn allow URLs likehttp://omglnx1.meas.ncsu.edu:8080/thredds
> to be simply accessed by the URL:http://omglnx1.meas.ncsu.edu/thredds
>
> This would actually be pretty useful, as some locations don't allow
> folks to access port 8080.
>
> It sounds complicated, but it's really pretty easy.  One set of
> instructions are here:
>
> http://www.unidata.ucar.edu/projects/THREDDS/tech/reference/TomcatBeh...

Walt McCall

unread,
Aug 17, 2010, 11:21:36 AM8/17/10
to ioos_model_...@googlegroups.com
When we setup our THREDDS servers NDBC set up a proxy allowing access as
described.

http://dods.ndbc.noaa.gov/thredds/catalog/data/catalog.html
or
http://dods.ndbc.noaa.gov:8080/thredds/catalog/data/catalog.html

Walt

Walt_McCall.vcf

Rich Signell

unread,
Aug 17, 2010, 11:27:29 AM8/17/10
to ioos_model_...@googlegroups.com
Steve,

Strange. I just set up proxyPass for
http://omglnx1.meas.ncsu.edu/thredds
http://omglnx1.meas.ncsu.edu/ncWMS
following the steps here:
http://bit.ly/apachepp
and I don't seem to have this problem.

-Rich

> --
> You received this message because you are subscribed to the Google Groups "IOOS Model Data Interoperability Working Group" group.
> To post to this group, send email to ioos_model_...@googlegroups.com.
> To unsubscribe from this group, send email to ioos_model_data_i...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/ioos_model_data_interop?hl=en.
>
>

--
Dr. Richard P. Signell   (508) 457-2229
USGS, 384 Woods Hole Rd.
Woods Hole, MA 02543-1598

Kyle Wilcox

unread,
Aug 17, 2010, 11:36:16 AM8/17/10
to ioos_model_...@googlegroups.com
You can set up rewrite rules to add a trailing slash before the proxy like so:

RewriteEngine on
RewriteRule ^/tomcat$ tomcat/ [R]
RewriteRule ^/thredds$ thredds/ [R]
RewriteRule ^/ncWMS$ ncWMS/ [R]
RewriteRule ^/geoserver$ geoserver/ [R]

________________________________________
From: ioos_model_...@googlegroups.com [ioos_model_...@googlegroups.com] On Behalf Of SteveCousins [steve....@maine.edu]
Sent: Tuesday, August 17, 2010 10:22 AM
To: IOOS Model Data Interoperability Working Group


Subject: Re: Getting rid of those pesky 8080 URLS

I do the same thing with ProxyPass and ProxyPassReverse and it works.

http://rocky.umeoce.maine.edu/ncWMS

http://rocky.umeoce.maine.edu/godiva2.html

http://rocky.umeoce.maine.edu/ncWMS/

Steve

--

Reply all
Reply to author
Forward
0 new messages