15회차

시작하고 필수 깔기
dnf -y update
dnf -y install net-tools
dnf -y install nano
dnf -y install lrzsz
dnf -y install httpd
netstat -ant | grep 80
dnf -y install net-tools
systemctl start httpd
systemctl enable --now httpd
firewall-cmd --add-service=http
firewall-cmd --runtime-to-permanent
You can add content to the directory
/var/www/html/.

dnf -y install vsftp
netstat -ant | grep 21
systemctl start vsftpd
firewall-cmd --add-service=ftp
firewall-cmd --runtime-to-permanent
ftp는 root로 접속 할 수 없다.
/var/www/html
master 의 계정으로 메인 페이지 만들자!
설치X, 서비스X

일반 사용자 계정을 활성화 시키기
활성화
/etc/httpd/conf.d/userdir.conf
pwd 위치 표시

하나의 서버에 여러개의 웹페이지
public_html
/~user/public_html
shopping.kgorani.kr
ai.dulgi.kr
/home/dulgi/public_html
/home/kgorani/public_html
/home/spiXXXX/public_html

계정추가
adduser
useradd shopping
useradd ai

cd /etc/skel
mkdir public_html
touch index.html
touch index.php
wordpress -> xshell
codeigniter -> xshell

-----------------------------------------------


mkdir auth
mkdir includes
mkdir log

cd auth
touch login.php
touch login_ok.php
touch mypage.php
touch logout.php
touch signup.php
touch signup_ok.php

cd includes
ls
touch header.php
touch footer.php
touch db.php

cd log
touch access.log
touch error.log

-----------------------------------------------


php와 mysql를 설치

dnf module list php
dnf module -y reset php
dnf module -y enable php:7.4
dnf module -y install php:7.4/common
php -v
systemctl restart httpd
systemctl status php-fpm
dnf module -y install mariadb:10.3
nano /etc/my.cnf.d/charset.cnf
[mysqld]
character-set-server = utf8mb4
[client]
default-character-set = utf8mb4
systemctl enable --now mariadb

#방화벽
firewall-cmd --add-service=http
firewall-cmd --runtime-to-permanent
firewall-cmd --add-service=mysql
firewall-cmd --runtime-to-permanent

systemctl stop mariadb
rm -rf /var/lib/mysql/*
mysql_install_db --datadir=/var/lib/mysql --user=mysql
systemctl start mariadb