Skip to content

Deployment Overview of Apache Solr on Server

Prerequisites and Basic Requirements

To ensure a successful deployment, the following requirements must be met:

  • Operating System: Ubuntu.

  • Privileges: Root or sudo access is required for installing dependencies and managing Docker containers.

  • Docker: The system must have Docker installed to run the application and the proxy service.

  • Ports:

  • 3000: Internal application port.

  • 443: External HTTPS port (managed via Nginx).

FQDN of the final panel on the hostkey.in domain

The application is accessible via a specific subdomain template:

Parameter Value
Prefix apache-solr
Domain hostkey.in
Full template apache-solr{Server_ID_from_Invapi}.hostkey.in

File and Directory Structure

The application uses the following directory structure for data persistence and configuration:

  • /opt/solr/data: Main data directory for Apache Solr (owned by user 8983).

  • /opt/solr/data/data: Subdirectory specifically for security configurations.

  • /root/nginx: Directory containing the Nginx Docker Compose configuration.

  • /data/nginx/user_conf.d: Directory for Nginx virtual host configurations.

Application installation process

The installation of Apache Solr is performed using a combination of system directory setup and Docker container deployment:

  1. Directory Preparation: The system creates the necessary data directories in /opt/solr/data with specific ownership (8983:8983) to ensure the application can access its files.

  2. Security Bootstrapping: A security.json file is placed into /opt/solr/data/data/ to initialize authentication settings.

  3. Container Deployment: The Apache Solr container is launched using Docker with the image solr:9.

  4. Authentication Setup: Upon initial startup, the system uses the Solr Authentication API to set administrative credentials and ensure secure access.

  5. Proxy Configuration: An Nginx container is deployed via Docker Compose in /root/nginx to handle SSL termination and proxy requests to the application.

Access Rights and Security

  • Data Permissions: The data directory /opt/solr/data is restricted with mode 0755, while the security configuration file security.json is strictly set to 0640.

  • Network Mode: The Solr container operates in host network mode for direct communication.

  • SSL/TLS: Secure access is provided via an Nginx proxy using Certbot for SSL certificates.

Databases

Apache Solr manages its own internal data storage within the /opt/solr/data directory. No external database server is required for this deployment.

Docker Containers and Their Deployment

The deployment consists of two primary containers:

Apache Solr

  • Image: solr:9

  • Container Name: apache-solr{Server_ID_from_Invapi}.hostkey.in

  • Ports: 3000 (Internal)

  • Volumes: /opt/solr/data:/var/solr

  • Environment Variables:

  • SOLR_PORT=3000

  • Restart Policy: always

  • Network Mode: host

Nginx Proxy

  • Image: jonasal/nginx-certbot:latest

  • Volumes:

  • nginx_secrets:/etc/letsencrypt

  • /data/nginx/user_conf.d:/etc/nginx/user_conf.d

  • Environment Variables:

  • [email protected]

  • Restart Policy: unless-stopped

  • Network Mode: host

Custom Scripts and Additional Setup

The installation performs several automated setup actions:

  • Security Initialization: Automatically injects a security.json file to enable authentication on the first run.

  • Credential Management: Uses the Solr Authentication API to transition from default bootstrap credentials to secure administrative user credentials.

  • Proxy Orchestration: Generates and manages Nginx configuration files to route traffic from port 443 to the internal application port.

Application Update Instructions

To update the Apache Solr application, use the following command:

docker compose pull && docker compose up -d

Note: This updates the core application container.

Location of configuration files and data

  • Solr Data: /opt/solr/data

  • Nginx Configuration: /root/nginx/compose.yml

  • Nginx User Configs: /data/nginx/user_conf.d

Available ports for connection

  • 443: HTTPS (External access via Nginx)

  • 3000: Solr API/Admin UI (Internal/Host access)

Starting and Stopping the application

The containers are managed using Docker Compose:

  • To start the application: Navigate to /root/nginx and run docker compose up -d.

  • To stop the application: Navigate to /root/nginx and run docker compose down.

question_mark
Is there anything I can help you with?
question_mark
AI Assistant ×