firewall-cmd命令参数介绍
firewall-cmd –xx-
参数 功能--get-default-zone 查询当前默认的区域名称
--set-default-zone=区域名称 设置默认的区域并使其永久生效
--get-zones 显示可用的区域
--get-services 显示命令支持的服务
--get-active-zones
显示当前正在使用的区域与网卡名称
2023-11-27 Linux&Unix
firewall-cmd –xx-
参数 功能--get-default-zone 查询当前默认的区域名称
--set-default-zone=区域名称 设置默认的区域并使其永久生效
--get-zones 显示可用的区域
--get-services 显示命令支持的服务
--get-active-zones
显示当前正在使用的区域与网卡名称
2023-11-12 Linux&Unix
1、网络
IP设置:
/etc/NetworkManager/system-connections/*.nmconnection
nmcli命令可以配置此文件:
比如:
# nmcli connection modify ens192 +ipv4.routes “192.168.0.0/24 192.168.0.254, 192.168.2.0/24 192.168.0.254”
同:
route1=192.168.0.0/24,192.168.0.254
route2=192.168.2.0/24,192.168.0.254
2、时间
时区设置:
cd /etc
rm /etc/localtime -fr
ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
hwclock –systohc
(同步硬件时间,无法使用NTP)
3、关闭SElinux
查看状态:/usr/sbin/sestatus -v
临时关闭SElinux: setenforce 0
永久关闭SElinux: vim /etc/selinux/config
SELINUX=disabled
4、修改SSH端口
启用SSH:默认启动
vim /etc/ssh/sshd_config
Port 22
5、关闭防火墙
关闭防火墙: systemctl stop firewalld
禁用防火墙: systemctl disable firewalld
查看防火墙状态: systemctl status firewalld
2023-11-01 Linux&Unix
Linux硬盘是数据存储中极其重要的部分,在使用Linux操作系统时,用户常常需要对Linux硬盘进行扩容。扩容可以提供给用户更多的空间,让用户能够更加有效地利用硬盘作为数据存储。
在扩容Linux硬盘之前,用户需要做几件准备工作,包括对Linux系统环境的检查、检查硬件驱动器和更新固件。
下面,我们就以扩容Linux ext4分区为例,来详细介绍一下Linux硬盘的扩容技术:
Continue…2023-09-13 Linux&Unix
安装remi源
dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
dnf install https://rpms.remirepo.net/enterprise/remi-release-9.rpm
查看可以安装的PHP版本
dnf module list php
Remi's Modular repository for Enterprise Linux 9 - x86_64
Name Stream Profiles Summary
php remi-7.4 common [d], devel, minimal PHP scripting language
php remi-8.0 common [d], devel, minimal PHP scripting language
php remi-8.1 common [d], devel, minimal PHP scripting language
php remi-8.2 common [d], devel, minimal PHP scripting language
Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled
启用PHP8.2版本
dnf module enable php:remi-8.2
安装PHP扩展
dnf install php-fpm php php-bcmath php-cli php-common php-gd php-imap php-mbstring php-mcrypt php-mysql php-mysqlnd php-pdo php-soap php-tidy php-xml php-xmlrpc php-opcache php-redis php-pecl-mcrypt -y
查看PHP版本
php -v
PHP 8.2.2 (cli) (built: Jan 31 2023 13:31:55) (NTS gcc x86_64)
Copyright (c) The PHP Group
Zend Engine v4.2.2, Copyright (c) Zend Technologies
with Zend OPcache v8.2.2, Copyright (c), by Zend Technologies
开启jit功能
cd /etc/php.d/
编辑扩展文件,在文件最后添加jit配置
vim 10-opcache.ini
opcache.jit_buffer_size=256M
opcache.jit=1255
重启PHP
systemctl restart php-fpm
查看jit是否开启成功
php -i|grep 'opcache.jit'
opcache.jit => 1255 => 1255
opcache.jit_bisect_limit => 0 => 0
opcache.jit_blacklist_root_trace => 16 => 16
opcache.jit_blacklist_side_trace => 8 => 8
opcache.jit_buffer_size => 256M => 256M
opcache.jit_debug => 0 => 0
opcache.jit_hot_func => 127 => 127
opcache.jit_hot_loop => 64 => 64
opcache.jit_hot_return => 8 => 8
opcache.jit_hot_side_exit => 8 => 8
opcache.jit_max_exit_counters => 8192 => 8192
opcache.jit_max_loop_unrolls => 8 => 8
opcache.jit_max_polymorphic_calls => 2 => 2
opcache.jit_max_recursive_calls => 2 => 2
opcache.jit_max_recursive_returns => 2 => 2
opcache.jit_max_root_traces => 1024 => 1024
opcache.jit_max_side_traces => 128 => 128
opcache.jit_prof_threshold => 0.005 => 0.005
设置PHP开机自启
systemctl enable php-fpm
转自:https://www.ggdoc.cn/archives/302