cancel
Showing results for 
Search instead for 
Did you mean: 

cpanel ip block and Magento 2 multistore

cpanel ip block and Magento 2 multistore

We use cpanel IP blocker function to block some IP's. However we have a Magento 2.2.6 multistore setup with for every store a folder with it's own .htaccess.

Now cpanel only blocks in public_html.

When we try to copy the IP's then that site give a server misconfiguration.
Weird as the . htaccess is exactly the same.

Anybody any solution on an effective way to block visitor IP's on a Magento 2 multistore setup? Thank you.

2 REPLIES 2

Re: cpanel ip block and Magento 2 multistore

Hello @emile_rdam ,

 

First, from Admin Panel, store owners have to navigate System > Security > Configuration. Then on the display page, they can easily see General section. Here they need to turn on this extension by selecting Yes in this field.

After that, admins have to navigate Blacklist/ Whitelist IPs section to start configuring.

 

Blacklist

In this field, all IPs entered here will be forbidden whenever there is someone use them to login. There are several options can be chosen here regarding the number of IPs that will be forbidden. Admins are enabled to enter one IP, multiple IPs, or a range of IPs. In case there is more than one IP is chosen, each IP will be separated with each other by a comma.

Besides, store owners are allowed to enter forbidden IPs which are in form of wildcard as follows: 10.0.0., 10.0.., 10.0.0. - 123.0.0.*, and so on. The symbol * is a variant which its value ranges from 1 to 255.

https://www.screencast.com/t/mkMXpt31j

uxwMWIc.png

 

Whitelist

On the contrary, every IP which exists in Whitelist box has the right to login admin page. Concerning the number of valid IPs can be entered, admins can choose to fill in one IP, several IPs, or various ranges of IPs. If shop admins want to add more values in this field box, they need to use a comma to separate two IPs with each other.

In addition, there are some forms which admins can empower them to login their management page such as 10.0.0., 10.0.., 10.0.0. - 123.0.0.*, and so on. The symbol * is a variant which its value also ranges from 1 to 255.

 

Notice

Store owners need to be careful when they decide to fill in Blacklist and Whitelist as only IPs presented in Whitelist IPs have the right to log in the admin page. Whereas, IP addresses in Blacklist are blocked. However, Blacklist is given the higher priority. It means that a value which is entered in both list, will be blocked.

In case, shop admins mistyping their IP address into Blacklist field will result in their failure in attempt to sign in admin page. In this situation, they need to use command line and to reset their blacklist with the command: “bin/magento security:reset blacklist”. After that, they need to run another command: “bin/magento cache:flush”. Then, shop admins can sign in their admin page freely as all IPs filled in Blacklist IPs are already deleted when reset. It means that, Blacklist IPs filed has no restricted IPs.

Similar to Blacklist, once store owners want to reset their Whitelist IPs, they have to take two commanding actions as follows: “bin/magento security:reset whitelist” and then “bin/magento cache:flush”.

In case, both Blacklist and Whitelist IPs need to be reset, store owners can use the command: “bin/magento security:reset”. After that, both Blacklist and Whitelist field will be left empty.

 

 

Extension

https://www.mageworx.com/geo-lock-magento2-extension.html

Prevent fraudulent customer actions by identifying the precise site visitors’ location. You will be able to manage website access of the customers from specific locations and IP addresses, as well as keep the unauthorized visitors informed about that.

 

    Developed according to the official Magento 2 programming guidelines

 

    Designed for the standard Magento 2 functionality, tested on the default theme and checkout.

 IMPORTANT! 

    In case you need to adjust the extension for a custom-built checkout or theme, drop us a line.

 

 


--
If my answer is useful, please Accept as Solution & give Kudos

Re: cpanel ip block and Magento 2 multistore

try to block IP with htaccess rather than Cpanel, you will lose all configuration when you move to another hosting