1.安装:
基本用法
格式:yum [-y] install 软件名 .. ..
eg:
[[email protected] ~]# yum list httpd //查看是否安装http【这里输入服务名为httpd】
[[email protected] ~]# yum -y install httpd //安装http服务
[[email protected] ~]# yum list httpd //再次查看是否安装成功
删除:
基本用法
格式:yum [-y] remove 软件名 .. ..
eg:
[[email protected] ~]# yum list httpd //查看是否安装http
[[email protected] ~]# yum -y remove httpd //删除http服务
[[email protected] ~]# yum list httpd //查看是否删除
重新安装:
基本用法
格式:yum [-y] reinstall 软件名 .. ..
eg:
[[email protected] ~]# vim /etc/passwd //用vim进入etc下的passwd
[[email protected] ~]# which vim //查看vim的绝对路径
[[email protected] ~]# rm -rf /usr/bin/vim //删除绝对路径
[[email protected] ~]# vim /etc/passwd //再次im进入etc下的passwd
[[email protected] ~]# yum provides /usr/bin/vim //yum创建vim的绝对路径
[[email protected] ~]# yum list vim-enhanced //查看vim-enhanced是否安装
[[email protected] ~]# yum -y reinstall vim-enhanced //用yum重新安装
[[email protected] ~]# vim /etc/passwd //再次查看
快速搭建Web服务器站点
a.安装软件包
[[email protected] ~]# yum repolist //查看yum是否正常存在
[[email protected] ~]# yum list httpd //查看是否安装http服务
[[email protected] ~]# yum -y install httpd //安装http服务
[[email protected] ~]# yum list httpd //查看是否成功
b.新建缺省主页
[[email protected] ~]# vim /var/www/html/index.html //用vim打造网页内容
[[email protected] ~]# cat /var/www/html/index.html //查看网页内容
c.启动服务
[[email protected] ~]# systemctl start httpd //启动httpd服务
[[email protected] ~]# systemctl enable httpd //设置httpd开机自启动
d.测试
[[email protected] ~]# firefox http://127.0.0.1/index.html 其实访问的是服务器上面的/var/www/html/index.html
快速搭建FTP服务器站点【与http服务搭建同理,只是把httpd替换成vsftpd而已】
a.安装软件包
[[email protected] ~]# yum repolist
[[email protected] ~]# yum list vsftpd
[[email protected] ~]# yum -y install vsftpd
[[email protected] ~]# yum list vsftpd
b.修改主配置文件
[[email protected] ~]# useradd vip2018
[[email protected] ~]# passwd vip2018
c.启动服务器
[[email protected] ~]# systemctl start vsftpd
[[email protected] ~]# systemctl enable vsftpd
d.测试
[[email protected] ~]# firefox ftp://127.0.0.1 //默认登录的是/var/ftp
[[email protected] ~]# firefox ftp://[email protected] //登录到/home/vip201
谢谢大家
原文地址:http://blog.51cto.com/13556999/2073237