2

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 http://localhost:8890/sparql
#    ProxyPass /solr http://localhost:8983/solr # does not work
#    ProxyPass /solr http://[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 ( http://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>
2

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.