Click here for "Error Codes for Commercial Air Conditioners".(Japanese Version)

2022-06

Rocky Linux8.6 Building a server

Rocky Linux8.6 : SSH、firewall、NTP

1. Setting up SSH remote connectionSSH is a service for connecting remotely to a server and is basically running immediately after the OS is installed, but the default settings are somewhat insecure.Here we will configure the default settings to increase the security of ssh connections.1.1 SSH service configuration file changes2. How to set up a firewall (firewalld)In Rocky, the firewall is set to firewalld by default and is enabled during OS installation.To briefly explain "firewalld," when setting communication control policies, communication permission/blocking rules are applied to predefined zones, and these zones are then assigned to each NIC (network adapter).4. NTP Server SettingsBuild an NTP server to synchronize the server time with Japan Standard Time
Rocky Linux8.6 Building a server

Rocky Linux8.6 : Anti-Virus 、Mail Server

Install Clamav ( anti-virus software )1.  Install2. Edit Cla...
Rocky Linux8.6 Building a server

Rocky Linux8.6 : SNORT ,Tripwire ,Chkrootkit

Install SNORT1.advance preparation①Add the CodeReady Red Hat repository and install the required software# dnf config-manager --set-enabled powertoolsInstall Tripwire1.Download and installation# cd /usr/local/src# wget https://rpmfind.net/linux/epel/8/Everything/x86_64/Packages/t/tripwire-2.4.3.7-5.el8.x86_64.rpmInstall Chkrootkit①Download and install chkrootkit# cd /usr/local/src# wget https://launchpad.net/chkrootkit/main/0.55/+d
Rocky Linux8.6 Building a server

Rocky Linux8.6 : MySQL ,WordPress Install

Install Mysql8#dnf module -y install mysql:8.0#vi /etc/my.cnf.d/charset.cnfCreate a new charset.cnf with the following contentsInstall WordPress1. Create database for Word PressAs an example, assume database [wp_db] database user [wp_user] password [?W123456]
Rocky Linux8.6 Building a server

Rocky Linux8.6 : Logwatch ,Disk Usage Check Script

1. Logwatch① Install# dnf install logwatch② Edit configuration file# cat /usr/share/logwatch/default.conf/logwatch.conf >> /etc/logwatch/conf/logwatch.conf2. Introduce disk usage check script2.1 Scripting# cd /var/www/system
Rocky Linux8.6 Building a server

Rocky Linux8.6 : System Backup and Restore

1.Website data backup1-1. Backup under /var/www/html①Creating backup script files# cd /var/www/system# vi backup_html.sh2. MySQL database backup①Creating backup script files# cd /var/www/system3. Restore backup files under html① Store HTML backup files in "/ (root)" directory# cd /var/www/backup/html_bak# cp html_back_20220610.tar.gz /    ←Specify the backup file with the latest date4. Restore Mysql Backup Files①Save DB backup file to any directory(In the example, the directory is "/var/www/backup/db_bak") Extract data
Almalinux8.6 Building a server

AlmaLinux 8.6 : Initial Settings

1. SELinux DisableFirst, disable selinux. selinux is a feature that improves auditing and security in Linux, but when enabled, it can limit the behavior of services and the configuration considerably.Therefore, it is basically disabled in many cases.To disable SELinux, a reboot is required by adding selinux=0 to the kernel command line as follows2. System ModernizationPackage updates are performed as soon as possible immediately after OS installation.However, when a dnf update is performed, a kernel update is also performed at the same time.A kernel update may require rebooting the system or stopping services, or worse, a kernel panic may occur and the system may not boot. It is wiser to exclude the kernel from the update.
Almalinux8.6 Building a server

AlmaLinux 8.6 : SSH , Firewall , NTP

1. Setting up SSH remote connectionSSH is a service for connecting remotely to a server and is basically running immediately after the OS is installed, but the default settings are somewhat insecure.Here we will configure the default settings to increase the security of ssh connections.2. How to set up a firewall (firewalld)In AlmaLinux, the firewall is set to firewalld by default and is enabled during OS installation.Briefly explaining "firewalld," when setting communication control policies, the method is to apply communication permission/blocking rules to predefined zones, and then assign those zones to each NIC (network adapter).4. NTP Server SettingsSynchronize server time with Japan Standard Time① Chrony Installation and Configuration
Rocky Linux8.6 Building a server

Rocky Linux8.6 : SSH Public Key Cryptography Authentication

SSH connection with authentication using RSA public key cryptographyCreation of public and private key pairsCreate a public/private key pair for a user connecting to a Linux server using OpenSSH.Use ssh-keygen to create the key pair.This time, we will create a key set using the RSA cipher used in the SSH protocol Version 2.Creation of public/private key pairs is performed with remote login user privileges (huong).If you do not specify the destination and file name, id_rsa and id_rsa.pub will be created in /home/huong/.ssh/. On the way, enter the password for the key.
Almalinux8.6 Building a server

AlmaLinux 8.6 : Anti-Virus , Mail Server

Install clamav ( anti-virus software )1.Clam AntiVirus Install# dnf -y install clamav clamd clamav-update2.Clam AntiVirus  Configuration File EditingMail Server Installation1.Postfix Installation1.1 InstallInstall Postfix and build an SMTP server# dnf -y install postfixMail Server : Postfix + Clamav + Amavisd+SpamAssassin1.Real-time scanning of e-mails①Amavisd & Clamav Server  Install
Almalinux8.6 Building a server

AlmaLinux 8.6 : MySQL8 , WordPress Install

Mysql8  Install# dnf module -y install mysql:8.0# vi /etc/my.cnf.d/charset.cnfcharset.cnf    Create a new one with the following contentsWordPress  Install1. Create a database for WordPressAs an example, assume database [wp_db] database user [wp_user] password [?W123456]# mysql -u root -p
Almalinux8.6 Building a server

AlmaLinux 8.6 : System Backup and Restore

1. Website data backup1-1. Backup under /var/www/html①Create backup script file# cd /var/www/system# vi backup_html.sh2. MySQL database backup①Creating backup script files# cd /var/www/system3.Restore backup files under html① Store HTML backup files in "/" (root) directory# cd /var/www/backup/html_bak4. Restore Mysql Backup Files①Save the database backup file to any directory(In the example, the directory is "/var/www/backup/db_bak".)Unzip data