Close Menu
    DevStackTipsDevStackTips
    • Home
    • News & Updates
      1. Tech & Work
      2. View All

      CodeSOD: A Unique Way to Primary Key

      July 22, 2025

      BrowserStack launches Figma plugin for detecting accessibility issues in design phase

      July 22, 2025

      Parasoft brings agentic AI to service virtualization in latest release

      July 22, 2025

      Node.js vs. Python for Backend: 7 Reasons C-Level Leaders Choose Node.js Talent

      July 21, 2025

      The best CRM software with email marketing in 2025: Expert tested and reviewed

      July 22, 2025

      This multi-port car charger can power 4 gadgets at once – and it’s surprisingly cheap

      July 22, 2025

      I’m a wearables editor and here are the 7 Pixel Watch 4 rumors I’m most curious about

      July 22, 2025

      8 ways I quickly leveled up my Linux skills – and you can too

      July 22, 2025
    • Development
      1. Algorithms & Data Structures
      2. Artificial Intelligence
      3. Back-End Development
      4. Databases
      5. Front-End Development
      6. Libraries & Frameworks
      7. Machine Learning
      8. Security
      9. Software Engineering
      10. Tools & IDEs
      11. Web Design
      12. Web Development
      13. Web Security
      14. Programming Languages
        • PHP
        • JavaScript
      Featured

      The Intersection of Agile and Accessibility – A Series on Designing for Everyone

      July 22, 2025
      Recent

      The Intersection of Agile and Accessibility – A Series on Designing for Everyone

      July 22, 2025

      Zero Trust & Cybersecurity Mesh: Your Org’s Survival Guide

      July 22, 2025

      Execute Ping Commands and Get Back Structured Data in PHP

      July 22, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      A Tomb Raider composer has been jailed — His legacy overshadowed by $75k+ in loan fraud

      July 22, 2025
      Recent

      A Tomb Raider composer has been jailed — His legacy overshadowed by $75k+ in loan fraud

      July 22, 2025

      “I don’t think I changed his mind” — NVIDIA CEO comments on H20 AI GPU sales resuming in China following a meeting with President Trump

      July 22, 2025

      Galaxy Z Fold 7 review: Six years later — Samsung finally cracks the foldable code

      July 22, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»Operating Systems»Linux»How to Configure Let’s Encrypt SSL with Apache Solr

    How to Configure Let’s Encrypt SSL with Apache Solr

    July 21, 2025

    This tutorial provides a comprehensive guide to securing Apache Solr with an SSL certificate from Let’s Encrypt, a free and automated certificate authority. By following these steps, you will enable Solr to operate over HTTPS, ensuring encrypted communication. This guide assumes you are using a Linux server (Ubuntu/Debian) with Apache Solr and Apache2 web server already installed.

    Prerequisites

    • A server running Ubuntu/Debian with Apache Solr installed.
    • Apache2 web server installed and configured.
    • A registered domain name pointing to your server’s public IP.
    • Root or sudo access to the server.
    • Basic familiarity with terminal commands.

    Step 1: Install Certbot

    Certbot is the tool used to obtain and manage Let’s Encrypt SSL certificates.

    1. Update the package list:
      sudo apt update
      
    2. Install Certbot and the Apache plugin:
      sudo apt install certbot python3-certbot-apache -y
      

    Step 2: Obtain the SSL Certificate

    Use Certbot to generate an SSL certificate for your domain.

    1. Run Certbot to request a certificate, replacing solr.yourdomain.com with your actual domain:
      sudo certbot --apache -d solr.yourdomain.com
      
    2. Follow the prompts:
      • Provide an email address for renewal notifications.
      • Agree to the terms of service.
      • Choose whether to redirect HTTP traffic to HTTPS (recommended).
    3. Certbot will generate and store the certificate files in /etc/letsencrypt/live/solr.yourdomain.com/.

    Step 3: Configure Apache Solr for SSL

    Solr typically runs as a standalone service, but to enable SSL, you need to configure it to use the certificate and private key from Let’s Encrypt.

    1. Locate Solr’s configuration: Solr’s configuration files are usually in /opt/solr or the directory where Solr is installed. The main configuration file is solr.in.sh (or solr.in.cmd on Windows).
    2. Edit solr.in.sh: Open the file, typically located at /opt/solr/bin/solr.in.sh:
      sudo nano /opt/solr/bin/solr.in.sh
      
    3. Add SSL settings: Add or modify the following lines to enable SSL and point to the Let’s Encrypt certificate:
      
      SOLR_SSL_ENABLED=true
      SOLR_SSL_KEY_STORE=/etc/letsencrypt/live/solr.yourdomain.com/privkey.pem
      SOLR_SSL_KEY_STORE_PASSWORD=your_keystore_password
      SOLR_SSL_TRUST_STORE=/etc/letsencrypt/live/solr.yourdomain.com/fullchain.pem
      SOLR_SSL_TRUST_STORE_PASSWORD=your_truststore_password
      SOLR_SSL_NEED_CLIENT_AUTH=false
      SOLR_SSL_WANT_CLIENT_AUTH=false
      
      
      • Replace solr.yourdomain.com with your domain.
      • Set your_keystore_password and your_truststore_password to secure passwords (you can generate random passwords if needed).
    4. Save and exit: Save the file and exit the editor.

    Step 4: Configure Apache2 for Proxying

    Since Solr runs on its own server (default port 8983), you can use Apache2 as a reverse proxy to handle SSL and forward requests to Solr.

    1. Enable Apache modules: Ensure the required Apache modules are enabled:
      sudo a2enmod proxy proxy_http ssl rewrite
      
    2. Create a virtual host configuration: Create a new configuration file for Solr:
      sudo nano /etc/apache2/sites-available/solr.conf
      
    3. Add the virtual host configuration:
      
      
      	ServerName solr.yourdomain.com
      	
      	ProxyPreserveHost On
      	ProxyPass /solr http://localhost:8983/solr
      	ProxyPassReverse /solr http://localhost:8983/solr
      	
      	SSLEngine on
      	SSLCertificateFile /etc/letsencrypt/live/solr.yourdomain.com/fullchain.pem
      	SSLCertificateKeyFile /etc/letsencrypt/live/solr.yourdomain.com/privkey.pem
      	
      	ErrorLog ${APACHE_LOG_DIR}/solr_error.log
      	CustomLog ${APACHE_LOG_DIR}/solr_access.log combined
      
      
      
      • Replace solr.yourdomain.com with your domain.
      • The ProxyPass directive forwards requests to Solr’s default port (8983).
    4. Enable the site:
      sudo a2ensite solr.conf
      
    5. Restart Apache:
      sudo systemctl restart apache2
      

    Step 5: Restart Solr

    Apply the SSL configuration by restarting Solr:

    sudo systemctl restart solr
    

    If Solr is not running as a service, stop and start it manually:

    /opt/solr/bin/solr stop
    /opt/solr/bin/solr start
    

    Step 6: Test the Configuration

    1. Open a browser and navigate to https://solr.yourdomain.com/solr. You should see the Solr Admin interface over HTTPS.
    2. Verify the SSL certificate by clicking the padlock icon in your browser to ensure it is issued by Let’s Encrypt.
    3. If you encounter issues, check the Apache logs:
      sudo tail -f /var/log/apache2/solr_error.log
      
    4. Check Solr logs, typically in /var/solr/logs/solr.log.

    Step 7: Automate Certificate Renewal

    Let’s Encrypt certificates expire every 90 days, but Certbot can automate renewals.

    1. Test the renewal process:
      sudo certbot renew --dry-run
      
    2. Certbot’s cron job is usually set up automatically. Verify it:
      sudo systemctl status certbot.timer
      
    3. After renewal, restart Apache and Solr to apply the new certificate:
      sudo systemctl restart apache2
      sudo systemctl restart solr
      

    Troubleshooting Tips

    • Certificate errors: Ensure the domain points to your server’s IP and that port 443 is open in your firewall.
    • Solr not accessible: Verify that Solr is running (sudo systemctl status solr) and that the proxy settings in Apache are correct.
    • Permission issues: Ensure the Solr user has read access to the certificate files:
      sudo chown solr:solr /etc/letsencrypt/live/solr.yourdomain.com/*
      sudo chmod 640 /etc/letsencrypt/live/solr.yourdomain.com/*
      

    Conclusion

    You have successfully configured Apache Solr to use a Let’s Encrypt SSL certificate, securing communication over HTTPS. Regular maintenance includes monitoring certificate renewals and ensuring Solr and Apache services are running smoothly.

    The post How to Configure Let’s Encrypt SSL with Apache Solr appeared first on TecAdmin.

    Source: Read More

    Facebook Twitter Reddit Email Copy Link
    Previous Article10 Useful Free and Open Source Network Configuration Management Tools
    Next Article Firefly AIBOX-3588S Embedded Fanless PC Running Linux – Introduction

    Related Posts

    News & Updates

    A Tomb Raider composer has been jailed — His legacy overshadowed by $75k+ in loan fraud

    July 22, 2025
    News & Updates

    “I don’t think I changed his mind” — NVIDIA CEO comments on H20 AI GPU sales resuming in China following a meeting with President Trump

    July 22, 2025
    Leave A Reply Cancel Reply

    For security, use of Google's reCAPTCHA service is required which is subject to the Google Privacy Policy and Terms of Use.

    Continue Reading

    Raspberry Pi 5 Desktop Mini PC: PiGro – system configuration tool

    Linux

    FOSS Weekly #25.22: Microsoft’s Vim Alternative, Kernel 6.15, UBXI Desktop, End of Ubuntu 20.04 and More

    Linux

    Will your next iPhone be ‘Made in America’? Let’s do the math

    News & Updates

    Ongoing Attacks Exploit GeoServer RCE Flaw (CVE-2024-36401) to Install NetCat and XMRig CoinMiner

    Security

    Highlights

    Google reveals Gemini 2.5 Flash, its ‘most cost-efficient thinking model’

    April 17, 2025

    Now in preview, the latest Flash lets you adjust reasoning capabilities to balance cost and…

    Microsoft’s Xbox Floral Collection 2025 adds fresh style to your gaming setup

    May 16, 2025

    marcador is a minimal bookmark manager

    May 12, 2025

    This modular Android phone made my Pixel 9 Pro feel boring – but it left me confused

    April 10, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.