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: 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:

    sudo bash solr-x.y.z/bin/install_solr_service.sh solr-x.y.z.tgz

  4. Start Solr:

    sudo systemctl start solr sudo systemctl enable solr

  5. Access Solr:
    • Solr admin panel: http://<your_server_ip>:8983/solr.
    • Secure this port with firewall rules or IP-based restrictions (and ZK : ZooKeeper).
  6. 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.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

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