This article aims to outline the process of whitelisting a country in cPhulk from the command line.
Method 1 (WHM):
- Log into WHM
- Navigate to WHM » Security Center » cPHulk Brute Force Protection and select the Countries Management tab:
- Search for the country you'd like to whitelist, and select "Whitelisted" on the far right. You should see a confirmation that the whitelists and blacklists have been updated in the top right of the interface:
Method 2 (Command Line):
To update the cphulk country whitelist, you would use the following WHMAPI1 function:
whmapi1 set_cphulk_config_key key=country_whitelist value=$COUNTRY_CODES
Here is an example of how you may use this function to whitelist the US in cPhulk:
whmapi1 set_cphulk_config_key key=country_whitelist value=US
There are a few notes about this function that you should be aware of.
- This value overwrites the current whitelist.
- Enter a comma-separated list to enter more than one value.
- For a list of countries, run the WHM API 1 function
Here are the accepted values you can input for the whitelist:
- A comma-separated list of valid ISO 3166-1 alpha-2 country codes.
- An empty string.
More on this WHM API function can be found here: