MiracleLinux ; Initial Setup

1. Disable SELinux

selinux is a feature that improves auditing and security in Linux, but when it is enabled, it can be quite restrictive in how services work and what settings are available.
Therefore, in many cases, it is basically invalidated.  If you build a server while looking at a website and it doesn’t work as expected, it may be because this selinux is enabled.
Therefore, remember to disable it after installation.

# setenforce  0
If this is the case, seinux will be enabled again when the server is restarted, so to permanently disable selinux, modify the /etc/sysconfig/selinux file.
# vi /etc/sysconfig/selinux
Change “SELINUX=enforcing” to “SELINUX=disabled

2. Services stopped for system modernization and security measures.

2.1 system updating

# dnf -y update 

2.2 Services stopped for security measures.

# systemctl stop atd.service
# systemctl disable atd.service
# systemctl stop auditd.service
# disable auditd.service
# systemctl stop kdump.service
# systemctl disable kdump.service
# systemctl stop lvm2-monitor.service
# systemctl disable lvm2-monitor.service
# systemctl stop mdmonitor.service
# systemctl disable mdmonitor.service
# systemctl stop rngd.service
# systemctl disable rngd.service
# systemctl stop smartd.service
# systemctl disable smartd.service
# systemctl stop tuned.service
# systemctl disable tuned.service
# systemctl stop dm-event.socket
# systemctl disable dm-event.socket

3. Adding Repositories

3.1 PowerTools / HighAvailability
This is a repository that has been newly provided with MIRACLE LINUX 8.4.
Utilization Method
PowerTools and HighAvailability can be used by updating miraclelinux-repos and enabling the repositories.
Update miraclelinux-repos to 8.4-3.el8 or later.
After the update, the following repository files will be added to /etc/yum.repos.d.
# dnf update miraclelinux-repos
①PowerTools can be used by activating the repository as follows
# dnf config-manager –set-enabled 8-latest-PowerTools
# dnf module enable javapackages-tools:201801

※ If you want to install istack-commons provided by PowerTools, you need to enable the javapackages-tools module manually beforehand.
Since istack-commons is also a necessary package for the installation of the “MIRACLE LINUX PowerTools” group, we will also activate the javapackages-tools module after activating the PowerTools repository.

②HighAvailability can be used by enabling the repository as follows

# dnf config-manager –set-enabled 8-latest-HighAvailability
3.2 EPEL
EPEL provides a package for adding repositories for RHEL 8, so you only need to install the package to use it on MIRACLE LINUX 8.4.
# dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
After installation, the following repository files will be added to /etc/yum.repos.d and will be ready for use.
3.3 Remi
This repository is unique in that it provides multiple versions of PHP packages, including the latest ones.  The following packages are provided as examples.
php5.6 php7.0 php7.1 php7.2 php7.3 php7.4 php8.0 php8.1
Remi provides a package for adding repositories for RHEL 8, so you only need to install the package to use it on MIRACLE LINUX 8.4.
# dnf install http://rpms.remirepo.net/enterprise/remi-release-8.rpm
After installation, the following repository files will be added to /etc/yum.repos.d and will be ready for use.

4. Setting  Vim

①Install Vim
# dnf -y install vim-enhanced
# vi ~/.bashrc
●Add an alias to the last line.
alias vi=’vim’
● Reflect changes
# source ~/.bashrc
②Setting up Vim
# vi ~/.vimrc
” Use your own extensions to vim (not compatible with vi)
set nocompatible
” Specify the character encoding
set encoding=utf-8
” Specify file encoding (read from top to bottom until success)
set fileencodings=utf-8,iso-2022-jp,sjis,euc-jp
” Specify the line feed code to be recognized automatically.
set fileformats=unix,dos
” Get a backup
set backup
” Specify the directory to get the backup
set backupdir=~/backup
” Number of generations to keep search history
set history=50
” Search is not case-sensitive.
set ignorecase
” If you mix capital letters in search terms, the search will distinguish between capital letters.
set smartcase
” Highlight words that match the search term.
set hlsearch
” Use incremental search (start searching for matching strings at any time while entering search terms)
set incsearch
” Display line numbers
set number
” Visualize line breaks ( $ ) and tabs ( ^I )
set list
” Emphasize the corresponding parentheses when entering parentheses
set showmatch
” Don’t put a newline at the end of a file
set binary noeol
” Enable auto-indent.
set autoindent
“Color coding for each syntax
syntax on
“Change the color of the comment text when syntax on
highlight Comment ctermfg=LightCyan
“Wrap lines by window width
set wrap