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 user8983). -
/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:
-
Directory Preparation: The system creates the necessary data directories in
/opt/solr/datawith specific ownership (8983:8983) to ensure the application can access its files. -
Security Bootstrapping: A
security.jsonfile is placed into/opt/solr/data/data/to initialize authentication settings. -
Container Deployment: The Apache Solr container is launched using Docker with the image
solr:9. -
Authentication Setup: Upon initial startup, the system uses the Solr Authentication API to set administrative credentials and ensure secure access.
-
Proxy Configuration: An Nginx container is deployed via Docker Compose in
/root/nginxto handle SSL termination and proxy requests to the application.
Access Rights and Security¶
-
Data Permissions: The data directory
/opt/solr/datais restricted with mode0755, while the security configuration filesecurity.jsonis strictly set to0640. -
Network Mode: The Solr container operates in
hostnetwork 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:
-
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.jsonfile 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:
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/nginxand rundocker compose up -d. -
To stop the application: Navigate to
/root/nginxand rundocker compose down.