Table of Contents
What a VPS can do, actually it's out of my imagenation.
I got a really cheap and stable KVM vps on hosteons.com, and run shadowsocksR as the main job.
1 Basic
ssh log in ubuntu 16, the vnc will encouter a template error with GUI.
1 | ssh root@your_vps_ip |
1 | PasswordAuthentication no |
1 | sudo service sshd restart |
1 | Host eula.cf |
1 | ssh eula.cf |
2 SSR server
2.1 speed benchmark
1 | wget -qO- https://raw.githubusercontent.com/oooldking/script/master/superbench.sh | bash |
2.2 bbr
1 | ## for ubuntu 18 |
2.3 ssr
1 | mkdir -p ssr && cd ssr |
2.4 Other options
ss
1 | pip install shadowsocks |
local to vps
1 | apt-get install build-essential libtool libpcre3 libpcre3-dev zlib1g-dev openssl |
streisand
1 | apt install python |
3 Web server
3.1 http
nginx
1 | apt install nginx |
frp
- installation
1
2
3
4
5
6
7
8
9PKG_VER=0.21.0
PKG_ARCH=linux_amd64
PKG_NAME=frp_$(PKG_VER)_$(PKG_ARCH)
wget https://github.com/fatedier/frp/releases/download/v$(PKG_VER)/$(PKG_NAME).tar.gz
tar -xzf $(PKG_NAME).tar.gz
cd $(PKG_NAME)
PKG_PATH=$(PWD)/frps
./frps -c ./frps.ini --reload
sudo cat $(PKG_PATH) -c $(PKG_PATH).ini & >> /etc/rc.local - frps startup
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17sudo vi /lib/systemd/system/frps.service
[Unit]
Description=frps service
After=network.target syslog.target
Wants=network.target
[Service]
Type=simple
ExecStart=/root/frp/frps -c /root/frp/frps.ini
[Install]
WantedBy=multi-user.target
scp 0x99-frps.service eula.fc:/lib/systemd/system/frps.service
sudo systemctl start frps
sudo systemctl enable frps - frps screen1
1
2
3screen -S frp /root/frp/frps -c /root/frp/frps.ini
ln -s /root/frp/frps /usr/bin/frps
screen -S frp frps -c /root/frp/frps.iniThe config file
1
2
3
4
5
6
7
8
9
10
11[common]
token = your_passwd
bind_port = 7000
kcp_bind_port = 7000
vhost_http_port = 80
vhost_https_port = 443
subdomain_host = your_domain
dashboard_port = 8000
dashboard_user = username
dashboard_pwd = passwd1
2
3
4
5
6
7
8
9[ssh]
type = tcp
listen_port = 9000
auth_token = passwd1
[ssh_1]
type = tcp
listen_port = 9001
auth_token = passwd2 - https2, 3
ssl – let's encrypt
- frp on openwrt
Add to /etc/init.d/frpc
1
2
3
4
5
6
7
8
9
10
11
12
13#!/bin/sh /etc/rc.common
START=99
USE_PROCD=1
start_service() {
procd_open_instance "frpc"
procd_set_param command /tmp/frpc -c /root/frp/frpc.ini
procd_set_param stdout 1
procd_set_param stderr 1
procd_set_param user root
procd_close_instance
}- original
1
./tmp/frpc -c /root/frp/frpc.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18[common]
server_addr = your_vps_ip
server_port = 7000
token = your_passwd
login_fail_exit = false
admin_port = 7400
[lede]
type = http
local_ip = 192.168.1.1
local_port = 80
subdomain = lede
[aria2]
type = http
local_ip = 192.168.1.1
local_port = 6800
subdomain = aria2 - xfrp4
For Netgear 43005, and xfrpc only work with xfrps.
1
2find / -name "*libevent*"
ln -s /usr/lib/libevent-2.0.so.5 /usr/lib/libevent-2.1.so.6
- original
npm
1 | curl -sL https://deb.nodesource.com/setup_10.x | sudo bash - |
docker6
- docker usage
1
2
3
4
5
6
7
8sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
sudo apt update
apt-cache policy docker-ce
sudo apt install docker-ce
sudo systemctl status docker
sudo apt install net-tools1
2
3
4
5
6
7docker run image_name
docker ps
docker ps -a
docker kill `docker ps -q`
docker stop ID
docker start ID
docker rm `docker ps -q -a`
4 Mail server
Most vps has blocked port 25 in and out traffic, so check with telnet IP port
. Out traffic of 25 can be transferred to other ports8.
4.1 maildev9
docker or npm smtp test server, catch and send mail, webclient with password.
1 | npm install -g maildev |
forsaken10
1 | docker run --name fmail -d -p 25:25 -p 3000:3000 denghongcai/forsaken-mail |
iRedMail11
Open source serious server,
Modoboa12
Multi-function
mailinabox13
Multi-function
Mailu14
Serious server, need more than 2G total memory and 1G free memory.
mailslurper15
Go compiled
5 Issues
5.1 iptables
clear all
1 | iptables -P INPUT ACCEPT |
1 | iptables-save | awk '/^[*]/ { print $1 } |
1 | root@eula:~# iptables -L -n -v |
1 | root@eula:~# iptables -L -n -v |
5.2 startup
Ubuntu 18.04 LTS support systemctl and cannot edit rc.local directly to config startup.
1 | sudo vim /etc/systemd/system/rc-local.service |
1 | [Install] |
1 | sudo vim /etc/rc.local |
1 | #!/bin/sh -e |
1 | sudo chmod +x /etc/rc.local |