CentOS 7 Minimal
- sudo passwd
- sudo passwd gcjjyy
SwapFile 생성 (su 를 통해 root 권한으로 실행)
fallocate -l 2G /swapfile
dd if=/dev/zero of=/swapfile count=2048 bs=1M
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
echo "/swapfile swap swap defaults 0 0" >> /etc/fstab
NodeJS 설치
sudo yum update
sudo yum install -y git curl wget zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
curl -sL https://rpm.nodesource.com/setup_12.x | sudo bash -
sudo yum install -y nodejs
sudo npm install -g yarn forever
APM 설치
sudo yum install httpd php mariadb-server php-mysql
sudo systemctl enable httpd.service
sudo systemctl enable mariadb.service
sudo systemctl start httpd.service
sudo systemctl start mariadb.service
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo firewall-cmd --reload
mysql_secure_installation
Let’s Encrypt로 SSL설치
sudo yum install epel-release
sudo yum install python-certbot-apache
sudo vi /etc/httpd/conf.d/gcjjyy.conf
<VirtualHost *:80>
ServerName gcjjyy.io
DocumentRoot /var/www/html
ServerAlias gcjjyy.io
ErrorLog /var/www/error.log
CustomLog /var/www/requests.log combined
</VirtualHost>
sudo setenforce 0
sudo service httpd restart
sudo certbot --apache -d gcjjyy.io
sudo vi /etc/httpd/conf.d/ssl.conf
ServerName gcjjyy.io:443
SSLCertificateFile /etc/letsencrypt/live/gcjjyy.io/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/gcjjyy.io/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/gcjjyy.io/fullchain.pem
sudo systemctl restart httpd