linux apache的 yum安装

得意时要看淡,失意时要看开。不论得意失意,切莫大意;不论成功失败,切莫止步。志得意满时,需要的是淡然,给自己留一条退路;失意落魄时,需要的是泰然,给自己觅一条出路linux apache的 yum安装,希望对大家有帮助,欢迎收藏,转发!站点地址:www.bmabk.com,来源:原文

linux apache的 yum安装
(本人机器 centos 7属于红帽7系列,操作不一样的,自行百度)
本机ip 192.168.1.135
也叫httpd服务

第一步、关闭防火墙和SElinux
简单:
临时关闭防火墙
systemctl stop firewalld
临时关闭SElinux
setenforce 0
第二步,找源
添加阿里云yum源(非必要)
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
linux apache的 yum安装

安装阿里云yum扩展源(非必要)
curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
linux apache的 yum安装
第三步,安装
yum install -y httpd
linux apache的 yum安装
查看端口是否被占用
netstat -tunlp | grep 80
linux apache的 yum安装
(我这里被占用是因为我用了nginx,搜不到就是空的,不用执行杀死进程)
杀死进程
kill -9 pid号 这里我的是49462
linux apache的 yum安装
OK安装成功

启动
systemctl start httpd
重启
systemctl restart httpd
开机启动
systemctl enable httpd
关闭
systemctl stop httpd
apache主配置文件 /etc/httpd/conf/httpd.conf
apache子配置文件/etc/httpd/conf.d/ 下

启动
linux apache的 yum安装
进入分享目录
cd /var/www/html/

linux apache的 yum安装
把百度界面缓存一下
wget www.baidu.com
重启
systemctl restart httpd
在浏览器输入iP地址进入了百度界面
linux apache的 yum安装
当然,打印文字也是可以的
echo “hello world” > /var/www/html/index.html

重启
systemctl restart httpd
在浏览器输入iP地址
linux apache的 yum安装

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。

文章由极客之家整理,本文链接:https://www.bmabk.com/index.php/post/156076.html

(1)
飞熊的头像飞熊bm

相关推荐

发表回复

登录后才能评论
极客之家——专业性很强的中文编程技术网站,欢迎收藏到浏览器,订阅我们!