Install Meilisearch and run on windows

2023-09-11 Posted in SearchRust

meilisearch is good search engine that is simple and very fast with a good rest api. If you want to run meilisearch on Windows, you have to compile the code, but it's very simple.

Step 1 Clone meilisearch from Github

git clone https://github.com/meilisearch/MeiliSearch

Step 2 Install the Rust tools

In order to compile the project you have to install Rust, you will find a get started guid here

Step 3 Install C++ dev tools from Visual Studio

You need c++ dev tools from visual studio make sure it is installed. Open the Visual Studio installer and select Desktop development with C++

Visual Studio Workloads

Step 4 Compile the project

Go to the folder where you cloned the repository and run the commands:

rustup update

cargo build --release

Step 5 Run the program

When it has finished compiling, go to the folder /target/release

Now you can run meilisearch it will generate a master key if you don't submit one ./meilisearch.exe

Meilisearch have several libraries for 10 different languages here is an example in C#

MeilisearchClient client = new MeilisearchClient("http://localhost:7700", "masterkey");

try
{
   index = await client.GetIndexAsync("Movies");
}
catch (Meilisearch.MeilisearchApiError ex)
{

   if (ex.Code == "index_not_found")
   {
       await client.CreateIndexAsync("Movies", "MovieId");

       index = await client.GetIndexAsync("Movies");
   }
}

var MovieItem = new Movie(){
   Name = "Apollo 11",
   Year = 2019,
   IMDB = "tt8760684"
};

await index!.AddDocumentsAsync(MovieItem, "objectId");


var results = await index.SearchAsync<Movie>("Apollo");

Install QGIS Server on windows

2023-09-09 Posted in QgisQgis ServerOsgeo4WWindowsGIS

Here are all the steps you need to do to be able to install QGIS Server on Windows.

Step 1 Download

Start by downloading Osgeo4W installer https://qgis.org/en/site/forusers/alldownloads.html

For more instructions go to qgis official documentation at docs.qgis.org Getting Started

Select the following packages: OSGeo4W_Packages

Step 2 Configure Apache

Open the following file C:\OSGeo4W\apps\apache\conf\httpd.conf

Change the following lines

Current config Replacement row
Define SRVPORT 80 Define SRVPORT 8080
ScriptAlias /cgi-bin/ "${SRVROOT}/cgi-bin/" ScriptAlias /cgi-bin/ "C:/OSGeo4W/apps/qgis/bin/"
#AddHandler cgi-script .cgi AddHandler cgi-script .cgi .exe
# LoadModule foo_module modules/mod_foo.so LoadModule fcgid_module modules/mod_fcgid.so

Apache permissions on folders

Find the following:

<Directory "${SRVROOT}/cgi-bin">
    AllowOverride None
    Options None
    Require all granted
</Directory>

Replace it with the following:

<Directory "C:/OSGeo4W/apps/qgis/bin/">
    SetHandler cgi-script
    AllowOverride None
    Options +ExecCGI
    Require all granted
</Directory>

Find the following:

<Directory />
    AllowOverride none
    Require all denied
</Directory>

Replace it with the following:

<Directory />
    AllowOverride none
    Require all granted
</Directory>

Custom OSGeo4W configuration variables

Find the following (probably at the bottom of the file):

IncludeOptional "C:/OSGeo4W/httpd.d/httpd_*.conf"

Add it here

SetEnv GDAL_DATA "C:/OSGeo4W/share/gdal"
SetEnv QGIS_AUTH_DB_DIR_PATH "C:/OSGeo4W/apps/qgis/resources"

SetEnv O4W_QT_PREFIX "C:\OSGeo4W/apps/Qt5"
SetEnv O4W_QT_BINARIES "C:\OSGeo4W/apps/Qt5/bin"
SetEnv O4W_QT_PLUGINS "C:\OSGeo4W/apps/Qt5/plugins"
SetEnv O4W_QT_LIBRARIES "C:\OSGeo4W/apps/Qt5/lib"
SetEnv O4W_QT_TRANSLATIONS "C:\OSGeo4W/apps/Qt5/translations"
SetEnv O4W_QT_HEADERS "C:\OSGeo4W/apps/Qt5/include"
SetEnv O4W_QT_DOC "C:\OSGeo4W/apps/Qt5/doc"

SetEnv PATH "C:\OSGeo4W\apps\qt5\bin;C:\OSGeo4W\bin;C:\OSGeo4W\apps\qgis\bin;C:\OSGeo4W\apps\grass\@grasspath@\bin;C:\OSGeo4W\apps\grass\@grasspath@\lib;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem"
SetEnv QGIS_PREFIX_PATH "C:\OSGeo4W\apps\qgis"
SetEnv QT_PLUGIN_PATH "C:\OSGeo4W\apps\qgis\qtplugins;C:\OSGeo4W\apps\qt5\plugins"
SetEnv TEMP "C:\Users\marlin\AppData\Local\Temp\4"
SetEnv PYTHONHOME "C:\OSGeo4W\apps\Python39"
SetEnv PYTHONPATH "C:\OSGeo4W\apps\Python39;C:\OSGeo4W\apps\Python39\Scripts"
SetEnv PROJ_LIB "C:\OSGeo4W\share\proj"

Step 3 Install apache web server as a Windows Service

Run the following: C:\OSGeo4W\bin\apache-install.bat

To restart the server run this: apache-restart.bat Or you can go to the services in windows and search for the service called Apache OSGeo4W Web Server and restart it.

1 2 3 4 5 6 7 8 9 10 11 12