1.软件包管理
linux系统软件包两种形式:①.tar.gz 源码(需编译安装)②rpm: 以二进制形式存在 直接安装
rpm安装指令:rpm源:etc/centos/package
增 安装----> rpm -ivh +软件包 (--force 强制安装) 升级--->rpm -Uvh
网络安装: rpm -ivh +地址
iptables -F = service iptables stop ------->清空防火墙规则
解析域名 1:etc/host 2dns
修改主机名:hostname +主机名 (临时修改) 永久修改---
删 卸载-----> rpm -e (在尾部加--nodeps 无视依赖关系卸载)
查: rpm -q +软件包名(不带扩展名) -qi查看详细信息
查看安装位置--->rpm -ql +安装包位置
信息:软件名+版本号+支持的操作系统+后缀名
yum指令安装:repo文件用于解决安装包之间的关系问题
配置本地yum库:vim/etc/yum.repos.d/local.repo ------->①[local] ②name =local yum ③ baseurl =file://+包路 径 (网络源http://) ④enable =1 ⑤gpgcheck=0------->
安装 --------> yum -y install 不询问安装 执行流程 (/media/centos_6.8_final/repodata---->找到软件包执行安装)
yum -y install *http* 模糊安装(少用 ) yum erase 软件包------>卸载
createrepo /test :在test目录下创建软件依赖性文件
自定义yum源:安装createrepo-->mkdir /test/---->cp 软件包/test----->createrepo /test----->修改 vim/etc/yum.repos.d/local.repos------>baseurl =filee:///test
\mv 无任何提示移动
源码安装:①准备 :yum install gcc-* glibc -# -y + yum groupinstall ' 软件组名'
②解包: tar -xvf
③运行config脚本,添加编译参数 ./config 例如 --prefix 指定安装路径
④编译 make
⑤安装 make install
在环境变量中添加软件安装目录即可在任意位置启动程序--->临时修改
vim /etc/profile 的最后一行配置PATH export PATH
2.ssh服务
配置ssh服务:vim /etc/ssh/sshd_config 重启服务:systemctl restart sshd 开机自启:system enable sshd
如何使连接变快:①vim /etc/hosts 文件中加入自己的ip和主机名 ②vim /etc/ssh/sshd_config中修改usedns=no
远程连接服务 连接失败的原因可能是防火墙未关闭
在虚拟机中ssh 时若端口不对 在ip地址地址后 -p+端口
3.部署服务
①准备环境 关闭防火墙:service iptables stop(chkconfig iptables stop开机关闭防火墙) ---------->关闭selinux: setenforce 0 (vim /etc/sysconfig/selinux修改配置文件设置成diabled )
配置ip
②安装软件包:yum install httpd -y
③修改配置文件:vim /etc/httpd/con/httpd.conf-----listen = documentroot=
④重启服务:sercive httpd restart
echo 'test '>>/var/www/html/index.html
echo 'test'>>/var/www/html/a.txt
⑤测试:打开浏览器 http:// ip:端口/文件