

1. root 비밀번호 설정
passwd root
2. GRUB 타이머 10초 설정
vim /etc/default/grub
GRUB_TIMEOUT=10 으로 수정grub2-mkconfig -o /boot/grub2/grub.cfg
3. eth1 고정 IP 설정
nmcli con add con-name static1 ifname eth1 type ethernet ip4 192.168.56.211/24
nmcli con up static1
4. 인터넷 repo 설정
cd /etc/yum.repos.d/
mkdir backup
mv *.repo backup/
vim net.repo
[NET_BaseOS]
name=BaseOS
baseurl=http://dl.rockylinux.org/$contentdir/$releasever/BaseOS/$basearch/os/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9
[NET_AppStream]
name=AppStream
baseurl=http://dl.rockylinux.org/$contentdir/$releasever/AppStream/$basearch/os/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9
dnf makecache
5. /dev/sdb 파티션 (4,4,6,6)
fdisk /dev/sdb
partprobe
lsblk
6. 포맷 및 마운트
mkfs.xfs /dev/sdb1
mkdir /mnt1
mount /dev/sdb1 /mnt1
vim /etc/fstab
/dev/sdb1 /mnt1 xfs defaults 0 0
mkswap /dev/sdb2
swapon /dev/sdb2
echo "/dev/sdb2 swap swap defaults 0 0" >> /etc/fstab
7. LVM 설정
pvcreate /dev/sdb3 /dev/sdb4
vgcreate vg0 /dev/sdb3 /dev/sdb4
lvcreate -n lv01 -L 4G vg0
mkfs.xfs /dev/vg0/lv01
mkdir /home1
echo "/dev/vg0/lv01 /home1 xfs defaults 0 0" >> /etc/fstab
mount -a
8. lv01 확장
lvextend -L +2G /dev/vg0/lv01
xfs_growfs /home1
9. 사용자 default home 디렉토리 변경
vim /etc/default/useradd
HOME=/home1 으로 변경10. user01 생성 + sudo 권한
useradd user01
passwd user01
usermod -aG wheel user01
11. 그룹 및 디렉토리 설정
groupadd sggroup
mkdir -p /ptest/dir01 /ptest/dir02
chgrp sggroup /ptest/dir01
chmod 2775 /ptest/dir01
12. cron 등록
crontab -e -u user01
0 17 31 1 * date >> /ptest/dir02/datefile
13. httpd 설치 및 활성화
dnf install -y httpd
systemctl enable httpd --now
/etc/httpd/conf.d/
vi /etc/httpd/conf.d/00-vhost.conf
<VirtualHost *:80>
DocumentRoot /var/www/html0
ServerName vhost0.cccr1.org
ServerAlias vhost0
</VirtualHost>
<Directory /var/www/html0>
AllowOverride None
Require all granted
</Directory>
mkdir /var/www/html0
echo vhost0 > /var/www/html0/index.html
vi /etc/httpd/conf.d/01-vhost.conf
<VirtualHost *:80>
DocumentRoot /var/www/html1
ServerName vhost1.cccr1.org
ServerAlias vhost1
</VirtualHost>
<Directory /var/www/html1>
AllowOverride None
Require all granted
</Directory>
mkdir /var/www/html1
echo vhost1 > /var/www/html1/index.html
vi /etc/hosts
192.168.56.100 server.cccr1.org vhost0.cccr1.org vhost0 vhost1.cccr1.org vhost1
systemctl start httpd
firewall-cmd --add-service=http --permanent
firewall-cmd --reload
curl server.cccr1.org
curl vhost0
curl vhost1
RewriteEngine on
RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [R=301,L]
RewriteEngine on
RewriteMap lowercase int:tolower
RewriteCond "${lowercase:%{HTTPS}}" !on
RewriteCond "${lowercase:%{REQUEST_SCHEME}}" !https
RewriteCond "${lowercase:%{SERVER_PORT}}" !443
RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [R=301,L]
yum -y install mod_ssl
openssl genrsa -out private.key 2048
openssl req -new -key private.key -out cert.csr
openssl x509 -req -signkey private.key -in cert.csr -out cert.crt
chmod 600 private.key cert.crt
mv private.key /etc/pki/tls/private/
mv cert.* /etc/pki/tls/certs/
vi /etc/httpd/conf.d/ssl.conf
DocumentRoot "/var/www/html" → 제거ServerName server.cccr1.org:443 → 추가 또는 수정SSLCertificateFile → /etc/pki/tls/certs/cert.crtSSLCertificateKeyFile → /etc/pki/tls/private/private.key/etc/httpd/conf.d/00-vhost.conf
<VirtualHost *:80>
DocumentRoot /var/www/html0
ServerName vhost0.cccr1.org
ServerAlias vhost0
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/\.well\-known/acme\-challenge/
RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [R=301,L]
</VirtualHost>
<Directory /var/www/html0>
AllowOverride None
Require all granted
</Directory>
/etc/httpd/conf.d/01-vhost.conf
<VirtualHost *:80>
DocumentRoot /var/www/html1
ServerName vhost1.cccr1.org
ServerAlias vhost1
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/\.well\-known/acme\-challenge/
RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [R=301,L]
</VirtualHost>
<Directory /var/www/html1>
AllowOverride None
Require all granted
</Directory>
systemctl restart httpd
firewall-cmd --add-service=https --permanent
firewall-cmd --reload
