【タイムゾーンと日本語】
$ sudo timedatectl set-timezone Asia/Tokyo$ sudo timedatectl
$ sudo localectl set-locale LANG=ja_JP.utf8$ sudo localectl
【Django/Python】
# mkdir /var/www/wsgi
# cd /var/www/wsgi
# mkdir Release
# ln -s Release test
# ln -s Release service
# ln -s Release link
# ln -s Release office
$ vi env
3.6→3.7
# yum install httpd httpd-devel
# yum install gcc
# yum install python3-devel
$ vi requirements.txt
dataclasses==0.8 → 0.6
※Collecting pyreportjasper==2.1.2 # 違うサーバでは再現しなかった。?
Killed
# pip3 --no-cache-dir install pyreportjasper $INTERNET_PROXY で回避
→epelを有効にしてインストール
# amazon-linux-extras install epel -y
# yum install zbar
【MariaDB】
#----------------------------------# MariaDB
#----------------------------------
# yum remove mariadb
# vi /etc/yum.repos.d/MariaDB.repo
[mariadb]
name=MariaDB
baseurl=http://yum.mariadb.org/10.8/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
【クライアント】
# yum install MariaDB-client MariaDB-devel
【サーバ】
# yum install -y MariaDB-server MariaDB-client MariaDB-shared MariaDB-devel
# vi /etc/my.cnf.d/server.cnf
[mariadb]
character-set-server=utf8
[mariadb-10.7]
character-set-server=utf8
# systemctl start mariadb
# systemctl enable mariadb
# yum remove mariadb
# yum remove mariadb-devel
# yum remove mariadb-libs
# vi /etc/yum.repos.d/MariaDB.repo
[mariadb]
name=MariaDB
baseurl=http://yum.mariadb.org/10.8/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
【クライアント】
# yum install MariaDB-client MariaDB-devel
【サーバ】
# yum install -y MariaDB-server MariaDB-client MariaDB-shared MariaDB-devel
# vi /etc/my.cnf.d/server.cnf
[mariadb]
character-set-server=utf8
[mariadb-10.7]
character-set-server=utf8
# systemctl start mariadb
# systemctl enable mariadb
【プロキシ】
# vi /etc/yum.conf
proxy=http://192.168.13.101:3128
# vi /etc/amazon-linux-extras.conf
export http_proxy=http://192.168.13.101:3128
export https_proxy=http://192.168.13.101:3128
【zabbix-agent2】
# yum remove zabbix*
# yum install https://repo.zabbix.com/zabbix/6.2/rhel/7/x86_64/zabbix-agent2-6.2.1-1.el7.x86_64.rpm# vi /etc/zabbix/zabbix_agent2.conf
PidFile=/var/run/zabbix/zabbix_agent2.pid
LogFile=/var/log/zabbix/zabbix_agent2.log
LogFileSize=0
Server=192.168.23.103
ServerActive=192.168.23.103:10051
Hostname=zabbix
HostMetadata=Rockylinux
HostMetadataItem=system.uname
Include=/etc/zabbix/zabbix_agent2.d/*.conf
ControlSocket=/tmp/agent.sock
AllowKey=system.run[*]
※ AllowKeyを設定した場合は、下記も設定
# visudo
# Allows zabbix to run all commands without password.
zabbix ALL=NOPASSWD: ALL
# semanage boolean -l | grep zabbix
# setsebool -P httpd_can_connect_zabbix on
# setsebool -P zabbix_can_network on
# setsebool -P zabbix_run_sudo on
# firewall-cmd --add-port=10050/tcp --zone=public --permanent
# firewall-cmd --reload
# systemctl restart zabbix-agent2
# systemctl enable zabbix-agent2
【s3 Storage マウント】
# mkdir -p /s3/logs
# mkdir /s3/assets
# mkdir /s3/media
# vi /etc/fstab
192.168.210.101:/test-cxdnext-logs /s3/logs nfs rw,hard,nolock 0 0
192.168.210.101:/test-cxdnext-assets /s3/assets nfs rw,hard,nolock 0 0
192.168.210.101:/test-cxdnext-media /s3/media nfs rw,hard,nolock 0 0
# mount -a
# mount
【clam】
# amazon-linux-extras install epel -y
# install clamav clamav-scanner-systemd clamav-update
# vi /etc/clamd.conf
以降は、前の記事と同じ。