软件包分类
- 源码包
- 二进制包(RPM包)
RPM 软件包管理
例如:RedHat、CentOS
- 路径 /var/lib/rpm
命令
- rpm -ivh 包全名 (install verbose hash) ->安装
- rpm -qi 包名 -qip 未安装包名 ->查信息
- rpm -ql 包名 ->查包的安装路径文件
- rpm -qf 文件名 ->查文件所在包
有依赖性问题
YUM
- yum -y install 名称/路径
- yum -y update/remove 名称 (慎用)
yum list/grouplist
自动联网下载解决依赖性问题
配置静态IP
对应模式
- 桥接模式 -> 本机网卡 (10.20.61.12)
- NAT模式 -> VMnet8 (192.168.112.1)
仅主机模式 -> VMnet1 (192.168.18.1)
ip设置必须和对应模式的网卡的ip网段相符合
配置
vim /etc/sysconfig/network-script/ifcfg-eth0
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.112.138
NETMASK=255.255.255.0
GATEWAY=192.168.112.2(查看:虚拟机-编辑-虚拟网络编辑器-选中NAT模式的网卡-NAT设置-网关IP)
DNS1=8.8.8.8
Apache服务器
- 安装 rpm -ivh httpd-2.2.15-29.el6.centos.x86_64.rpm
- 开启服务 service httpd start
- 浏览器访问 192.168.112.138 (显示默认页面)
- 创建页面 /var/www/html/index.html 编辑内容
再次访问 192.168.112.138/index.html
关闭防火墙后,其他机器才能访问 service iptables stop
或者 在防火墙开启80端口 vim /etc/sysconfig/iptables
压缩/解压
当前目录 /home/jhz/桌面, 存在 hello/1.txt hello/2.txt
- tar -zcvf hello.tar.gz hello/ 压缩
- tar -jcvf hello.tar.bz2 hello/
- tar -xvf hello.tar.gz 解压
- zip -d hello.zip hello/
- unzip hello.zip