第十天

第十天

工作练习题
centos7系统:
1.防火墙关闭命令:

systemctl stop firewalld
systemctl disable firewalld 


service iptables stop
chkconfig iptables off
  1. 查看防火墙服务状态:
systemctl status firewalld
systemctl status iptables

3.临时关闭selinux命令:

setenforce 0

永久关闭selinux方法:

可以编辑/etc/selinux/config

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three two values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected.
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted






SELINUX=disabled


reboot 生效

4 查看默认编码信息:

locale

[root@centos7mage selinux]# locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

5 使用xshell连接服务器,并设置计算机名为master

hostnamectl set-hostname master




[root@centos7mage ~]# hostnamectl set-hostname master
[root@centos7mage ~]# hostname
master

6 源码安装软件
优点:

最新版本:可以获取最新发布的软件版本
自定义编译选项:可以根据自己的需求定制参数,例如开启或关闭特定功能、优化性能等
更强的兼容性:针对特定硬件或操作系统环境编译,提高兼容性和效率
学习过程:有助于深入理解软件的工作原理和结构

缺点:

安装过程复杂:需要手动下载源代码、解压,配置,编译,安装等一系列步骤,相比包管理器安装更繁琐
时间消耗:编译过程可能耗时较长,尤其是大型软件项目
维护困难:后续升级和维护需要重复整个过程,且可能遇到依赖问题
安全风险:未经严格审查的源码可能存在安全隐患,自行编译可能会忽略官方打包过程中的安全措施
资源占用:编译过程中会占用较多cpu、内存以及磁盘空间资源

posted @ 2024-03-09 18:35  三思博客  阅读(3)  评论(0编辑  收藏  举报