debian部署

个人环境部署

apt-get install sudo
apt-get install vim

vim /etc/sudoers 
#增加 shagon ALL=(ALL:ALL) NOPASSWD:ALL

sudo vim /etc/vim/vimrc
#去掉 syntax on 前的注释
set tabstop=4
set softtabstop=4
colorscheme desert

vim /home/shagon/.ssh/authorized_keys
#增加本地密钥

#安装 oh-my-zsh
sudo apt-get install zsh
sudo apt-get install git
sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
sudo apt-get install autojump

#皮肤配置放入 /home/shagon/.oh-my-zsh/themes

vim ~/.zshrc
#增加配置
alias l='ls -lahF --color=auto'
alias ll='ls -lhF --color=auto'
alias ls='ls -GF --color=auto'

#禁止 root 远程密码登录
vim /etc/ssh/sshd_config
PermitRootLogin no
PasswordAuthentication no

#替换阿里云源
vim /etc/apt/sources.list
deb http://mirrors.aliyun.com/debian stretch main contrib non-free
deb-src http://mirrors.aliyun.com/debian stretch main contrib non-free
deb http://mirrors.aliyun.com/debian stretch-updates main contrib non-free
deb-src http://mirrors.aliyun.com/debian stretch-updates main contrib non-free
deb http://mirrors.aliyun.com/debian-security stretch/updates main contrib non-free
deb-src http://mirrors.aliyun.com/debian-security stretch/updates main contrib non-free

#校准时间
sudo apt-get install ntpdate
sudo ntpdate -u cn.pool.ntp.org

web环境部署

sudo apt-get install nginx
sudo apt-get install php7.0 php7.0-fpm
sudo apt-get install redis-server

sudo wget https://dev.mysql.com/get/mysql-apt-config_0.8.6-1_all.deb
sudo dpkg -i mysql-apt-config_0.8.6-1_all.deb
sudo apt-get install mysql-server

其他工具部署

sudo apt-get install supervisor

禁用 swap

sudo vim /etc/sysctl.conf
#添加
vm.swappiness=0

sudo vim /etc/fstab
#将 swap 所在行注释掉

取消开机菜单

sudo vim /etc/default/grub

GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=0

sudo update-grub
2017 年 10 月 30 日 下午
添加