Server Setup
계정
$ sudo passwd root
$ apt update && apt upgrade
Bash
복사
vsftpd
& apt-get install vsftpd
& nano /etc/vsftpd.conf
...
& service vsftpd restart
& nano /etc/ftpusers # 루트 계정 접근
Bash
복사
listen=YES
listen_ipv6=NO
anonymous_enable=NO
local_enable=YES
write_enable=YES
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_file=/var/log/vsftpd.log
ftpd_banner=Welcome to Hyuns Korea Server FTP.
chroot_local_user=NO
secure_chroot_dir=/var/run/vsftpd/empty
pam_service_name=vsftpd
pasv_enable=YES
pasv_min_port=49152
pasv_max_port=50000
Dart
복사
/etc/vsftpd.conf
Ngnix
$ apt install nginx
Bash
복사
MariaDB
& apt install mariadb-server php-mysql //MYSQL과 PHP mysql 추가 설치
& mysql_secure_installation
Enter current password for root (enter for none): //루트 패스워드 => 그냥 ENTER
Set root password? [Y/n] //y ==> mysql root 패스워드를 설정할지 묻는다.
Remove anonymous users? [Y/n] // y ==> 익명사용자 삭제
Disallow root login remotely? [Y/n] // n ==> mysql 원격 접속 권한 제한.
Remove test database and access to it? [Y/n] //y ==>test DB를 삭제
Reload privilege tables now? [Y/n] // y 리로드
Bash
복사
Node.js
>>> curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
>>> apt-get install -y nodejs
JavaScript
복사
PHP 설치
& apt install php-fpm
& nano /etc/nginx/sites-available/default
...
& service nginx reload
Bash
복사
location ~ \.php$ {
include snippets/fastcgi-php.conf;
#
# # With php-fpm (or other unix sockets):
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
# # With php-cgi (or other tcp sockets):
# fastcgi_pass 127.0.0.1:9000;
}
...
index index.php index.html index.htm index.nginx-debian.html;
TypeScript
복사
/etc/nginx/sites-available/default
Code-server 설치
curl -fsSL https://code-server.dev/install.sh | sh
JavaScript
복사
nano ~/.config/code-server/config.yaml //설정파일, 한 번 실행해야 생성됨
JavaScript
복사
Useful command
netstat -tnlp
netstat -tnlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 11786/mysqld
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 14737/nginx: master
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 20590/systemd-resol
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN 14211/vsftpd
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1145/sshd
tcp 0 0 127.0.0.1:9090 0.0.0.0:* LISTEN 29487/prometheus
tcp 0 0 127.0.0.1:9091 0.0.0.0:* LISTEN 29475/node
tcp 0 0 127.0.0.1:9092 0.0.0.0:* LISTEN 29497/outline-ss-se
tcp6 0 0 :::80 :::* LISTEN 14737/nginx: master
tcp6 0 0 :::22 :::* LISTEN 1145/sshd
tcp6 0 0 :::3100 :::* LISTEN 16243/node
tcp6 0 0 :::3101 :::* LISTEN 14810/node
tcp6 0 0 :::47167 :::* LISTEN 29475/node
tcp6 0 0 :::57280 :::* LISTEN 29497/outline-ss-se
HTML
복사
Nginx 설정 파일
nano /etc/nginx/sites-available/default
...
service nginx reload
HTML
복사