Digitalocean's gift quota was exhausted, and then the IP was also wall. So he returned to the bosom of vultr. This article we will share with you the server Migration Memo tutorial, hope to help everyone.
Basic settings
Create user
AddUser
The home directory, System shell version is automatically specified for the created user, and the user password is entered when it is created.
Useradd
The above basic settings need to be specified using the parameter option, and if no parameters are used, the user created has no password, no home directory, and no shell version specified.
To add an ordinary user to the sudo group, you typically use two methods:
Modify the/etc/sudoers file
... # User Privilege Specification root all= (all:all) All # Allow members of the group sudo to execute any command %SU Do all= (All:all) All//Add your own username ...
Execute command add user to sudo
Usermod-a-G sudo ' username '//note change to your own username
Change root password
passwd User Name
File Remote Copy
Tar-czvf/tmp/etc.tar.gz/etc <== after packaging, compress tar-xzvf/tmp/etc.tar.gz with gzip
Password-Free Login
Ssh-copy-id-i ~/.ssh/id_rsa.pub Remote-host
Package Installation
Mysql
MySQL Add user
CREATE USER ' wtser ' @ ' localhost ' identified by ' password '; GRANT all privileges on *. * to ' wtser ' @ ' localhost ';
Dump data
Mysqldump-u User-ppassword databaseName > Sqlfilename
Revocer data
CREATE DATABASE menagerie;mysql> ' use database_name; ' mysql> ' source path/to/file.sql; '
Shadowsocks
Chacha20
Compile and install Libsodium:
Apt-get Update apt-get install build-essential wget https://download.libsodium.org/libsodium/releases/ LATEST.tar.gz tar-zxf LATEST.tar.gz cd libsodium-1.0.3 ./configure && make && make Install
To repair a dynamic link library:
Edit /etc/ld.so.conf
The file, add a row /usr/local/lib
and save. Run commandldconfig
Nodejs
You can manually compile the installation yourself, but it is a bit slow, it is recommended to install with Nodesource
Nginx (for Plex seafile etc ... )
Pm2
Ghost Blog
Creating timed Tasks and daemons
Crontab timed Task (Certbot-renew,rss spider)
Systemed Daemon (ss, Frp,hubot)
# SYSTEMD Unit File Example FRP [unit] DESCRIPTION=FRP after=network.target [Service] type= Simple WORKINGDIRECTORY=/HOME/WTSER/SERVICE/FRP user=wtser execstart=/home/wtser/service/frp/frps- C/home/wtser/service/frp/frps.ini execstop= restart=always [Install] wantedby= Multi-user.target ~
Digitalocean's gift quota was exhausted, and then the IP was also wall. So he returned to the bosom of vultr.
Related recommendations:
The most comprehensive PHP server performance optimization configuration scheme
Introduction to Master-slave configuration in MySQL server
How JavaScript operates server control code examples