markdown 如何在CentOS 7上安装Apache

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown 如何在CentOS 7上安装Apache相关的知识,希望对你有一定的参考价值。

Install Apache:
First, clean-up yum:

- sudo yum clean all

As a matter of best practice we’ll update our packages:
- sudo yum -y update

Installing Apache is as simple as running just one command:
- sudo yum -y install httpd

Allow Apache Through the Firewall
Allow the default HTTP and HTTPS port, ports 80 and 443, through firewalld:
- sudo firewall-cmd --permanent --add-port=80/tcp
- sudo firewall-cmd --permanent --add-port=443/tcp
 Или если используется iptables вместо firewalld, то вот iptables -I INPUT -p tcp --destination-port 80 -j ACCEPT
/sbin/service iptables save 


And reload the firewall:
- sudo firewall-cmd --reload

Configure Apache to Start on Boot
And then start Apache:
- sudo systemctl start httpd

Be sure that Apache starts at boot:
- sudo systemctl enable httpd

Other useful commands for Apache
To check the status of Apache:
- sudo systemctl status httpd

To stop Apache:
- sudo systemctl stop httpd

以上是关于markdown 如何在CentOS 7上安装Apache的主要内容,如果未能解决你的问题,请参考以下文章

markdown Zabbix 3使用PostgreSQL 9.5在CEntOS 7上安装

markdown 用于在Centos 7上创建VSI和安装Docker Engine的Terraform示例文件

CentOS 7上安装Zabbix(高速安装监控工具Zabbix)

markdown PHP安装CentOS 7

CentOS 7上安装Zabbix(快速安装监控工具Zabbix)

markdown 在Centos 7上部署节点