Also, don’t forget to refresh your DNS by then. Register a new license by activating the license after a hardware upgrade.įor three days, your old and new copy will run parallel. Sudo /usr/local/lsws/bin/lshttpd -V #Verify your migrated license on your old server. Sudo /usr/local/lsws/bin/lshttpd -m #Migrate the license from your old server You can use it to check whether you need to migrate your license after your hardware upgrade. Sudo /usr/local/lsws/bin/lshttpd -V #Verify your current license on the old server. ![]() Now run the following command on your old server: Below are the steps for the same.įirst Backup your current serial.no and license key Under /user/ local/lsws/conf or user/local/lsws/ Conf. If you have changed your server (VPS), you can migrate the Litespeed license key. In this example, we will use PHP code to output the country code and country name. RewriteCond % !^(IE|GB|NL)$ Example 5 - Use the variable in PHP code Any other countries will be able to access the website normally. In this example, the code will deny access to visitors in 3 countries (Ireland, United Kingdom, Netherlands). SetEnvIf GEOIP_COUNTRY_CODE GB PermitCountryĪny users not from DE or GB will encounter a "403 Forbidden" error when visiting the website. SetEnvIf GEOIP_COUNTRY_CODE DE PermitCountry In this example, the code will allow access from visitors in two countries only, DE (Germany) and GB (United Kingdom). Example 2 - Allow access from only 2 countries SetEnvIf GEOIP_COUNTRY_CODE US BlockCountryĪny users from RU, CN or US will encounter a "403 Forbidden" error when visiting the website. SetEnvIf GEOIP_COUNTRY_CODE CN BlockCountry SetEnvIf GEOIP_COUNTRY_CODE RU BlockCountry In this example, the code will deny access from visitors in 4 countries: RU (Russia), CN (China) and US (United States). We will provide four examples, to deny access, to allow access, to redirect visitors and to use in PHP code. The full list of country codes can be found here: In this guide we'll concentrate on GEOIP_COUNTRY_CODE which outputs a 2-digit ISO country code, from AF (Afghanistan) to ZW (Zimbabwe). The main GeoIP variables that will be made available on your website are: GEOIP_ADDR The main directory is normally called public_html unless you are working with a sub-domain or addon domain, which will have its own directory. ![]() htaccess file, simply create one in the main directory of your website. ![]() To enable GeoIP on your website, you must add the following 3 lines to the top of your. When the new database is able to integrate with our servers, the system will be updated accordingly. Mod_GeoIP is a legacy database, and has been replaced by Mod_MaxMindDB, but at this time it does not integrate with the Apache web server.Multinational corporations often have an IP range based on where their headquarters are, this could result in false positive results for these users.Users can always get around a country allow/deny access by using a VPN/proxy.New IP ranges will take some time to appear in the database or may be mapped to the wrong country initially.The country database is estimated to have 99.8% accuracy, but that isn't perfect, so it should not be used for critical applications.The Mod_GeoIP database has been compiled by MaxMind, a third-party provider.This can be used to deny/allow access to your website. All our shared/enterprise/reseller hosting servers include Mod_GeoIP, which is a database that can be used to map a website visitor's IP address to their country.
0 Comments
Leave a Reply. |