Apache是世界使用排名第一的Web服务器软件。它可以运行在几乎所有广泛使用的计算机平台上,由于其跨平台和安全性被广泛使用,是最流行的Web服务器端软件之一。它快速、可靠并且可通过简单的API扩充,将Perl/Python等解释器编译到服务器中。
实验环境
[root@desktop ~]# hostnamectl
Static hostname: desktop
Icon name: computer-vm
Chassis: vm
Machine ID: 946cb0e817ea4adb916183df8c4fc817
Boot ID: e757ea01a42a45918fb9c395ab7dadf9
Virtualization: kvm
Operating System: Red Hat Enterprise Linux Server 7.0 (Maipo)
CPE OS Name: cpe:/o:redhat:enterprise_linux:7.0:GA:server
Kernel: Linux 3.10.0-123.el7.x86_64
Architecture: x86_64
安装Apache
[root@desktop ~]# yum install httpd -y ##安装Apache
Loaded plugins: langpacks
Resolving Dependencies
--> Running transaction check
---> Package httpd.x86_64 0:2.4.6-17.el7 will be installed
--> Processing Dependency: httpd-tools = 2.4.6-17.el7 for package: httpd-2.4.6-17.el7.x86_64
………………………………………………………………………………………………………………………………………………………………………………………………………………
Installed:
httpd.x86_64 0:2.4.6-17.el7
Dependency Installed:
apr.x86_64 0:1.4.8-3.el7 apr-util.x86_64 0:1.5.2-6.el7
httpd-tools.x86_64 0:2.4.6-17.el7 mailcap.noarch 0:2.1.41-2.el7
Complete!
[root@desktop ~]# systemctl start httpd ##打开服务
[root@desktop ~]# systemctl enable httpd ##设置开机启动
ln -s '/usr/lib/systemd/system/httpd.service' '/etc/systemd/system/multi-user.target.wants/httpd.service'
[root@desktop ~]# systemctl stop firewalld ##关闭防火墙
[root@desktop ~]# systemctl disable firewalld ##禁止防火墙开机启动
rm '/etc/systemd/system/basic.target.wants/firewalld.service'
rm '/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service'
####因为是