Discover Centmin Mod today
Register Now

Featured Install Quick Centmin Mod Install + Nginx Vhost Site + MySQL Database Setup

Discussion in 'Centmin Mod User Tutorials & Guides' started by eva2000, Sep 20, 2017.

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

    eva2000 Administrator Staff Member

    54,064
    12,176
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,734
    Local Time:
    9:44 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    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. For more advanced install guides see Centmin Mod Advanced Customised Installation Guide.


    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

    Update March 22, 2019: Note, if you are using Centmin Mod LEMP stack via DigitalOcean 1-click App Marketplace listing launched droplet, you DO NOT need to do this curl install step as Centmin Mod LEMP stack is pre-installed on DigitalOcean 1-click App Marketplace listed app.
    Code (Text):
    yum -y update; curl -O https://centminmod.com/betainstaller.sh && chmod 0700 betainstaller.sh && bash betainstaller.sh
    

    Enable Letsencrypt integration by setting LETSENCRYPT_DETECT='y' variable in Centmin Mod persistent config file at /etc/centminmod/custom_config.inc. The persistent config file allows you to customise and override Centmin Mod default settings/variables set it centmin.sh without actually modifying centmin.sh so your custom settings persist when Centmin Mod local code is updated at /usr/local/src/centminmod (from 123.09beta01 and higher that install directory is git backed as outlined here.)
    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 Letsencrypt - Official acmetool.sh testing thread for Centmin Mod 123.09beta01

    Ensure intended vhost domain name's DNS is set and propagated to point A/AAAA DNS records to the server's IP address before running Centmin Mod Nginx vhost commands, otherwise Letsencrypt webroot authentication's domain validation will fail.



    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 and eventually official Centmin Mod LEMP stack preinstalled via DigitalOcean Marketplace For 1 Click Applications.

    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 :)
     
Thread Status:
Not open for further replies.