[KEDUIT] 클라우드 컴퓨팅과 보안솔루션을 활용한 DC 엔지니어 양성교육 - Day65
1. 서론
오늘은 2주간의 프로젝트를 마치고 오랜만에 수업을 진행했으며, Docker와 Container에 대해서 배워보았다.
2. 본론
1. Docker
1. Web on Docker
//1-1. Install and Run docker
# dnf install -y dnf-utils
# dnf-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
# dnf install -y docker-ce
# wget get.docker.com
# docker -v
# systemctl enable --now docker
# docker info
//1-2. Download OS Image
# docker pull ubuntu:14.04
# docker images //verify
//1-3. Create Container
# docker create -i -t --name myfirst_container ubuntu:14.04
//1-4. Run
# docker start myfirst_container
# docker ps
//1-5. attach
# docker attach myfirst_container
# exit
# docker ps -a
//1-6. Port 할당해서 생성
# docker container prune //delete all
# iptables -t filter -F
# iptables -t filter -X
# docker run -it --name testweb -p 80:80 ubuntu:14.04
//1-7. Apache HTTP Server on Ubuntu
# apt-get update
# apt-get install -y apache2
# service apache2 start
ctrl + shift + p + q
//1-8. Host PC에서 Web 사용 가능한지 체크(Web Browser)
http://10.10.51.37/
2. Cloud server on Docker
//2-1. container 생성
# docker pull ubuntu:20.04
# docker images
# docker create -it --name owncloud -p 80:80 ubuntu:20.04
# docker start owncloud
# docker attach owncloud
//2-2. PPA
# apt -y update && apt -y upgrade
# apt install software-properties-common // PPA를 추가 또는 제거하는 툴
//PPA(Personal Package Archive)는 개인 패키지 저장소로써 개발자가 소스코드를 업로드하면 자동으로 패키지화하여 사용자가 다운로드 받아 설치할 수 있게 해주는 소프트웨어 저장소이다. PPA를 통해 최신 버전들을 다운로드 할 수 있다.
# add-apt-repository ppa:ondrej/php // PHP PPA 추가
# apt install -y libapache2-mod-php7.4 openssl php-imagick php7.4-common php7.4-curl php7.4-gd php7.4-imap php7.4-intl php7.4-json php7.4-ldap php7.4-mbstring php7.4-mysql php7.4-pgsql php-smbclient php-ssh2 php7.4-sqlite3 php7.4-xml php7.4-zip
# php -v
# service start apache2
# service enable apache2
//2-3. mariaDB 설치
# apt install -y mariadb-server
# service mysql start
# mysql -u root -p
//2-4. DB
> CREATE DATABASE owncloud_db;
> GRANT ALL ON owncloud_db.* TO 'owncloud_user'@'localhost' IDENTIFIED BY '1234';
> flush privileges;
> exit
//2-5. owncloud 설치 / 설정
// https://owncloud.com/download-server/
// Download.ZIP > 링크 복사
# apt install -y wget
# wget https://download.owncloud.com/server/stable/owncloud-complete-latest.zip
# ls
# apt install -y unzip
# unzip owncloud-complete-latest.zip -d /var/www
# rm -rf owncloud-complete-latest.zip
# chown -R www-data:www-data /var/www/owncloud/
# vim /etc/apache2/conf-available/owncloud.conf
Alias /owncloud "/var/www/owncloud/“
<Directory /var/www/owncloud/>
Options +FollowSymlinks
AllowOverride All
<IfModule mod_dav.c>
Dav off
</IfModule>
SetEnv HOME /var/www/owncloud
SetEnv HTTP_HOME /var/www/owncloud
</Directory>
# a2enconf owncloud
# a2enmod rewrite
# a2enmod headers
# a2enmod env
# a2enmod dir
# a2enmod mime
# service apache2 restart
//on host pc
10.10.51.37/owncloud
관리자계정 : admin / 1234
사용자 추가 : user1 / keduit.testuer@gmail.com / 1234 / 할당량(100MB)
//동기화
D:\owncloud //생성
ownCloud -> http://10.10.51.37/owncloud -> user1 / 1234
-> 폴더 동기화 연결 추가 -> D:\owncloud
//Optional(CentOS)
# docker search centos
# docker pull centos:8
# docker images
# docker create -i -t --name my_centos8 centos
# docker start my_centos8
# docker ps
# docker attach my_centos8
- Owncloud on Amazon Linux
//1. Yum Update
# yum update -y
//2. Install PHP
# amazon-linux-extras install php7.4 -y
# yum install -y php-cli php-common php-gd php-mbstring php-mysqlnd php-pdo php-fpm php-xml curl
# yum install -y php-opcache php-zip php-bcmath libzip-devel php-devel php-pear gcc zlib-devel php-intl
# vim /etc/php-fpm.d/www.conf
user = nginx
group = nginx
# vim /etc/php.ini
date.timezone = Asia/Seoul
# systemctl enable --now php-fpm
//3. Change Permission
# chmod 770 /var/lib/php/session/ -R
# chown nginx.nginx /var/lib/php/session/ -R
//4. Install nginx
# amazon-linux-extras install -y nginx1.12
# systemctl enable --now nginx
# vim /etc/nginx/nginx.conf
root /usr/share/nginx/html/owncloud;
# systemctl enable --now nginx
//5. Download owncloud
# cd /usr/share/nginx/html/
# wget -q https://download.owncloud.com/server/stable/owncloud-complete-latest.zip
# unzip owncloud-complete-latest.zip -d ./
# chmod 775 owncloud -R
# chown nginx.nginx owncloud -R
//6. Install MariaDB
# vim /etc/yum.repos.d/MariaDB.repo
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.4/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
# yum install -y MariaDB MariaDB-Server
# systemctl enable --now mariadb
# /usr/bin/mysqladmin -u root password
1234
1234
# mysql -u root -p
1234
> CREATE DATABASE owncloud default CHARACTER SET UTF8;
> exit;
3. 결론
오랜만에 수업을 진행하니 시간이 참 빠르다.
4. 참고자료
1. Cisco Docs
- ARP
- CDP / VLAN
- Frame Relay
- Static Routing
- VLAN
- VTP
- Routed Port
- AD
- Route Selection
- FHRP
- HSRP
- DHCP
- DNS
- STP
- NAT
- EtherChannel
- DTP
- RIP
- NTP
- Offset List
- Password Encryption
- ACL
- CAR Attack
- Broadcast
- Port Assignments
- IPv6 Static Routing
- HSRP for IPv6
- Clock Rate
- DHCPv6 Guard
- EIGRP
- Express Forwarding
- Routing and Switching
- Load Balancing
- Ping, Traceroute
- Load Balancing
- Fast Switching
- CEF
- DNS
- SSH
- Regular Expression
- OSPF
- EIGRP’s SIA
- NSSA
- AAA
2. Linux
- rhel9’s docs
- Linux Directory Structure
- File Types in Linux
- fstab
- Vim Cheat Sheet
- Protecting GRUB with a password
- SELinux
- DNS
- Samba as a server
- DHCP
- NFS
- SSH
- VNC
- heredoc
- docker vs podman + buildqh + skopeo
- Docker란?
- Linux 컨테이너란?
- Container vs VM
- 컨테이너화란?
- container
- 컨테이너 오케스트레이션이란?
- 쿠버네티스란?
- 쿠버네티스 아키텍처 소개
- 쿠버네티스 기본 사항 학습
- 쿠버네티스 클러스터란?
3. Web
- HTML’s Elements
- Emmet
- JavaScript
- Anchor Tag
- Post, Get
- Block, Inline Elements
- Semantic Web
- Semantic Elements
- CSS
- Viewport_meta_tag
- Media_queries
- JavaScript
4. DB
클라우드 엔지니어를 꿈꾸며 공부를 시작한 초보 엔지니어입니다. 틀린점 또는 조언해주실 부분이 있으시면 친절하게 댓글 부탁드립니다. 방문해 주셔서 감사합니다 :)
댓글남기기