Ubuntu 22.04 서버 세팅하기 🛠️

서문 Windows 7을 약 2주 간 서버로 사용한 후 다시 Ubuntu 22.04로 돌아왔다. OBS 송출 테스트를 위해 Ubuntu Server 대신 Ubuntu를 설치했고, 완전한 순정 상태다. 이번 글에서는 Ubuntu 22.04를 서버로 사용하기 편리하게 세팅하는 방법을 소개하겠다. 이 글과 겹치는 내용이 있으나 추가적으로 업데이트 된 내용도 있다. 반드시 순정 상태에서, 홈 디렉토리에서 해야 문제가 생기지 않는다. ✅ 패키지 업데이트 sudo apt-get update -y sudo apt-get upgrade -y 🪡 각종 인프라 유틸리티 sudo apt-get install htop net-tools neofetch cpufetch 👸 터미널을 예쁘게 만들기 sudo apt-get install zsh git curl -y sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k echo 'source ~/powerlevel10k/powerlevel10k.zsh-theme' >>! ~/.zshrc source ~/.zshrc ⚒️ zsh 플러그인 설치 git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions sed -i 's/plugins=(git)/plugins=(git zsh-autosuggestions)/g' ~/.zshrc git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting echo "source ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ${HOME}/.zshrc source ~/.zshrc 🔋 노트북 덮개 덮어도 전원 유지 sudo sed -i 's/#HandleLidSwitch=suspend/HandleLidSwitch=ignore/g' /etc/systemd/logind.conf sudo systemctl restart systemd-logind 🔐 git credential 세팅 git clone <개인 repo> cd <개인 repo> git config --global credential.helper store 💻 nodejs 설치 및 개발 환경 세팅 sudo apt install nodejs -y sudo apt install npm -y sudo npm cache clean -f sudo npm install -g n sudo n stable sudo npm install -g yarn nodemon pm2 typescript ts-node 💻 pip 설치 curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py python3 get-pip.py PATH=$HOME/.local/bin:$PATH echo "alias p='python3'" >> ~/.zshrc source ~/.zshrc 📲 ftp 서버 구축 sudo apt install vsftpd -y sudo sh -c "echo -e 'listen=YES\nlisten_ipv6=NO\nanonymous_enable=NO\nport_enable=NO\npasv_enable=YES\nlocal_enable=YES\nwrite_enable=YES\nuse_localtime=YES\nxferlog_enable=YES\nsecure_chroot_dir=/var/run/vsftpd/empty\npam_service_name=vsftpd\nssl_enable=YES\nrsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem\nrsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key\nlisten_port=21\npasv_min_port=60020\npasv_max_port=60030' > /etc/vsftpd.conf" sudo systemctl enable vsftpd sudo systemctl restart vsftpd 🎮 rdp 구축 sudo apt install xrdp -y sudo adduser xrdp ssl-cert sudo sh -c "sed -i '1 i\export XDG_CURRENT_DESKTOP=ubuntu:GNOME' /etc/xrdp/startwm.sh" sudo sh -c "sed -i '1 i\export GNOME_SHELL_SESSION_MODE=ubuntu' /etc/xrdp/startwm.sh" sudo sh -c "echo 'unset DBUS_SESSION_BUS_ADDRESS' >> /etc/xrdp/startwm.sh" sudo sh -c "echo 'unset XDG_RUNTIME_DIR' >> /etc/xrdp/startwm.sh" sudo service xrdp restart 💬 irc 구축 sudo apt-get install perl g++ make wget -y wget https://github.com/inspircd/inspircd/archive/refs/tags/v3.14.0.tar.gz tar xvf ./v3.14.0.tar.gz cd inspircd-3.14.0 perl ./configure make make -j5 install nano run/conf/inspircd.conf 다음과 같이 입력한다. ...

September 5, 2022 · 3 min · 450 words · Me

Ubuntu 홈서버 구축 가이드 💻

서문 이 글은 홈서버를 구축하기 위한 완전한 가이드다. 홈서버의 개념, 장점, VPS와의 차이, 운영체제 설치와 각종 툴 설치에 대한 내용을 설명하고 있다. 아래에서 설명하는 내용은 반드시 중요 자료를 백업한 후에 진행해야 한다. 홈서버란? 홈서버란 집에 나만의 서버를 구축하는 것이다. 집에 서버를 구축하는 이유는 재미, 학습의 이유, 동영상 다운로드나 토렌트와 같은 반복적인 업무를 수행하기 위한 목적이 있다. 데이터 센터에서 VPS 서버를 대여하는 것이 네트워크 안정성, 화재에 대한 위험에 대한 측면으로는 훨씬 낫지만, 하드웨어 업그레이드가 용이, 무엇보다 재미가 있기 때문에 홈서버를 구축하는 사람들도 적지 않다. ...

May 15, 2022 · 7 min · 1438 words · Me

Ubuntu Server에 GUI 설치 후 RDP로 접속하기

사용 환경 Ubuntu Server 20.04.3 LTS macOS Monterey 12.1 GUI의 필요성 홈서버에 windows vm을 설치할 일이 생겨 qemu로 설치를 하고, ssh -X 옵션과 xquartz를 통해 맥에서 해당 vm을 띄우는 세팅을 했는데, 안정성이 매우 떨어져 결국 ubuntu server에 gnome gui를 올리고 rdp로 접속하여 vmware를 통해 windows vm을 세팅하는 방향을 선택했다. 서버에 gui가 돌아간다는게 참 불편하긴 하지만 때로는 cli보다는 gui 환경에서 세팅해야 편한 작업들이 꽤 있기 때문에 이번 기회에 설치를 해보고, 이 글에서는 아래의 순서대로 글을 작성하겠다. ...

February 11, 2022 · 2 min · 246 words · Me

Ubuntu에서 Docker를 이용한 IRC 서버 구축

IRC란? Internet Relay Chatting의 약자로, 특정 topic을 가지고 사용자끼리 대화를 할 수 있습니다. Installation 먼저 방화벽에서 6667, 6697, 7000, 7001 포트를 열어줍니다. iptables -I INPUT 1 -p tcp --dport 6667 -j ACCEPT iptables -I INPUT 1 -p tcp --dport 6697 -j ACCEPT iptables -I INPUT 1 -p tcp --dport 7000 -j ACCEPT iptables -I INPUT 1 -p tcp --dport 7001 -j ACCEPT 또는 서버 방화벽 (보안 그룹) 페이지에서 해당 포트를 열어줄 수 있습니다. sudo apt install docker sudo apt install certbot sudo apt install screen 도커, 인증서 발급 패키지, 백그라운드 실행 패키지를 설치합니다. ...

January 25, 2022 · 2 min · 381 words · Me