- CentOS8
- Upgrade
- CentOS 8 설치
- SuiteCRM 설치
- WOL (Wake On Lan) 설정
- Python WOL 패킷 송신 프로그램
CentOS8
홈페이지: https://centos.org/
2019년 9월 24일 CentOS 8이 출시 되었습니다.
Fedora28 기반
커널 4.18 버전 (uname -r)
Upgrade
CentOS 8 설치
yum -y install centos-release-scl
yum -y install centos-release
DNF 4.2.7
dnf --version
dnf repolist all #--- 전체 repository 목록
dnf repolist #--- 사용 가능한 repository 목록
dnf repoinfo #--- Repository 상세 정보
dnf clean all #--- 캐시된 package 정보 삭제
dnf check-update #--- Update할 package를 확인
dnf update #--- 모든 package 업데이트
dnf update ~ #--- 지정한 package만 업데이트
dnf list #--- Package 목록
dnf list installed #--- 설치된 package 목록
dnf list available
dnf grouplist #--- 그룹 package 목록
#--- 중요 package : kernel
dnf info ~ #--- Package 정보
dnf search ~ #--- Package 찾기
dnf install ~ #--- Package 설치
dnf reinstall ~ #--- Package 다시 설치
dnf download ~ #--- Package 다운로드
dnf remove ~ #--- Package 삭제
dnf groupinstall '~' #--- 그룹 package 설치
dnf groupremove '~' #--- 그룹 package 삭제
dnf history
dnf history list last
dnf history list last-${ALTERED}
dnf history list ${ID}
dnf history list ${ID_FR}..${ID_TO}
dnf history info ${ID}
dnf history undo ${ID}
dnf history rollback ${ID}
dnf history redo ${ID}
SuiteCRM 설치
dnf clean all #--- 캐시된 package 정보 삭제
dnf check-update #--- Update할 package를 확인
dnf update #--- 모든 package 업데이트
#--- MariaDB 10.3.17 설치
/usr/bin/dnf list | /usr/bin/grep mariadb
/usr/bin/dnf -y install mariadb mariadb-server
/usr/bin/systemctl enable mariadb.service
/usr/bin/systemctl restart mariadb.service
# /usr/bin/mysqladmin ${SCADA_DB_ROOT_PASSWORD}
/usr/bin/mysql_secure_installation
# Enter current password for root (enter for none):
# Set root password? Y
# New password: 입력
# Re-enter new password: 입력
# Remove anonymous users? [Y/n] Y
# Disallow root login remotely? [Y/n] Y
# Remove test database and access to it? [Y/n] Y
# Reload privilege tables now? [Y/n] Y
/usr/bin/ps -ef | /usr/bin/grep mysql
/usr/bin/vi /etc/my.cnf
/usr/bin/vi /etc/my.cnf.d/client.cnf
[client]
default-character-set=utf8
[client-mariadb]
default-character-set=utf8
/usr/bin/vi /etc/my.cnf.d/mariadb-server.cnf
[mysqld]
#--- Charset Setting
init_connect="SET collation_connection=utf8_general_ci"
init_connect="SET NAMES utf8"
character-set-server=utf8
collation-server=utf8_general_ci
skip-character-set-client-handshake
#--- InnoDB Setting
default-storage-engine=InnoDB
innodb_file_per_table=1
#--- binlog setting
log-bin=/var/lib/mysql/binlog
max_binlog_size=1G
expire_logs_days=3
port=3306
/usr/bin/vi /etc/my.cnf.d/mysql-clients.cnf
[mysql]
default-character-set=utf8
[mysqldump]
default-character-set=utf8
/usr/bin/systemctl restart mariadb.service
/usr/bin/firewall-cmd --permanent --add-service=mysql
/usr/bin/firewall-cmd --reload
/usr/bin/firewall-cmd --list-all
/usr/bin/mysql -uroot -p${PASSWORD} mysql -e "show variables like 'c%'"
# character_set_database | latin1
# collation_database | latin1_swedish_ci
#--- PHP 구성
#--- Nginx 설치
#--- MariaDB 설치
WOL (Wake On Lan) 설정
# apt-get install ethtool
npm install node-wol
wol = require('node-wol');
wol.wake('12:34:56:AB:CD:EF',{}, function(err){
if(err) {
e(err);
}
});
wakeonlan -i 124.54.78.229 -p 9
wakeonlan -i 124.54.78.229 -p 9 01:02:03:04:05:06
ether-wake 01:02:03:04:05:06
Python WOL 패킷 송신 프로그램
매직 패킷 구조
6 bytes : FFFFFFFFFFFF
MAC 주소 6 bytes * 16개
비밀번호 (옵션) : 6 bytes
udp/ip
port : 9(Default), 0, 7
import socket, struct
//--- macAddr : MAC 주소 (11:22:33:44:55:66)
//--- network : 보내는 곳의 IP 주소 (192.168.35.2)
def WOL(macAddr, network):
sep = macAddr[2]
macAddr = macAddr.replace(sep, '')
data = b'FFFFFFFFFFFF' + (macAddr * 16).encode()
send_data = b''
for i in range(0, len(data), 2):
send_data += struct.pack('B', int(data[i: i + 2], 16))
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
for i in range(3):
sock.sendto(send_data, (network, 9))
time.sleep(0.05)
Last modified, 2019.11.16 ~ 2021.08.19, version 0.03
최종 수정일: 2024-09-30 12:26:18
이전글 :
다음글 :