Join the community today
Register Now

Install Nginx MariaDB Letsencrypt Quick Centmin Mod Install + Nginx Vhost Site + MySQL Database Setup

Discussion in 'Install & Upgrades or Pre-Install Questions' started by eva2000, Sep 20, 2017.

Thread Status:
Not open for further replies.
  1. eva2000

    eva2000 Administrator Staff Member

    30,563
    6,851
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,268
    Local Time:
    9:55 AM
    Nginx 1.13.x
    MariaDB 5.5
    Centmin Mod has a lot of documentation on official centminmod.com site and forums which is highly suggested reading if you want to learn about and use Centmin Mod LEMP stacks. But here's a quick guide to installing Centmin Mod 123.09beta01 on recommended CentOS 7.x 64bit fresh virgin OS.

    Quick Links

    Quick Install & Setup



    Install Centmin Mod latest beta + set nginx vhost domain = domain.com with letsencrypt ssl certificate and http/2 https default (with http to https redirect can be done in a few SSH commands.

    Centmin Mod Install
    Code (Text):
    yum -y update; curl -O https://centminmod.com/betainstaller.sh && chmod 0700 betainstaller.sh && bash betainstaller.sh
    

    Enable Letsencrypt integration
    Code (Text):
    touch /etc/centminmod/custom_config.inc
    echo "LETSENCRYPT_DETECT='y'" >> /etc/centminmod/custom_config.inc
    

    Create a new Nginx vhost site with letsencrypt free ssl certificate where domain.com and www.domain.com DNS A record point to server IP using either addons/acmetool.sh outlined at https://centminmod.com/acmetool
    Code (Text):
    cd /usr/local/src/centminmod/addons
    ./acmetool.sh issue domain.com lived
    

    or nv command line
    Code (Text):
    nv -d domain.com -s lelived -u ftpusername
    

    nv command help examples
    Code (Text):
    nv
    
    Usage: /usr/bin/nv [-d yourdomain.com] [-s y|n|yd|le|led|lelive|lelived] [-u ftpusername]
    
      -d  yourdomain.com or subdomain.yourdomain.com
      -s  ssl self-signed create = y or n or https only vhost = yd
      -s  le - letsencrypt test cert or led test cert with https default
      -s  lelive - letsencrypt live cert or lelived live cert with https default
      -u  your FTP username
    
      example:
    
      /usr/bin/nv -d yourdomain.com -s y -u ftpusername
      /usr/bin/nv -d yourdomain.com -s n -u ftpusername
      /usr/bin/nv -d yourdomain.com -s yd -u ftpusername
      /usr/bin/nv -d yourdomain.com -s le -u ftpusername
      /usr/bin/nv -d yourdomain.com -s led -u ftpusername
      /usr/bin/nv -d yourdomain.com -s lelive -u ftpusername
      /usr/bin/nv -d yourdomain.com -s lelived -u ftpusername
    

    or via centmin.sh shell menu option 2
    Code (Text):
    --------------------------------------------------------
         Centmin Mod Menu 123.09beta01 centminmod.com  
    --------------------------------------------------------
    1).  Centmin Install
    2).  Add Nginx vhost domain
    3).  NSD setup domain name DNS
    4).  Nginx Upgrade / Downgrade
    5).  PHP Upgrade / Downgrade
    6).  XCache Re-install
    7).  APC Cache Re-install
    8).  XCache Install
    9).  APC Cache Install
    10). Memcached Server Re-install
    11). MariaDB MySQL Upgrade & Management
    12). Zend OpCache Install/Re-install
    13). Install/Reinstall Redis PHP Extension
    14). SELinux disable
    15). Install/Reinstall ImagicK PHP Extension
    16). Change SSHD Port Number
    17). Multi-thread compression: pigz,pbzip2,lbzip2...
    18). Suhosin PHP Extension install
    19). Install FFMPEG and FFMPEG PHP Extension
    20). NSD Install/Re-Install
    21). Update - Nginx + PHP-FPM + Siege
    22). Add Wordpress Nginx vhost + Cache Plugin
    23). Update Centmin Mod Code Base
    24). Exit
    --------------------------------------------------------
    Enter option [ 1 - 24 ] 2
    --------------------------------------------------------
    

    Code (Text):
    Important Information
    ---------------------------------------------------------------
    
    You are about to create an Nginx vhost site account with/without
    HTTPS/SSL support. Details of this process are outlined on site
    at centminmod.com/nginx_domain_dns_setup.html. Also read the
    continually updated Getting Started Guide for Centmin Mod usage
    at centminmod.com/getstarted.html which covers the pure-ftpd
    ftp username that is auto generated with the Nginx vhost site.
    ---------------------------------------------------------------
    403 Permission denied message handling
    if after vhost site setup you encounter 403 permission denied errors,
    check https://community.centminmod.com/threads/7308/ to see if your
    site needs tools/autoprotect.sh tweaking/whitelisting
    ---------------------------------------------------------------
    
    Do you want to continue with Nginx vhost site creation ? [y/n] y
    
    Enter vhost domain name to add (without www. prefix): domain.com
    
    Create a self-signed SSL certificate Nginx vhost? [y/n]: n
    Get Letsencrypt SSL certificate Nginx vhost? [y/n]: y
    

    Code (Text):
    ---------------------------------------------------------------
    To get Letsencrypt SSL certificate, you must already have updated intended
    domain vhost name's DNS A record to this server's IP addresss.
    If top level domain, DNS A record is needed also for www. version of domain
    otherwise, Letsencrypt domain name validation will fail.
    ---------------------------------------------------------------
    continue [y/n] ? y
    
    ------------------------------------------------
    You have 4 options:
    ------------------------------------------------
    1. issue staging test cert with HTTP + HTTPS (untrusted)
    2. issue staging test cert with HTTPS default (untrusted)
    3. issue live cert with HTTP + HTTPS (trusted)
    4. issue live cert with HTTPS default (trusted)
    Enter option number 1-4:
    

    Create MySQL database named = mydb with username = myadmin and password = mypass using addons/mysqladmin_shell.sh mysqladmin_shell.sh Shell based Addon

    Code (Text):
    /usr/local/src/centminmod/addons/mysqladmin_shell.sh createuserdb mydb myadmin mypass
    --------------------------------------------------------------
    Basic MySQL Admin - create mysql user & databases
    --------------------------------------------------------------
    --------------------------------------------------------------
    
    Grants for myadmin@localhost
    GRANT USAGE ON *.* TO 'myadmin'@'localhost' IDENTIFIED BY PASSWORD '*6C8989366EAF75BB670AD8EA7A7FC1176A95CEF4'
    GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE ON `mydb`.* TO 'myadmin'@'localhost'
    
    Ok: MySQL user: myadmin MySQL database: mydb created successfully
    

    If that is too much for install, I also have official Linode stackscript for automated Centmin Mod installs at Linode - official centmin mod Linode stackscript

    So there's various ways to create domain nginx vhosts and mysql databases etc so you can script or automate your own setups. But yes, you're not going to know all this without reading and practicing :)
     
    • Like Like x 1
Thread Status:
Not open for further replies.