1.更新源
/etc/apt/sources.list
- #163
- # deb http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse # disabled on upgrade to bionic
- # deb http://mirrors.163.com/ubuntu/ xenial-security main restricted universe multiverse # disabled on upgrade to bionic
- # deb http://mirrors.163.com/ubuntu/ xenial-updates main restricted universe multiverse # disabled on upgrade to bionic
- # deb http://mirrors.163.com/ubuntu/ xenial-proposed main restricted universe multiverse # disabled on upgrade to bionic
- # deb http://mirrors.163.com/ubuntu/ xenial-backports main restricted universe multiverse # disabled on upgrade to bionic
- # deb-src http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse # disabled on upgrade to bionic
- # deb-src http://mirrors.163.com/ubuntu/ xenial-security main restricted universe multiverse # disabled on upgrade to bionic
- # deb-src http://mirrors.163.com/ubuntu/ xenial-updates main restricted universe multiverse # disabled on upgrade to bionic
- # deb-src http://mirrors.163.com/ubuntu/ xenial-proposed main restricted universe multiverse # disabled on upgrade to bionic
- # deb-src http://mirrors.163.com/ubuntu/ xenial-backports main restricted universe multiverse # disabled on upgrade to bionic
- #ali
- deb-src http://archive.ubuntu.com/ubuntu bionic main restricted #Added by software-properties
- deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted
- deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted multiverse universe #Added by software-properties
- deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted
- deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted multiverse universe #Added by software-properties
- deb http://mirrors.aliyun.com/ubuntu/ bionic universe
- deb http://mirrors.aliyun.com/ubuntu/ bionic-updates universe
- deb http://mirrors.aliyun.com/ubuntu/ bionic multiverse
- deb http://mirrors.aliyun.com/ubuntu/ bionic-updates multiverse
- deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
- deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse #Added by software-properties
- deb http://archive.canonical.com/ubuntu bionic partner
- deb-src http://archive.canonical.com/ubuntu bionic partner
- deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted
- deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted multiverse universe #Added by software-properties
- deb http://mirrors.aliyun.com/ubuntu/ bionic-security universe
- deb http://mirrors.aliyun.com/ubuntu/ bionic-security multiverse
- #huawei
- # deb http://mirrors.huaweicloud.com/ubuntu/ bionic main restricted # disabled on upgrade to bionic
- # deb http://mirrors.huaweicloud.com/ubuntu/ xenial-updates main restricted # disabled on upgrade to bionic
- # deb http://mirrors.huaweicloud.com/ubuntu/ bionic universe # disabled on upgrade to bionic
- # deb http://mirrors.huaweicloud.com/ubuntu/ xenial-updates universe # disabled on upgrade to bionic
- # deb http://mirrors.huaweicloud.com/ubuntu/ bionic multiverse # disabled on upgrade to bionic
- # deb http://mirrors.huaweicloud.com/ubuntu/ xenial-updates multiverse # disabled on upgrade to bionic
- # deb http://mirrors.huaweicloud.com/ubuntu/ xenial-backports main restricted universe multiverse # disabled on upgrade to bionic
- # deb http://mirrors.huaweicloud.com/ubuntu xenial-security main restricted # disabled on upgrade to bionic
- # deb http://mirrors.huaweicloud.com/ubuntu xenial-security universe # disabled on upgrade to bionic
- # deb http://mirrors.huaweicloud.com/ubuntu xenial-security multiverse # disabled on upgrade to bionic
复制代码
ssh 开 root登录
1. 查看ssh服务器是否安装并启动
1. 安装ssh服务器
- #sudo apt-get install openssh-server
复制代码
2. 配置sshd文件
编辑SSH服务的配置文件sshd_config,修改SSH的端口和root用户权限。
使用到的命令:(按字母“i”进入编辑模式,按ESC退出编辑模式,“:wq”保存退出)。
root@dante:~# vim /etc/ssh/sshd_config
1、找到# port 22所在的那一行,复制该行内容并修改。
将“#port 22”修改为“port 22”(将前面的“#”去掉)。
该行内容为设置SSHd服务的端口号
2、找到#PermitRootLogin prohibit-password那一行,复制该行内容并修改。
- 将“#PermitRootLogin prohibit-password”修改为“PermitRootLogin yes”
复制代码
3. 重启服务器 service ssh restart
---- nginx 常用命令
/etc/init.d/nginx restart
nginx -s reload :修改配置后重新加载生效
------------------------
安装nginx扩展
apt -y install nginx-core
apt -y install nginx-extras
apt -y install nginx-full
apt -y install nginx-light
nginx: [error] open() "/run/nginx.pid" failed (2: No such file or directory)
nano /etc/nginx/conf/nginx.conf
#pid logs/nginx.pid;
下面增加
/etc/nginx/logs/nginx.pid;
/etc/init.d/nginx restart
nginx -s reload :修改配置后重新加载生效
|