On Ubuntu, you can use the built in Uncomplicated Firewall tool to set access to the server at a firewall level:
Start by denying all access:
$ sudo ufw default deny
However, we don't want to break the SSH connection that we're currently using, so make sure that we allow access for SSH connections:
$ sudo ufw allow ssh
Also, we want to allow all connections from our local IP address:
$ sudo ufw allow from <ip address>
Here,
<ip address>
is the IP address of the machine you are connecting from. You will also want to add the IP address of your Drupal server here if it's different from your Solr server. Just run the preceding command again, changing the IP address to that of your Drupal server. For further details, see the Ubuntu UFW documentation at https://help.ubuntu.com/community/UFW.Now enable the firewall with the following settings:
$ sudo ufw enable
You may receive a warning to say that the existing SSH commands may be...