Welcome to Centmin Mod Community
Register Now

Install Discussion: how do you initially install & setup your Centmin Mod server?

Discussion in 'Install & Upgrades or Pre-Install Questions' started by eva2000, May 9, 2018.

  1. eva2000

    eva2000 Administrator Staff Member

    May 24, 2014
    Brisbane, Australia
    Local Time:
    7:14 AM
    Nginx 1.13.x
    MariaDB 5.5
    The initial Centmin Mod install guide and the Getting Started guide outlines the normal way of installing Centmin Mod. Then there's additional steps to further customise your Centmin Mod installs.

    So Centmin Mod users, want to share how you initially install and configure your Centmin Mod servers ?

    I'll go first with my latest method outlining SSH commands I use (all run in same SSH session window):
    Code (Text):
    # set your email address you want to receive alerts and server emails
    [email protected]

    Code (Text):
    # create initial persistent config file to override centmin.sh defaults
    # https://centminmod.com/upgrade.html#persistent
    mkdir -p /etc/centminmod
    touch /etc/centminmod/custom_config.inc
    # boost PHP 7 performance by enabling Profile Guided Optimisation flag
    # https://centminmod.com/perf/
    echo "PHP_PGO='y'" >> /etc/centminmod/custom_config.inc
    # install centmin mod latest beta with php-fpm 7.2 default
    # https://community.centminmod.com/threads/centmin-mod-09-beta-branch-testing.4128/
    yum -y update; curl -O https://centminmod.com/betainstaller72.sh && chmod 0700 betainstaller72.sh && bash betainstaller72.sh
    # enable letsencrypt ssl certificate integration https://centminmod.com/acmetool/
    echo "LETSENCRYPT_DETECT='y'" >> /etc/centminmod/custom_config.inc
    # install and configure auditd https://community.centminmod.com/posts/37680/
    echo "AUDITD_ENABLE='y'" >> /etc/centminmod/custom_config.inc
    /usr/local/src/centminmod/tools/auditd.sh setup
    # setup extended CSF Firewall blocklists https://community.centminmod.com/posts/50060/
    # enable CSF Firewall native fail2ban like support
    # https://community.centminmod.com/posts/62343/
    csf --profile backup backup-b4-customregex
    cp -a /usr/local/csf/bin/regex.custom.pm /usr/local/csf/bin/regex.custom.pm.bak
    egrep 'CUSTOM1_LOG|CUSTOM2_LOG|CUSTOM3_LOG|CUSTOM4_LOG' /etc/csf/csf.conf
    sed -i "s|CUSTOM1_LOG = .*|CUSTOM1_LOG = \"/home/nginx/domains/\*/log/access.log\"|" /etc/csf/csf.conf
    sed -i "s|CUSTOM2_LOG = .*|CUSTOM2_LOG = \"/home/nginx/domains/\*/log/error.log\"|" /etc/csf/csf.conf
    sed -i "s|CUSTOM3_LOG = .*|CUSTOM3_LOG = \"/var/log/nginx/localhost.access.log\"|" /etc/csf/csf.conf
    sed -i "s|CUSTOM4_LOG = .*|CUSTOM4_LOG = \"/var/log/nginx/localhost.error.log\"|" /etc/csf/csf.conf
    egrep 'CUSTOM1_LOG|CUSTOM2_LOG|CUSTOM3_LOG|CUSTOM4_LOG' /etc/csf/csf.conf
    wget -O /usr/local/csf/bin/regex.custom.pm https://gist.github.com/centminmod/f5551b92b8aba768c3b4db84c57e756d/raw/regex.custom.pm
    csf -ra
    # setup email alerts for diskalert cronjob /etc/cron.daily/diskalert
    # https://community.centminmod.com/posts/59973/
    sed -i "s|EMAIL=.*|EMAIL='$EMAIL'|" /etc/cron.daily/diskalert

    So what's your method ?
    • Informative Informative x 1
  2. Jon Snow

    Jon Snow Active Member

    Jun 30, 2017
    Local Time:
    6:14 PM
    Nginx 1.13.9
    MariaDB 10.1.31
    The first thing I do is update YUM (your command takes care of that though). After, I install Centminmod and then create the custom config with whatever I want.
  3. Meirami

    Meirami Member

    Dec 21, 2017
    Local Time:
    12:14 AM
    This is my way. Install Nextcloud 13

    Blocklists would be nice but missing ipset because Openvz.. .