• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Question Setting up a reverse proxy for solr from within Plesk panel

Another_Omeka_User

Basic Pleskian
Hi, I need to set up a reverse proxy for the solr admin console (solr 5.3.1), which is on a separate port (8983) but totally open to the outside world (yikes). I can't just firewall the port or solr basic authentication because a site on port 80 accesses it (php scripts use it search the index); the scripts break and throw errors on the search when either of these methods is employed. So someone suggested I set up a Reverse Proxy instead. I'm totally unfamiliar with how to do this. However, I followed directions online that told me to modify the apache config file (CentOS 7) with the following lines:

<Location /solr >
AuthName "Secure Area"
AuthType Basic
AuthUserFile /path/to/htpasswd/.htpasswd require valid-user
</Location>
ProxyPass /solr http://localhost:8983/solr
ProxyPassReverse /solr http://localhost:8983/solr

And set up the htpasswd, which I did. When I restart the server, nothing changes, I'm never prompted for a password. (It also said I needed to edit the jetty file to default to localhost, which makes sense, but when I do that I get a broken page.)

To be honest, despite reading numerous manuals and blog posts, I don't really understand why this is breaking or even how to tell when/if the proxy is working. So now I wonder if it's possible instead to just set this all up in the Plesk panel because maybe I'm messing something up...

Any suggestions, thoughts, or advice?
 
Hello partner, we installed solr a while ago and the only special thing we had to do is to run a few commands and open the ports that I would use solr for your admin panel.
 
I don't quite understand - the port 8983 is open for the solr admin console/panel. It works fine. The problem is that this means the whole world can also access it if they just add 8983 to the address. I want to make the admin console secure so the outside world can NOT see it, ever.
 
Oh, in that case try to allow in the firewall the access of those ports only from your ip.

I would put the configuration as follows:

Code:
<VirtualHost *:8983>
   ServerAdmin webmaster@localhost
   DocumentRoot /ROUTE/solr
   ErrorLog ${APACHE_LOG_DIR}/error.log
   CustomLog ${APACHE_LOG_DIR}/access.log combined

   <Directory "/route/solr">
       AuthType Basic
       AuthName "Secure Area"
       AuthUserFile /path/to/htpasswd/.htpasswd
       Require valid-user
   </Directory>
</VirtualHost>

have you created the users inside the file with the following command?
Code:
htpasswd /etc/apache2/.htpasswd user

remember to restart the apache server after applying config
 
Will the above work if I'm on a VPS? I need to Reverse Proxy because I still want to be able to access the admin console from anywhere. I don't want it ONLY accessible to a single IP.
 
Will the above work if I'm on a VPS? I need to Reverse Proxy because I still want to be able to access the admin console from anywhere. I don't want it ONLY accessible to a single IP.
Yes, it is a service that works at the OS level, it does not matter if it is a vps or a dedicated
 
Back
Top