分类 Linux 下的文章

最近在调试软件的时候需要用到 CentOS 6 系统,yum 命令无法更新包返回都是 404,查了下发现大多数主流的源地址都取消对 CentOS 6 的支持,找了半天才找到一个可用的地址,记录下来备用。

CentOS 6 的包列表在:/etc/yum.repos.d/CentOS-Base.repo 文件中定义。

参考链接:https://blog.csdn.net/h952520296/article/details/110541018

# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the 
# remarked out baseurl= line instead.
#
#
 
[base]
name=CentOS-6.10 - Base - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6
 
#released updates 
[updates]
name=CentOS-6.10 - Updates - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6
 
#additional packages that may be useful
[extras]
name=CentOS-6.10 - Extras - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6
 
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-6.10 - Plus - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6
 
#contrib - packages by Centos Users
[contrib]
name=CentOS-6.10 - Contrib - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6

将以上内容替换到 CentOS-Base.repo 文件内,然后执行:

yum clean all && yum makecache

更新缓存即可。



之前我介绍过子网,子网掩码,网关等基本概念解析,可以参考:https://blog.niekun.net/archives/1885.html

在不同子网下的设备是不能直接访问的,因为他们在不同的网段内,比如:

FbdOD.gif

  • 路由 A 下有子网 192.168.1.0/24
  • 路由 B 下有子网 192.168.3.0/24
  • 设备 james:192.168.1.10/24 网关:192.168.1.1
  • 设备 Johnny:192.168.3.10/24 网关:192.168.3.1
  • 两个路由的 wan 网口在同一网段:192.168.2.0/24 下

阅读全文


安装包:https://nextcloud.com/changelog/#latest20
系统需求:https://docs.nextcloud.com/server/20/admin_manual/installation/system_requirements.html
nginx 配置:https://docs.nextcloud.com/server/18/admin_manual/installation/nginx.html
php 配置相关:https://docs.nextcloud.com/server/20/admin_manual/installation/source_installation.html#php-fpm-tips-label
修改 php 内存限制:https://www.chinaz.com/program/2011/1010/213048.shtml
安装 php 内存缓存:https://docs.nextcloud.com/server/15/admin_manual/configuration_server/caching_configuration.html
命令行安装:https://docs.nextcloud.com/server/stable/admin_manual/installation/command_line_installation.html


在创建 MySQL 用户时需要设置密码,有时候输入输入密码后会提示创建失败,密码设置 policy 错误。这是因为当前设置的密码和 MySQL 密码创建规则不符,可以查看当前规定的密码规则也可以进行修改。

进入 MySQL 执行下面命令:

SHOW VARIABLES LIKE 'validate_password%';

会列出密码创建相关参数:

mysql> SHOW VARIABLES LIKE 'validate_password%';
+--------------------------------------+--------+
| Variable_name                        | Value  |
+--------------------------------------+--------+
| validate_password_check_user_name    | ON     |
| validate_password_dictionary_file    |        |
| validate_password_length             | 8      |
| validate_password_mixed_case_count   | 1      |
| validate_password_number_count       | 1      |
| validate_password_policy             | MEDIUM |
| validate_password_special_char_count | 1      |
+--------------------------------------+--------+
7 rows in set (0.03 sec)

其中 validate_password_length 是密码位数,validate_password_special_char_count 是密码包含特殊字符。可以通过命令修改参数值来改变密码规则,例如:

取消特殊字符:

SET GLOBAL validate_password_special_char_count= 0;

修改后可以测试再次建立用户设置密码。