网格论坛

 找回密码
 立即注册
查看: 94|回复: 1

ub18 装机笔记

[复制链接]

75

主题

160

帖子

2万

积分

总大队长

Rank: 9Rank: 9Rank: 9

积分
27451
发表于 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  :修改配置后重新加载生效

回复

使用道具 举报

75

主题

160

帖子

2万

积分

总大队长

Rank: 9Rank: 9Rank: 9

积分
27451
 楼主| 发表于 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号 )

GMT+8, 2020-9-25 23:35 , Processed in 0.021483 second(s), 23 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

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