We're looking to beef up the security on a site, among other things we thought of trying to block access to the DB based on IP (in a similar way you can do a FTP lock dependent on IP), so that only the static IP of our VPS can access it as well as our local office IP (also static).

Is this a standard approach, I tried searching for it to see any notes on implementation / best practices, but I could see anything written about it?


If you're looking to increase security for connections to remote server applications, you might look into setting up a VPN.

If your VPS is using the Plesk control panel (as in your previous questions), you can use their VPN Module. As stated there:

Virtual Private Networking technologies allow communications between geographically distributed LAN segments over public networks. VPN message traffic passes through public networking infrastructures, such as the Internet, via secure tunnel protocols.

One of the most useful implementations of VPN is allowing access to a local network for a single remote host. For example, if a user needs to get access to a remote network from his home computer, they must establish a VPN connection.

You can then specify the remote IP address (or host name) of your local office to restrict access to just that, as covered under VPN Preferences. A VPN can also be added to a server without a control panel, and setup depends on your environment.

Another option is to create a firewall rule to only allow your local office's IP address to connect to the IP or port number that your database is accessible on. For example, MySQL uses the default port of 3306. See this for configuring the firewall in Plesk, or this for a server without a control panel.

Last but not least, you could configure the database to be accessible only on a subdomain or another domain, and then restrict access to this to just the IP address of your local office.

| improve this answer | |
  • 1
    +2 for background research / memory "If your VPS is using the Plesk control panel (as in your previous questions)" – sam Sep 3 '13 at 21:28

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.