컨테이너 생성
images 폴더 생성
images 폴더에 사진 삽입
index.html 파일을 mz22로 업로드 후 Public으로 변경 후 링크를 클릭한다.
생성된 링크의 마지막에 /index.html을 삽입하면 index 페이지가 나온다.
mz22 폴더에 필요 파일을 업로드 후 생성된 링크를 통해 CLI로 다운로드 받을 수 있다.
#!/bin/bash
- bashshell 스크립트를 구성하겠다.
apt update
apt install -y nginx
- 기본적으로 사용자 정의 스크립트는 root 권한으로 실행되기때문에 sudo가 필요없다
WEB01(CentOS7)과 WEB01-ADD를 Attach
볼륨 추가 명령어
$ lsblk
$ df -h
$ sudo mkfs -t ext4 /dev/vdb
$ sudo mount /dev/vdb /mnt/
$ df -h
CentOS7 Wordpress
# sudo yum -y install https://rpms.remirepo.net/enterprise/remi-release-7.rpm
# sudo yum -y install epel-release yum-utils
# sudo yum-config-manager --enable remi-php74
# sudo yum install -y httpd php php-mysql php-gd php-mbstring wget unzip
# cd /var/www/html
# sudo unzip /mnt/wordpress-5.9.3-ko_KR.zip
# sudo mv wordpress/* .
# sudo chown -R apache:apache /var/www/*
# sudo systemctl restart httpd
# php -v
Ubuntu18 Wordpress
$ sudo apt update && sudo apt upgrade -y
$ sudo apt install -y nginx
$ sudo apt install -y php7.2 php7.2-mysql php7.2-mbstring php7.2-gd php7.2-fpm wget unzip
$ sudo mkdir -p /var/www/html/wordpress/public_html
$ cd /etc/nginx/sites-available
$ sudo vi wordpress.conf
server {
listen 80;
root /var/www/html/wordpress/public_html;
index index.php index.html;
server_name nat.giwon.shop;
access_log /var/log/nginx/SUBDOMAIN.access.log;
error_log /var/log/nginx/SUBDOMAIN.error.log;
location / {
try_files $uri $uri/ =404;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
}
location ~ /\.ht {
deny all;
}
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires max;
log_not_found off;
}
}
$ sudo nginx -t
$ cd /etc/nginx/sites-enabled
$ sudo ln -s ../sites-available/wordpress.conf .
$ sudo systemctl reload nginx
$ cd /var/www/html/wordpress/public_html
$ sudo wget https://ko.wordpress.org/latest-ko_KR.zip
$ sudo unzip latest-ko_KR.zip
$ sudo mv wordpress/* .
$ sudo chown -R www-data:www-data *
$ sudo chmod -R 755 *