×

Setup instructions

Quick start

 
 

Search engine setup

 
Create a folder on your server to store the configuration file and navigate into it:
 
sudo mkdir /opt/drexplain-search
cd /opt/drexplain-search
 
Create a file:
 
sudo touch docker-compose.yaml
 
Open it for editing (sudo nano docker-compose.yaml).
 
Copy and paste into this file the following text:
 
services:
  # This is an application that handles HTTP requests and communicates with Apache Solr search engine.
  drexplain-search-backend-controller:
    image: ghcr.io/indigobyte/dsb-controller:latest
    restart: unless-stopped
    volumes:
      # IMPORTANT: replace this with actual server paths to exported HTML files in format "host_path:container_path:ro" (read-only).
      # For example: type 6 spaces, minus, space, paste the absolute path to the folder with your HTML files,
      # colon, then the same absolute path again, and add ":ro" at the end.
      - /var/www:/var/www:ro
    # IMPORTANT: replace these with actual container paths. Environment variables must start with DREX_CONTENT_ROOT prefix.
    # For example: type 6 spaces, minus, space, DREX_CONTENT_ROOT_, language code of your HTML files, equal sign,
    # and then the absolute path to the folder with these HTML files.
    environment:
      - DREX_CONTENT_ROOT_EN=/var/www/docs-en
      - DREX_CONTENT_ROOT_ES=/var/www/docs-es
    ports:
      # To make the service accessible from other computers, delete the "127.0.0.1:" part. WARNING: this will expose
      # the service to all network interfaces. Only do this if you have proper firewall rules in place.
      - "127.0.0.1:8082:8082"
    depends_on:
      - solr
 
  # This is Apache Solr search engine.
  solr:
    image: ghcr.io/indigobyte/dsb-solr:latest
    restart: unless-stopped
    volumes:
      - solr-data:/var/solr
    environment:
      # Increase this value for large indexes.
      - SOLR_HEAP=2700m
    ulimits:
      memlock:
        soft: -1
        hard: -1
      nofile:
        soft: 65536
        hard: 65536
 
volumes:
  # This volume contains search engine index data.
  solr-data:
 
Modify the mount paths (volumes section) and environment variables (environment section) in docker-compose.yaml file to match your server's directory structure and save the file.
 
Then start the search engine:
 
sudo docker compose up -d
 

Web server configuration

 
It is recommended to install the search engine on the same server where your Dr.Explain HTML files are hosted (see additional information on how to install on a different server). Configure your web server as a reverse proxy that forwards requests containing the /drexsearch/ path to the search engine listening on port 8082.
 
Configuration blocks for popular web servers are provided below:
 

nginx

 
Add the following block to your nginx configuration:
 
location ~ /drexsearch/(.*)$ {
    proxy_pass http://127.0.0.1:8082/$1$is_args$args;
}
 

Apache

 
You must enable mod_rewrite, mod_proxy, and mod_proxy_http modules for Apache. Add the following to your virtual host configuration or .htaccess file:
 
RewriteEngine On
RewriteRule ^(?:.*/)?drexsearch/(.*)$ http://127.0.0.1:8082/$1 [P,L]
 

Caddy

 
Add the following to your Caddyfile configuration:
 
@drexsearch path_regexp /drexsearch/(.*)$
reverse_proxy @drexsearch 127.0.0.1:8082 {
    rewrite /{re.1}
}
 

Microsoft Internet Information Services

 
You must install URL Rewrite and Application Request Routing components, then add the following rule to your web.config configuration under /configuration/system.webServer/rewrite/rules section:
 
<rule name="Dr.Explain Search Backend" stopProcessing="true">
    <match url="^(?:.*/)?drexsearch/(.*)$" />
    <action type="Rewrite" url="http://127.0.0.1:8082/{R:1}" />
</rule>
 

See also

 
Made by Dr.Explain, software documentation tool