서버 설정
기술 문서
2022/08/03
- 서버 인스턴스 생성
- root 비밀번호 변경
[명령어] passwd
- mediex 유저 생성
[명령어] useradd mediex
[명령어] passwd mediex
[명령어] usermod -aG wheel mediex
[명령어] visudo -f /etc/sudoers
(수정전)
- Same thing without a password
- %wheel ALL=(ALL) NOPASSWD: ALL
- Same thing without a password
%wheel ALL=(ALL) NOPASSWD: ALL
- root, mediex 접속 확인
- root ssh 접속 제한 설정
vi /etc/ssh/sshd_config
#PermitRootLogin yes
를
PermitRootLogin no
service sshd restart
- docker 설치
yum -y update
yum install -y yum-utils
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum install docker-ce docker-ce-cli containerd.io docker-compose-plugin
systemctl start docker
systemctl enable docker
systemctl status docker
- docker compose 설치
curl -SL https://github.com/docker/compose/releases/download/v2.6.1/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose
chmod 755 /usr/local/bin/docker-compose
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
- node 설치
wget https://nodejs.org/download/release/v14.20.0/node-v14.20.0-linux-x64.tar.gz
sudo mkdir -p /usr/local/lib/nodejs
sudo tar -xvf node-v14.20.0-linux-x64.tar.gz -C /usr/local/lib/nodejs
.bash_profile 수정
NODE_HOME=/usr/local/lib/nodejs/node-v14.20.0-linux-x64
PATH=$PATH:$HOME/.local/bin:$HOME/bin:$NODE_HOME/bin
. ~/.bash_profile
$ node -v
$ npm version
$ npx -v
- pm2 설치
root로 변경 (sudo 안먹음)
/usr/local/lib/nodejs/node-v14.20.0-linux-x64/bin/npm i -g pm2
pm2 install pm2-logrotate
- ncloud nas 설정
/mnt/nas 생성
service rpcbind start
systemctl enable rpcbind.service
mount -t nfs -o vers=3 169.254.84.48:/n2649576_upload /mnt/nas
/etc/fstab에 169.254.84.48:/n2649576_upload /mnt/nas nfs defaults 0 0 추가
chkconfig netfs on
- 리포트 서버 headless chrome 관련
cd /home/mediex/server/common/mediex-report/node_modules/puppeteer/.local-chromium/linux-1022525/chrome-linux
ldd chrome | grep not
yum install alsa-lib.x86_64
yum install atk.x86_64
yum install cups-libs.x86_64
yum install gtk3.x86_64
yum install ipa-gothic-fonts
yum install libXcomposite.x86_64
yum install libXcursor.x86_64
yum install libXdamage.x86_64
yum install libXext.x86_64
yum install libXi.x86_64
yum install libXrandr.x86_64
yum install libXScrnSaver.x86_64
yum install libXtst.x86_64
yum install pango.x86_64
yum install at-spi2-atk
yum install xorg-x11-fonts-100dpi
yum install xorg-x11-fonts-75dpi
yum install xorg-x11-fonts-cyrillic
yum install xorg-x11-fonts-misc
yum install xorg-x11-fonts-Type1
yum install xorg-x11-utils
yum update nss -y
ldd chrome | grep not (결과가 아무것도 안나와야 정상)
- 레포트 한글 폰트 셋팅
https://www.lesstif.com/lpt/linux-font-font-config-93127497.html 참고
cd /usr/share/fonts
mkdir nanum
wget https://hangeul.naver.com/hangeul_static/webfont/zips/nanum-square.zip
chmod 755 nanum-square.zip
unzip nanum-square.zip
fc-cache -r
- 메모리 캐시 clear 설정
crontab -e
0 19 * * * sync && echo 3 > /proc/sys/vm/drop_caches 추가
- GCC 설치 (node 및 sqlite3 libstdc++.so.6 관련)
yum install gmp-devel mpfr-devel libmpc-devel wget
wget https://ftp.gnu.org/gnu/gcc/gcc-8.3.0/gcc-8.3.0.tar.gz
mkdir gcc-8.3.0-build
tar xf gcc-8.3.0.tar.gz
cd gcc-8.3.0-build
../gcc-8.3.0/configure --enable-languages=c,c++ --disable-multilib
sudo make -j 10 && sudo make install
export LD_LIBRARY_PATH=/usr/local/lib64:${LD_LIBRARY_PATH}
확인: strings /usr/local/lib64/libstdc++.so.6 | grep CXXABI
-- 파이썬 3 설치 (node-sass 또는 node-gyp 관련)
https://kmaster.tistory.com/66#google_vignette 참고
export npm_config_python=/path/to/executable/python