找回密码
 立即注册

ub18 装机笔记

[复制链接]
69伙伴 发表于 2020-8-3 17:19:00 | 显示全部楼层 |阅读模式
1.更新源
/etc/apt/sources.list

  1. #163
  2. # deb http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse # disabled on upgrade to bionic
  3. # deb http://mirrors.163.com/ubuntu/ xenial-security main restricted universe multiverse # disabled on upgrade to bionic
  4. # deb http://mirrors.163.com/ubuntu/ xenial-updates main restricted universe multiverse # disabled on upgrade to bionic
  5. # deb http://mirrors.163.com/ubuntu/ xenial-proposed main restricted universe multiverse # disabled on upgrade to bionic
  6. # deb http://mirrors.163.com/ubuntu/ xenial-backports main restricted universe multiverse # disabled on upgrade to bionic
  7. # deb-src http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse # disabled on upgrade to bionic
  8. # deb-src http://mirrors.163.com/ubuntu/ xenial-security main restricted universe multiverse # disabled on upgrade to bionic
  9. # deb-src http://mirrors.163.com/ubuntu/ xenial-updates main restricted universe multiverse # disabled on upgrade to bionic
  10. # deb-src http://mirrors.163.com/ubuntu/ xenial-proposed main restricted universe multiverse # disabled on upgrade to bionic
  11. # deb-src http://mirrors.163.com/ubuntu/ xenial-backports main restricted universe multiverse # disabled on upgrade to bionic


  12. #ali
  13. deb-src http://archive.ubuntu.com/ubuntu bionic main restricted #Added by software-properties
  14. deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted
  15. deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted multiverse universe #Added by software-properties
  16. deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted
  17. deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted multiverse universe #Added by software-properties
  18. deb http://mirrors.aliyun.com/ubuntu/ bionic universe
  19. deb http://mirrors.aliyun.com/ubuntu/ bionic-updates universe
  20. deb http://mirrors.aliyun.com/ubuntu/ bionic multiverse
  21. deb http://mirrors.aliyun.com/ubuntu/ bionic-updates multiverse
  22. deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
  23. deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse #Added by software-properties
  24. deb http://archive.canonical.com/ubuntu bionic partner
  25. deb-src http://archive.canonical.com/ubuntu bionic partner
  26. deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted
  27. deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted multiverse universe #Added by software-properties
  28. deb http://mirrors.aliyun.com/ubuntu/ bionic-security universe
  29. deb http://mirrors.aliyun.com/ubuntu/ bionic-security multiverse

  30. #huawei
  31. # deb http://mirrors.huaweicloud.com/ubuntu/ bionic main restricted # disabled on upgrade to bionic
  32. # deb http://mirrors.huaweicloud.com/ubuntu/ xenial-updates main restricted # disabled on upgrade to bionic
  33. # deb http://mirrors.huaweicloud.com/ubuntu/ bionic universe # disabled on upgrade to bionic
  34. # deb http://mirrors.huaweicloud.com/ubuntu/ xenial-updates universe # disabled on upgrade to bionic
  35. # deb http://mirrors.huaweicloud.com/ubuntu/ bionic multiverse # disabled on upgrade to bionic
  36. # deb http://mirrors.huaweicloud.com/ubuntu/ xenial-updates multiverse # disabled on upgrade to bionic
  37. # deb http://mirrors.huaweicloud.com/ubuntu/ xenial-backports main restricted universe multiverse # disabled on upgrade to bionic
  38. # deb http://mirrors.huaweicloud.com/ubuntu xenial-security main restricted # disabled on upgrade to bionic
  39. # deb http://mirrors.huaweicloud.com/ubuntu xenial-security universe # disabled on upgrade to bionic
  40. # deb http://mirrors.huaweicloud.com/ubuntu xenial-security multiverse # disabled on upgrade to bionic
复制代码


ssh 开 root登录

1. 查看ssh服务器是否安装并启动

  1. #sudo ps -e | grep ssh
复制代码

1. 安装ssh服务器
  1. #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那一行,复制该行内容并修改。

  1. 将“#PermitRootLogin prohibit-password”修改为“PermitRootLogin yes”
复制代码

3. 重启服务器 service ssh restart
  1. service ssh restart
复制代码

867078-20200108153116794-77885117.png



---- 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  :修改配置后重新加载生效

临时交流 ⇨点我留言
 楼主| 69伙伴 发表于 2020-8-3 22:45:54 | 显示全部楼层
centos7
https://www.cnblogs.com/kaerxifa/p/11713199.html

启动nginx服务
systemctl start nginx.service

停止nginx服务
systemctl stop nginx.service

重新启动服务
systemctl restart nginx.service

重新读取nginx配置(这个最常用, 不用停止nginx服务就能使修改的配置生效)
systemctl reload nginx.service



在CentOS 7系统上安装PHP 7.4版本的方法
https://blog.csdn.net/qq_27715357/article/details/106734411
临时交流 ⇨点我留言
【附件·直下】非必要·勿注册

网格·联系我们 ( 京ICP备16001788号|京公网安备 11010502049360号 ) | 网站地图 | 2012- WGPro.CoM |

GMT+8, 2024-11-24 11:21

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表