[MOV] geo ip installation: move page to install

Page moved from Websites to Install section

taskid-3512515

X-original-commit: a9004e844f
Part-of: odoo/documentation#7392
This commit is contained in:
Donatienne (dopi)
2023-12-29 13:34:49 +01:00
committed by Jonathan Castillo (jcs)
parent be60243eff
commit 83a68e4b9b
5 changed files with 11 additions and 9 deletions
+1 -2
View File
@@ -184,8 +184,7 @@ Fill out the fields on the :guilabel:`Open: Rules` pop-up as instructed below, t
.. note::
In order to track the geographical location of visitors, :guilabel:`GeoIP` must be installed on
the database. While this feature is installed by default on *Odoo Online*, *On-Premise* databases
will require additional :doc:`setup steps
</applications/websites/website/configuration/on-premise_geo-ip-installation>`.
will require additional :doc:`setup steps </administration/install/geo_ip>`.
Widget
------
@@ -13,4 +13,3 @@ Configuration
configuration/multi_website
configuration/unsplash
configuration/spam_protection
configuration/on-premise_geo-ip-installation
@@ -1,60 +0,0 @@
==========================================
Geo IP Installation (On-Premises Database)
==========================================
Installation
============
#. Download both the GeoLite2 City and Country
`databases <https://dev.maxmind.com/geoip/geoip2/geolite2/>`_. You should end up with two files
called :file:`GeoLite2-City.mmdb` and :file:`GeoLite2-Country.mmdb`.
#. Move the files to the folder :file:`/usr/share/GeoIP/`.
.. code-block:: bash
mv ~/Downloads/GeoLite2-City.mmdb /usr/share/GeoIP/
mv ~/Downloads/GeoLite2-Country.mmdb /usr/share/GeoIP/
#. Restart the server
.. note::
If you don't want to locate the geoip database in :file:`/usr/share/GeoIP/`, use the
:option:`--geoip-city-db <odoo-bin --geoip-city-db>` and
:option:`--geoip-country-db <odoo-bin --geoip-country-db>` options of the Odoo command line
interface. These options take the absolute path to the GeoIP database file and use it as the
GeoIP database. For example:
.. code-block:: bash
./odoo-bin --geoip-city-db= ~/Downloads/GeoLite2-City.mmdb
.. seealso::
- :doc:`CLI documentation </developer/reference/cli>`.
Test GeoIP Geolocation In Odoo Website
======================================
Edit a web page to include some geo-ip information such as the country name of the current
request IP address. To do so:
#. Go to your website. Open the web page that you want to test ``GeoIP``.
#. Choose :menuselection:`Customize --> HTML/CSS/JS Editor`.
#. Add the following piece of XML in the page :
.. code-block:: xml
<h1 class="text-center" t-esc="request.geoip.country.name or 'geoip failure'"/>
#. Save and refresh the page.
Geo-ip is working if you read your country name displayed in bold in the middle of the page.
In case you read "**geoip failure**" instead then the geolocalization failed. The common causes are:
#. The browsing IP address is the localhost (``127.0.0.1``) or a local area network one. If you
don't know, you can access your website using mobile data.
#. You are using a reverse-proxy (apache, nginx) in front of Odoo but didn't start Odoo with the
proxy-mode enabled. See :option:`proxy mode <odoo-bin --proxy-mode>`.
#. The GeoIP database is corrupt, missing or unaccessible. In such case a warning was logged in the
server logs.