- 云主机:阿里云主机
- 操作系统:CentOS release 6.9 (Final)
(本文档只记录大概步骤,可能有不详细的地方,暂且看看)1. 创建普通用户
1
2useradd xxx
passwd xxx
useradd vs adduser
Debian / Ubuntu
On Debian or Ubuntu systems, useradd is a command itself, and you can create users and define options to them using this command, and adduser is a perl script, that uses useradd to create the account, asking you the password, Full-name, phone and others
Fedora / Centos
On Fedora or CentOS systems, adduser is just a symbolic link to useradd, but may try to copy the script from a Debian system to the CentOS one, I have never tried it, and may need to modify it a little before using it.
引用并感谢作者:
2. 添加互信
在远程机器上执行
1
ssh-keygen -t rsa
一直按回车键。
- 将本地主机的 .ssh/id_rsa.pub 内容写入到远程主机的 .ssh/authorized_keys
- 修改远程主机文件权限:
1
2# 之前权限为 664,导致添加互信失败,改为 660 后,互信成功
chmod 600 .ssh/authorized_keys
3. Tab 补全无效
比如,可以补全yum,但无法补全yum 参数1
2yum -y install bash-completion bash-completion-extras
source /etc/profile.d/bash_completion.sh
引用并感谢作者:
How to Install and Enable Bash Auto Completion in CentOS/RHEL
4. 源码安装nginx
- 步骤:
1 | 下载 Nginx 源码安装必须的三个依赖库, 并分别解压 |
- 启动nginx报错
1
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
端口号 < 1000, 需要root权限
5. 源码安装openresty
基本与安装nginx完全一致
6. 安装PHP7.2
1 | wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm |
7. 安装 hexo
1 | wget https://nodejs.org/dist/v7.0.0/node-v7.0.0-linux-x64.tar.xz |