Bobcares

Enable Geolocation In LiteSpeed | How To?

by | Oct 21, 2022

Let’s explore the steps to enable Geolocation in LiteSpeed. Bobcares, as a part of our Server Management Services, offers solutions to every query that comes our way.

Enabling Geolocation In LiteSpeed

The LiteSpeed server can handle more traffic with fewer processes, which saves resources and improves page speed. Enabling Geolocation on LiteSpeed helps LiteSpeed Web Server’s site software/plugins to determine the country/city from which visitors are connecting.

Enable Geolocation in LiteSpeed

In the LSWS WEB Admin Console settings, there are two sections: IP to GeoLocation DB and IP2Location DB. Use IP to GeoLocation DB for both the MaxMind Legacy DB and the MaxMind GeoIP2 DB, and IP2Location DB for the IP2Location database. Only one location DB should be used at a time.

Steps To Enable Geolocation In LiteSpeed

In order to set up and enable GeoIP or IP2Location on LSWS, we have to run some steps. Firstly, we need to choose a database. Then download and install the DB to a directory. Then configure the DB path in LSWS Admin. Also, enable GeoIP or IP2Location through the Apache configuration. And lastly, conduct certain tests. Let’s look into the details:

  1. Firstly, turn on “GeoIPEnable” in Apache config.

    Go to to WHM >> Service Configuration >> Apache Configuration >> Include Editor >> Pre Main Include. Select All Versions in the dropdown box. Add the following to the text box. And also add it directly to pre_main_global.conf through the command line.

    <IfModule LiteSpeed>
    GeoIPEnable On
    </IfModule>
  2. Now upload the db GeoLite2-Country_20220923.tar.gz file to the server and move to the location /usr/share/GeoIP/.
  3. Unzip the tar file using the below code:
    tar -xvf GeoLite2-Country_20220923.tar.gz
  4. Copy all files in the tar file to different folders.
    cp -pr * ../
  5. Then set up the DB.

    Configure the database location and name in LSWS WebAdmin. We can select COUNTRY_DB for a country DB and CITY_DB for a city DB. Go to Configuration >> Server >> General >> General settings and set IP2Location DB to the database path. Then set DB Name to COUNTRY_DB or CITY_DB.

  6. Finally, enable Geolocation Lookup >> Yes in General settings.

[Looking for a solution to another query? We are just a click away.]

Conclusion

To conclude, we provide a quick and simple method from our Tech team to enable geolocation in LiteSpeed web servers.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.