The main purpose of the project in this repository was to create config files for my setup which can be quickly deployed, in the event I needed to rebuild the service.
This project provides an easy and fast way to set up EchoIP, a service that offers IP geolocation lookups, using the MaxMind GeoLite2 databases (City, ASN, and Country). The goal of this project is to streamline the deployment of EchoIP by automating the process of downloading, extracting, and organizing the required GeoLite2 data files, then running the service in a Docker container.
## Features
- Runs an EchoIP service in a Docker container to provide geolocation lookup via the GeoLite2 databases.
- Change the `/path/to/default/main/data/folder` to the location where the project was downloaded or will be run from. The downloaded and extracted database files will be placed in the geolite2/db directory structure.
The Docker container uses the mpolden/echoip:latest image, which serves IP geolocation data based on the GeoLite2 databases. The docker-compose.yml file is provided to set up the service.
This file defines the EchoIP service and mounts the database files for the container to access. It also binds the service to port 8085.
Configuration
Make sure the volumes section correctly points to the geolite2/db directory:
To proxy requests to the EchoIP service, you'll need to configure your Apache HTTP server.
Add the following configuration to your Apache server's configuration file (httpd.conf or a dedicated virtual host file). This configures Apache to forward requests to the EchoIP service running on localhost:8085 and supports the X-Forwarded-For header.
```
<VirtualHost*:80>
ServerName FULLY.QUALIFIED.DOMAIN.NAME
RemoteIPHeader CF-Connecting-IP
ProxyPreserveHost On
ProxyRequests Off
ProxyPass / http://127.0.0.1:8085/
ProxyPassReverse / http://127.0.0.1:8085
# Add support for X-Forwarded-For
RequestHeader set X-Forwarded-For "%{REMOTE_ADDR}s"
* Ensure that your MaxMind credentials are correct in the download_geoip.sh script. Every time the geolite2-db-update.sh script is ran it will log to the log/download.log file.
* Check the Apache logs (/var/log/apache2/echoip-error.log) for any issues related to the proxy configuration.
* If Docker fails to start the EchoIP container, check the Docker logs with docker logs echoip.