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\ 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\ 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

相关推荐
a413244719 分钟前
在CentOS系统上挂载硬盘到ESXi虚拟机
linux·运维·centos
BIBI20491 小时前
通过 Studio 3T 远程连接 CentOS 7 上的 MongoDB
linux·mongodb·centos·nosql·配置·问题解决·环境搭建
温暖小土1 小时前
ClickHouse vs Apache Doris:2026年实时OLAP数据库选型深度解析
数据库·数据仓库·clickhouse·apache
Lam㊣3 小时前
CentOS7升级OpenSSL版本
centos
橙子❦3 小时前
官网下载docker--centos容器,后安装并启动容器
docker·容器·centos
小当家.1054 小时前
《Java操作Excel实战教程:Apache POI从入门到精通》
java·apache·excel
六月生花4 小时前
LNMP(centos 9)
linux·运维·centos
Gobysec5 小时前
Goby 漏洞安全通告|Apache Struts XWork 组件 XML外部实体注入漏洞(CVE-2025-68493)
struts·安全·apache
坚持学习前端日记6 小时前
学校管理系统 ER图
java·运维·服务器·mysql·apache
不染尘.6 小时前
Linux进程与服务管理
linux·运维·服务器·windows·centos·ssh