How to access Solr from an external IP address?

白昼怎懂夜的黑 提交于 2020-01-01 07:07:25

问题


I have Solr running on my server on localhost in the Jetty container.

This seems like an obvious question, but how do I access the web interface from outside the server itself, like from an external IP address? Obviously, authentication will be important as part of any solution.

I am also running Apache2 on the server, if that is a good solution. I'm surprised I can't find anything about this.


回答1:


I finally stumbled upon an answer to this. I don't really need persistent access to the Solr admin panel, so I can easily access it using local port forwarding in SSH.

All I had to do was run the following from a terminal on my local machine:

ssh -L 8983:localhost:8983 mlissner@IP-OF-SERVER-RUNNING-SOLR -N

And then open my browser to http://localhost:8983/solr/

Much easier than setting up an Apache config, doing proxies, and whatever else.




回答2:


It depends on your Jetty ContextPath. For example:

    ....
    WebAppContext explorerWebapp = new WebAppContext();
    explorerWebapp.setContextPath("/solr");
    ....

and then just navigate to your index:

    http://localhost:PORT/solr/


来源:https://stackoverflow.com/questions/8905679/how-to-access-solr-from-an-external-ip-address

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!