Server install & config : Debian 12 + Plesk + Apache + nginx + MariaDB + Solr

Software / Platforms: Apache Webserver, nginx, MariaDB, PHP 8.3, Plesk, Apache Solr

 

Prerequisites

  1. Server Recommendation:
    • Minimum of 16 CPU cores, 16GB RAM
    • SSD / NVMe for optimal performance, especially for MariaDB and Solr.
  2. Access:
    • Root or sudo access to your Debian 12 server.
    • A domain name configured to point to your server (if hosting websites).
  3. Networking:
    • Ensure the server has a static IP.
    • Open necessary ports for services:
      • 80 (HTTP), 443 (HTTPS) for web.
      • 3306 for MariaDB (optional, for remote DB access).
      • 8443 for Plesk admin panel.
      • 8983 for Solr admin (limit access for security).

1. Update and Prepare Debian 12

sudo apt update && sudo apt upgrade -y sudo apt install curl wget gnupg software-properties-common -y

Set the correct timezone:

sudo dpkg-reconfigure tzdata

Add necessary repositories (if needed, for Plesk and MariaDB).


2. Install Plesk

Plesk automates the installation of key components like Apache, nginx, and MariaDB.

  1. Download and Install Plesk Installer:

wget https://autoinstall.plesk.com/plesk-installer chmod +x plesk-installer sudo ./plesk-installer

  1. Follow On-Screen Instructions:
    • Choose the “Recommended” installation type.
    • Ensure Apache, nginx, and MariaDB are selected.
    • You can enable optional features like Mail Server or Security Enhancements.
  2. Access Plesk:
    • After installation, visit: https://<your_server_ip>:8443.
    • Log in with root credentials and set up the admin account.
  3. Verify Services: Plesk should set up Apache, nginx, and MariaDB by default.
  4. Activate / install Plugins:
    1. Panel.ini Editor
    2. Repair Kit
    3. Let's Encrypt
    4. SSL IT

3. Configure Apache and nginx

  1. Apache Configuration:
    • Apache is the primary backend for Plesk. Plesk configures Apache automatically, but custom configurations can be done via:
      • /etc/apache2/apache2.conf
      • Per domain: via Plesk > Domain > Apache & nginx Settings.
  2. nginx as a Reverse Proxy:
    • nginx is enabled as a proxy in Plesk by default.
    • Verify configuration:

      sudo systemctl status nginx sudo systemctl status apache2

  3. Customize Settings in Plesk:
    • Go to Tools & Settings > Web Server Settings.
    • Configure caching, gzip compression, and SSL settings.

4. Configure MariaDB

  1. MariaDB Installation (Plesk manages this by default):
    • Check MariaDB version:

      mysql --version

    • Default configuration files are located in /etc/mysql/.
  2. Secure MariaDB: Run the security script to set a root password and secure MariaDB:

    sudo mysql_secure_installation

  3. Adjust Config for Performance: Edit /etc/mysql/my.cnf:

    [mysqld]
    innodb_buffer_pool_size=1G
    max_connections=200
    

    Restart MariaDB:

    sudo systemctl restart mariadb


5. Install Solr

  1. Install Java (Required for Solr):

    sudo apt install openjdk-11-jdk -y && java -version

  2. Download Solr (Binary release): Visit the Solr download page and get the latest version. Replace x.y.z with the latest version:

    wget https://downloads.apache.org/lucene/solr/x.y.z/solr-x.y.z.tgz tar xzf solr-x.y.z.tgz

  3. Install Solr:

    tar xzf solr-9.7.0.tgz solr-9.7.0/bin/install_solr_service.sh --strip-components=2
    sudo bash solr-x.y.z/bin/install_solr_service.sh solr-x.y.z.tgz

    [OR]

    tar zxf solr-9.7.0.tgz && sudo bash solr-9.7.0/bin/install_solr_service.sh  solr-9.7.0.tgz

  4. Add/uncomment (File: /etc/default/solr.in.sh):

    SOLR_JETTY_HOST="0.0.0.0"

  5. Start Solr:

    sudo systemctl start solr 
    sudo systemctl enable solr
    sudo service solr status
  6. Access Solr:
    • Solr admin panel: http://<your_server_ip>:8983/solr.
    • Secure this port with firewall rules or IP-based restrictions (and ZK : ZooKeeper).
  7. Create a Core:

    sudo su - solr -c "/opt/solr/bin/solr create -c mycore"


6. Optimize and Secure the Setup

  1. Enable HTTPS with Let’s Encrypt:
    • Use Plesk to install and manage Let’s Encrypt SSL for domains.
  2. Firewall Configuration:
    • Use ufw or a similar firewall tool:

      sudo ufw allow OpenSSH
      sudo ufw allow 80
      sudo ufw allow 443
      sudo ufw allow 8443
      sudo ufw allow 8983
      sudo ufw enable
      
  3. Monitor Resources:
    • Install monitoring tools like htop or configure Plesk alerts for resource usage.
  4. Backup Configuration:
    • Configure automated backups in Plesk for server and databases.

7. Post-Installation Checklist

  • Verify all services are running:

    sudo systemctl status apache2
    sudo systemctl status nginx
    sudo systemctl status mariadb
    sudo systemctl status solr
    
  • Test server speed and response.
  • Secure Solr admin interface with IP or authentication.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Comments

Neuen Kommentar schreiben

CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.

Suche

Neueste Kommentare

  • 1 month 3 weeks ago
    [preflight] The following restricted PHP modes have non-empty values: {open_basedir}. This configuration is incompatible with drush.

    Same with Drush 13 + PHP 8.3

  • 1 month 3 weeks ago
    Acronis CyberProtect Agent For Linux (Strato Root Server)

    Initializing...

    Error : Failed to install the required package 'RPM' by using APT. Please install it manually. 

    Exit


    Solution:

  • 1 month 3 weeks ago
    Acronis CyberProtect Agent For Linux (Strato Root Server)

    So habe es installiert und dann mit Hilfe von Key/Code (über Website von Acronis Cyber Protect) aktiviert:

  • 1 month 3 weeks ago
    No route found for the specified format html. Supported formats: csv, json. (Drupal Routing)

    I have a view with a path like /my-content-export to export entivies as JSON or CSV.

  • 2 months ago
    InvalidArgumentException: The controller for URI "/admin/flush" is not callable.

    admin_toolbar 3.5.2 is the reason. Patch coming ...

  • 2 weeks 6 days ago
    PDOException: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock

    Drupal 10.4:

  • 2 months 4 weeks ago
    Server install & config : Debian 12 + Plesk + Apache + nginx + MariaDB + Solr

    Tools & Settings >> Security Policy :

     Allow only secure FTPS connections 

  • 4 months 1 week ago
    MariaDB Server Performance Optimieren

     

    /usr/sbin/mariadbd --help --verbose | grep "query.*size"
  • 4 months 1 week ago
    MariaDB Server Performance Optimieren

    Commandline:

    systemctl restart mariadb
  • 4 months 1 week ago
    MariaDB Server Performance Optimieren

    After my changes in /etc/mysql/db-performance.cnf