CentOS7 常用

1,关闭Disable Selinux

sestatus  //查询状态
sed -i 's/\(^SELINUX=\).*/\SELINUX=disabled/' /etc/selinux/config  //设置关闭

或者使用命令 :nano /etc/sysconfig/selinu

SELINUX=enforcing指令更改为SELINUX=disabled,保存然后重启系统。

CentOS7开启SSH服务

安装服务:yum install openssh-server

修改配置文件:nano /etc/ssh/sshd_config,将文件中,关于监听端口、监听地址前的 # 号去除

Port 22

ListenAddress 0.0.0.0

ListenAddress ::

PermitRootLogin Yes

PasswordAuthentication yes

配置firewall

yum -y install firewalld
systemctl enable/disable firewalld
systemctl start firewalld
firewall-cmd --permanent --zone=public --add-service={http,https}
firewall-cmd --permanent --zone=public --add-port={5060,5061,5080,5081}/tcp
firewall-cmd --permanent --zone=public --add-port={5060,5061,5080,5081}/udp
firewall-cmd --permanent --zone=public --add-port=16384-32768/udp
firewall-cmd --reload

关闭IPv6

yum install ifconfig
ifconfig命令查看网卡信息,如果出现inet6 fe80::20c:29ff:fed0:3514,说明机器开启了ipv6

编辑/etc/sysctl.conf配置,增加net.ipv6.conf.all.disable_ipv6=1
编辑/etc/sysconfig/network配置,增加 NETWORKING_IPV6=no
编辑/etc/sysconfig/network-scripts/ifcfg-xxxx,确保IPV6INIT=no,ifcfg-xxxx是根据自己机器的
systemctl disable ip6tables.service   //关闭防火墙的开机自启动
执行sysctl -p或者reboot重启命令

重新配置时区

tzselect    // FIND YOUR TIMEZONE
timedatectl set-timezone America/Vancouver    //SET TIMEZONE EXAMPLE
​timedatectl status   //CHECK TIMEZONE

安装PHP7.4

1、配置安装资源

yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
 yum -y install https://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum install https://rpms.remirepo.net/enterprise/remi-release-7.rpm 
sudo yum -y install yum-utils
sudo yum-config-manager --enable remi-php74
sudo yum update

#启用PHP remi-7.4模块后,即可使用以下命令继续并安装PHP。 这还将安装许多其他软件包,例如Apache和Nginx模块

yum -y install php php-cli php-common php-fpm php-mysql php-cgi php-mbstring php-gd php-process php-mcrypt php-soap libjpeg* php-pear php-xml php-devel php-memcached php-redis php-gearman php-pecl-mongodb
yum -y install gearmand libgearman-devel
yum  -y install redis memcached

查看安装版本

php -v

#设置开机启动、运行服务:

systemctl enable php-fpm
systemctl start php-fpm

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值