Welcome to Centmin Mod Community
Become a Member

Feedback CMM8 config enhancement update request

Discussion in 'AlmaLinux 8 & Rocky Linux 8 Beta Testing' started by buik, Sep 29, 2022.

  1. buik

    buik “The best traveler is one without a camera.”

    1,969
    513
    113
    Apr 29, 2016
    Flanders
    Ratings:
    +1,635
    Local Time:
    7:28 AM
    CMM has its configuration files in several locations.
    Which means you have to keep switching between folders when managing or fine tuning.

    It would be nice if starting from CMM8 this is configured from one directory for the major components such as PHP, Nginx and Mariadb.


    /etc/centminmod Already contains PHP, the cronjobs, your configured mail and the custom installation custom_config.inc. It would be nice if that includes Nginx and Mariadb. That way you keep an overview in one folder. With everything conveniently together.

    Hence this request.
     
  2. eva2000

    eva2000 Administrator Staff Member

    52,186
    11,998
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,501
    Local Time:
    3:28 PM
    Nginx 1.25.x
    MariaDB 10.x
    Which configurations file you referring to? The ones for Nginx like nginx.conf and vhost config files themselves and /etc/my.cnf MySQL move to /etc/centminmod? I don't know of many LAMP/LEMP stacks or control panels that would go that far in terms of changes to each software's relative config files. Or do you mean /usr/local/src/centminmod directory move to /etc/centminmod ?

    Centmin Mod's main config file that matters is already there at /etc/centminmod/custom_config.inc if you want to override centmin.sh settings.

    FYI, Centmin Mod has command shortcuts that make navigating Centmin Mod within shell terminal faster see FAQ item 16 FAQ - CentminMod.com LEMP Nginx web stack for CentOS

    below is a screenshot example I just did for the below tasks which literally took a few seconds
    • pushd /home/nginx/domains
    • pushd into nginx vhost config directory at /usr/local/nginx/conf/conf.d
    • cmdir = uses pushd to change into /usr/local/src/centminmod directory
    • nginxconf = edit nginx.conf
    • mycnf = edit /etc/my.cnf
    • fpmconf = edit /usr/local/etc/php-fpm.conf
    • vhostconf = edit /usr/local/nginx/conf/conf.d/virtual.conf
    • pushd +1 = cycle through previous pushd command navigated directories
    • ctrl+r to bring up and search my command history previous pushd into nginx vhost directory cycling through entries with ctrl+r
    cmm-command-shortcuts-01tn.gif
     
  3. buik

    buik “The best traveler is one without a camera.”

    1,969
    513
    113
    Apr 29, 2016
    Flanders
    Ratings:
    +1,635
    Local Time:
    7:28 AM
    Only the personal config files like /etc/my.cnf, /usr/local/nginx/conf/conf.d/*, /usr/local/etc/php-fpm.conf etc. Not the basics like Nginx.conf
     
  4. eva2000

    eva2000 Administrator Staff Member

    52,186
    11,998
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,501
    Local Time:
    3:28 PM
    Nginx 1.25.x
    MariaDB 10.x
    Not really fond of doing that to be honest. There's a decades worth know-how that the configs are documented to be where they are now and most folks know that. The Centmin Mod command shortcuts outlined above already make it pretty convenient to navigate around and edit stuff.

    I also setup command aliases in /root/.bashrc for my Nginx vhost sites as well so I can edit my Nginx vhost and navigate to log directory, web root etc easily i.e.
    Code (Text):
    alias myconf='nano -w /usr/local/nginx/conf/conf.d/domain.com.ssl.conf'
    alias mylog='pushd /home/nginx/domains/domain.com/log'
    alias mypub='pushd /home/nginx/domains/domain.com/public'
    alias mysdir='pushd /usr/local/nginx/conf/ssl/domain.com'
    

    myconf = edit nginx vhost
    mylog = change into domain.com's log directory
    mypub = change into domain.com's web root at public
    mysdir = change into domain.com's SSL certificate directory

    You can get creative with command aliases of your own.
     
  5. buik

    buik “The best traveler is one without a camera.”

    1,969
    513
    113
    Apr 29, 2016
    Flanders
    Ratings:
    +1,635
    Local Time:
    7:28 AM
    No problem. It was only a request. I am not a fan of symbolic links. That's typically Ubuntu proprietary.
    Then I just keep adjusting the config myself. You can still do that, of course.
     
  6. eva2000

    eva2000 Administrator Staff Member

    52,186
    11,998
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,501
    Local Time:
    3:28 PM
    Nginx 1.25.x
    MariaDB 10.x
    Yeah not a fan of the traditional symbolic links via ln. But alias commands are ok. CentOS/RHEL and many distros already use some native default aliases in places like /root/.bashrc like
    Code (Text):
    alias rm='rm -i'
    alias cp='cp -i'
    alias mv='mv -i'
    

    Centmin Mod has a few additional ones added by default too
    Code (Text):
    alias wget='/usr/local/bin/wget'
    alias pwdh='echo -n "$HOSTNAME"; echo " $PWD"'
    alias qrencode='qrencode -t ansiutf8'
    alias postfixlog='pflogsumm -d today --verbose_msg_detail /var/log/maillog'
    alias fpm-errlog='tail -10 /var/log/php-fpm/www-error.log'
    alias fpm-phperrlog='tail -10 /var/log/php-fpm/www-php.error.log'
    alias fpm-slowlog='tail -10 /var/log/php-fpm/www-slow.log'
    alias cmdir='pushd /usr/local/src/centminmod'
    

    pwdh one is just pwd but adds server hostname to the output. Handy for when you have multiple SSH client windows running and need to know which server you're working with and the pwd directory
    Code (Text):
    pwdh
    cmkvm.domain.com /usr/local/nginx/conf/conf.d
    

    qrencode allows you to pass text to be QRCode converted. Allowing you to pass text, info quickly from server SSH command output to your mobile device when you scan the QRCode :)

    i.e.
    Code (Text):
    qrencode centminmod.com
    


    IMG_20220930_230535~01.jpg
     
    Last edited: Sep 30, 2022