第十天
第十天
工作练习题
centos7系统:
1.防火墙关闭命令:
systemctl stop firewalld
systemctl disable firewalld
service iptables stop
chkconfig iptables off
- 查看防火墙服务状态:
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、内存以及磁盘空间资源
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南