CentOS7 Apache安装踩坑

Gnome桌面右键弹出终端。

root@localhost \~# yum repolist

已加载插件:fastestmirror, langpacks

/var/run/yum.pid 已被锁定,PID 为 2611 的另一个程序正在运行。

Another app is currently holding the yum lock; waiting for it to exit...

root@localhost \~# yum makecache

已加载插件:fastestmirror, langpacks

Loading mirror speeds from cached hostfile

Could not retrieve mirrorlist http://mirrorlist.centos.org/?

Cannot find a valid baseurl for repo: base/7/x86_64

root@localhost \~# sudo nano /etc/yum.repos.d/CentOS-Base.repo

修改镜像站点为aliyun服务器写入,保存

root@localhost \~# yum makecache

已加载插件:fastestmirror, langpacks

Loading mirror speeds from cached hostfile

元数据缓存已建立

root@localhost \~# yum install httpd

重启

root@localhost \~# systemctl start httpd.service

root@localhost \~# systemctl status httpd.service 查看状态

● httpd.service - The Apache HTTP Server

Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)

root@localhost \~# ifconfig 查看ip地址

ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500

inet 192.168.159.129 netmask 255.255.255.0 broadcast 192.168.159.255

inet6 fe80::2c10:185e:e5c4:821f prefixlen 64 scopeid 0x20<link>

ether 00:0c:29:15:0c:28 txqueuelen 1000 (Ethernet)

RX packets 46624 bytes 69433792 (66.2 MiB)

RX errors 0 dropped 0 overruns 0 frame 0

TX packets 7699 bytes 475065 (463.9 KiB)

TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

相关推荐
apihz16 小时前
全球域名 WHOIS 信息实时查询免费 API 接口教程,支持1000+后缀
android·网络·网络协议·tcp/ip·apache·域名·whois
AOwhisky20 小时前
Linux(CentOS)系统管理入门笔记:第二期核心知识点自测与详解
linux·笔记·centos
二宝哥2 天前
VMware Workstation 实战:CentOS 7.9 安装、桥接网络配置与克隆管理详解
linux·centos·vmware
qetfw2 天前
CentOS 7 搭建 DNS 主从服务
linux·运维·centos·dns·bind
她说..2 天前
Apache Commons Lang3 Pair 完整版实战详解
java·spring·java-ee·apache·springboot
Chengbei112 天前
VMware Workstation Pro 26H1免费虚拟化利器
运维·安全·web安全·自动化·系统安全·apache·安全架构
qetfw3 天前
CentOS 7 基础环境配置
linux·运维·centos
辉灰笔记3 天前
MySQL8 意外关机/误移data目录导致服务启动失败 PID报错/权限报错 修复文档
linux·数据库·mysql·centos
充钱大佬3 天前
Python测试基础教程
python·log4j·apache
SelectDB技术团队4 天前
Agent 场景动态 JSON 性能拆解:Apache Doris 比 ClickHouse 快 7 倍、比 Elasticsearch 快 2 倍
数据库·clickhouse·elasticsearch·json·apache·日志分析·apache doris