Git Product home page Git Product logo

Comments (5)

Firegarden avatar Firegarden commented on May 27, 2024 2

@Firegarden

Hi,

Maybe this part of the code is more or less absolute but not all!
The work that @angristan does is very good.

Propose him a PR with the new module ....

	# GeoIP2
	if [[ "$GEOIP" = 'y' ]]; then
		# Dependency
		add-apt-repository ppa:maxmind/ppa -y >> /tmp/nginx-autoinstall.log 2>&1
		apt update >> /tmp/nginx-autoinstall.log 2>&1			
		apt install libmaxminddb0 libmaxminddb-dev mmdb-bin >> /tmp/nginx-autoinstall.log 2>&1
					
		cd /usr/local/src/nginx/modules || exit 1
		git clone --recursive https://github.com/leev/ngx_http_geoip2_module >> /tmp/nginx-autoinstall.log 2>&1

		echo -ne "       Downloading GeoIP2 databases   [..]\\r"

		sudo mkdir -p /etc/nginx/geoip2/
		wget http://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.tar.gz >> /tmp/nginx-autoinstall.log 2>&1
		tar xaf GeoLite2-Country.tar.gz  --strip 1
		mv GeoLite2-Country.mmdb /etc/nginx/geoip2/
		
		wget https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz >> /tmp/nginx-autoinstall.log 2>&1
		tar xaf GeoLite2-City.tar.gz --strip 1
		mv GeoLite2-City.mmdb /etc/nginx/geoip2/	

		if [ $? -eq 0 ]; then
			echo -ne "       Downloading GeoIP2 databases   [${CGREEN}OK${CEND}]\\r"
			echo -ne "\\n"
		else
			echo -e "       Downloading GeoIP2 databases    [${CRED}FAIL${CEND}]"
			echo ""
			echo "Please look at /tmp/nginx-autoinstall.log"
			echo ""
			exit 1
		fi
	fi

Then in nginx modules line add

GeoIP2

	if [[ "$GEOIP" = 'y' ]]; then			
		NGINX_MODULES=$(echo "$NGINX_MODULES"; echo "--add-module=/usr/local/src/nginx/modules/ngx_http_geoip2_module")
	fi

That will do it to change out and add support for geoip2

from nginx-autoinstall.

Rathorian avatar Rathorian commented on May 27, 2024

Salut,

Je te relance concernant l'issue.
C'est loin d'être grave mais comme je n'ai eu aucune réponse !

from nginx-autoinstall.

Firegarden avatar Firegarden commented on May 27, 2024

Translation
"
Hi,

I just realized by using your installation script that GeoIP does not work and that's normal.

When you download the two GeoIP files, you put them in "/ usr / local / src / nginx / modules / geoip-db". The problem is that you delete them at the end of the script for cleaning, without moving the "geoip-db" folder in "/ opt", as indicated in the README.md"

Translation
"Hi,
I am relaunching you on the issue.
It is far from serious but as I had no answer!"

The answer would be to move the files to that folder or I suggest you use the following path:

/etc/nginx/geoip

The real problem is that this script is out of date and we actually want to support the geo ip2 database format as geo ip 1 is becoming obsolete.

Really we need to get the script modified to support ngx_http_geoip2_module

Halla if you hear me!

from nginx-autoinstall.

Rathorian avatar Rathorian commented on May 27, 2024

@Firegarden

Hi,

Maybe this part of the code is more or less absolute but not all!
The work that @angristan does is very good.

Propose him a PR with the new module ....

from nginx-autoinstall.

angristan avatar angristan commented on May 27, 2024

Added in 0bcd264

from nginx-autoinstall.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.