记录供查阅
1 安装httpd软件包
yum install httpd
针对CentOS7,httpd有专门的版本,此版本提供了针对systemd的单元文件,如下所示
-bash-4.2# rpm -ql httpd | grep service
/usr/lib/systemd/system/htcacheclean.service
/usr/lib/systemd/system/httpd.service
2 启动httpd服务并把此服务单元加入当前运行级
systemctl start httpd.service
systemctl enable httpd
此时,这个配置文件被链接到了/etc/systemd/system/multi-user.target.wants/httpd.service,如下图
-bash-4.2# ll /etc/systemd/system/multi-user.target.wants/
total 0
lrwxrwxrwx. 1 root root 38 Sep 16 19:08 auditd.service -> /usr/lib/systemd/system/auditd.service
lrwxrwxrwx. 1 root root 44 Sep 16 19:08 avahi-daemon.service -> /usr/lib/systemd/system/avahi-daemon.service
lrwxrwxrwx. 1 root root 37 Sep 16 19:08 crond.service -> /usr/lib/systemd/system/crond.service
lrwxrwxrwx. 1 root root 37 Sep 17 02:38 httpd.service -> /

本文详细介绍了在CentOS7最小化安装后,如何安装httpd软件包,启动并设置httpd服务为开机启动,以及如何在firewalld防火墙中开启80端口。此外,对比了与CentOS6.5的区别,指出在CentOS7中firewalld替代iptables,systemd取代SystemV init,并强调新系统的配置文件采用XML格式,提高了易用性。

707

被折叠的 条评论
为什么被折叠?



