Mobile app version of vmapp.org
Login or Join
Shelton105

: Proxy pass from apache to jetty using localhost In my `/etc/apache2/sites-enabled file I have two proxy pass statements: one to a Virtuoso server which works with localhost and one to a jetty

@Shelton105

Posted in: #Apache #Proxy

In my `/etc/apache2/sites-enabled file I have two proxy pass statements: one to a Virtuoso server which works with localhost and one to a jetty server on localhost which doesn't, because "Firefox can't establish a connection to the server at localhost:8983.".

Only when I give it the absolute IP does it work. What is additionally strange is that while for all other proxy passes the apparent URL in the browser adress field does not change while in the case of jetty it switches over to the one given in the proxy pass statement. Why does localhost not work with jetty even if the two are on the same server?

ProxyPass /sparql localhost:8890/sparql # ProxyPass /solr localhost:8983/solr # does not work
# ProxyPass /solr [IP 6 Adress]:8983/solr # does work


Follow Up
I managed to preserve the URL with ProxyPreserveHost On in the sites-available file but with localhost it still doesn't work. I will check the hostname setting now.

NMap also reports localhost as up:

nmap -p 8983 localhost
Starting Nmap 5.21 ( nmap.org ) at 2014-07-17 10:21 CEST
Nmap scan report for localhost (127.0.0.1)
Host is up (0.000079s latency).
PORT STATE SERVICE
8983/tcp open unknown


Answer
As said by Thyamarkos, adding the host name in /etc/jetty/jetty-rewrite.xml did the trick. Thanks!

<Set name="virtualHosts">
<Array type="java.lang.String">
<Item>localhost</Item>
<Item>127.0.0.1</Item>
</Array>
</Set>

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Shelton105

1 Comments

Sorted by latest first Latest Oldest Best

 

@Welton855

Check your Jetty configuration because although your "localhost" ProxyPass might take you to the proper host, the server itself may be configured to use the IP as a hostname (or not have the hostname configured properly at all).

The behavior that you are describing about the URL also points in the same direction - your ProxyPass works but then the host is doing some internal redirect.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme