centos7安装httpd和php
centos7许多命令都变了,又要重新记了。
centos7默认安装了httpd吧?记不清了,看一下:
rpm -qa |grep httpd
没有的话,安装一下吧。
yum -y install httpd
yum -y install php
yum -y install php-gd php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-snmp php-soap curl curl-devel
二、启动httpd服务,并设置成开机启动。
systemctl start httpd.service
systemctl enable httpd.service

ll /etc/systemd/system/multi-user.target.wants/
total 0
lrwxrwxrwx. 1 root root 38 Sep 16 19:08 auditd.service -> /usr
A[Y)I~](ZC9Z[3Y)IDK7LK.gif)
lrwxrwxrwx. 1 root root 44 Sep 16 19:08 avahi-daemon.service -> /usr
A[Y)I~](ZC9Z[3Y)IDK7LK.gif)
lrwxrwxrwx. 1 root root 37 Sep 16 19:08 crond.service -> /usr
A[Y)I~](ZC9Z[3Y)IDK7LK.gif)
lrwxrwxrwx. 1 root root 37 Sep 17 02:38 httpd.service -> /usr
A[Y)I~](ZC9Z[3Y)IDK7LK.gif)

lrwxrwxrwx. 1 root root 42 Sep 16 19:08 irqbalance.service -> /usr
A[Y)I~](ZC9Z[3Y)IDK7LK.gif)
lrwxrwxrwx. 1 root root 37 Sep 16 19:08 kdump.service -> /usr
A[Y)I~](ZC9Z[3Y)IDK7LK.gif)
lrwxrwxrwx. 1 root root 46 Sep 16 19:08 NetworkManager.service -> /usr
A[Y)I~](ZC9Z[3Y)IDK7LK.gif)
lrwxrwxrwx. 1 root root 39 Sep 16 19:08 postfix.service -> /usr
A[Y)I~](ZC9Z[3Y)IDK7LK.gif)
lrwxrwxrwx. 1 root root 40 Sep 16 19:08 remote-fs.target -> /usr
A[Y)I~](ZC9Z[3Y)IDK7LK.gif)
lrwxrwxrwx. 1 root root 39 Sep 16 19:08 rsyslog.service -> /usr
A[Y)I~](ZC9Z[3Y)IDK7LK.gif)
lrwxrwxrwx. 1 root root 36 Sep 16 19:08 sshd.service -> /usr
A[Y)I~](ZC9Z[3Y)IDK7LK.gif)
lrwxrwxrwx. 1 root root 37 Sep 16 19:08 tuned.service -> /usr
A[Y)I~](ZC9Z[3Y)IDK7LK.gif)
<?xml version="1.0" encoding="utf-8"?>
<zone>
<short>Public</short>
<description>For use in public areas. You do not trust the other computers on networks to not harm your computer. Only selected incoming connections are accepted.</description>
<service name="dhcpv6-client"/>
<service name="http"/>
<service name="ssh"/>
<service name="https"/>
</zone>
注意不要将此处firewalld管理的service与systemd中的sevice配置单元混淆,两者没有任何关系。
http服务是安装firewalld时自动安装的,这个服务的配置文件为 /usr
A[Y)I~](ZC9Z[3Y)IDK7LK.gif)


<?xml version="1.0" encoding="utf-8"?>
<service>
<short>WWW (HTTP)</short>
<description>HTTP is the protocol used to serve Web pages. If you plan to make your Web server publicly available, enable this option. This option is not required for viewing pages locally or developing Web pages.</description>
<port protocol="tcp" port="80"/>
<

据此知道http服务对应的就是tcp协议的80端口。firewalld根据zone配置文件中的服务名http,依次在/etc/firwalld

A[Y)I~](ZC9Z[3Y)IDK7LK.gif)


4 与CentOS6.5的区别
总体思路是一致的,都是防火墙放行,把服务加入运行级配置文件。只是CentOS7中防火墙和运行级管理程序均发生彻底改变了。firewalld代替iptables,systemd代替SystemV init,所以需要重新熟悉相关命令。个人感觉新的程序更加人性化,操作也很容易。 配置文件也都采用了标准的xml格式,放弃了容易出错的老式配置文件。
centos7安装httpd和php的更多相关文章
- centos7 安装 httpd并打开测试页
systemctl start firewalld.service#启动firewallsystemctl stop firewalld.service#停止firewallsystemctl dis ...
- centos7 apache httpd安装和配置django项目
一.安装httpd服务 apache在centos7中是Apache HTTP server.如下对httpd的解释就是Apache HTTP Server.所以想安装apache其实是要安装http ...
- Centos7安装Docker 基于Dockerfile 搭建httpd运行环境
Centos7安装Docker 基于Dockerfile 搭建httpd运行环境 docker docker搭建 docker build 本文档完成目标内容如下 使用Docker搭建http服务器一 ...
- CentOS7.3环境下源码安装httpd
CentOS7.3环境下源码安装httpd 本文在CentOS7.3下,源码安装apache服务httpd2.4. 1.下载好源码安装包 [root@localhost ~]#ll total 625 ...
- centos7和centos6安装httpd
编译安装httpd http://apr.apache.org/download.cgi 下载 apr-util-1.6.1.tar.bz2 apr-1.6.5.tar.bz2 http://http ...
- CentOS7安装Apache2.4+PHP5.6
linux系统CentOS7 先下载Apache需要依赖的软件 1.APR 下载地址http://apr.apache.org/download.cgi wget下载路径http://mirror.b ...
- CentOS7安装配置Apache HTTP Server
RPM安装httpd 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 # yum -yinstall http ...
- CentOS7 安装LNMP(Linux+Nginx+MySQL+PHP)
由于工作须要,须要学习php,本来想安装lamp的可是考虑到如今nginxserver有良好的性能且应用广泛. 这里我决定搭建Linux(CentOS7+Nginx+MySQL+PHP)下的webse ...
- Centos7安装jexus,部署asp.net core,asp.net mvc
什么是Jexus 官网解释:https://www.jexus.org/ Jexus是一款Linux平台上的高性能WEB服务器和负载均衡网关,Jexus Web Service,简称JWS,以支持AS ...
随机推荐
- [读书系列] 深度探索C++对象模型 初读
2012年底-2014年初这段时间主要用C++做手游开发,时隔3年,重新拿起<深度探索C++对象模型>这本书,感觉生疏了很多,如果按前阵子的生疏度来说,现在不借助Visual Studio ...
- [编织消息框架][设计协议]opCode
OpCode的全称 OpCode(Operation Code) 操作码的意思. OpCode 有几种域组成,不同领域格式组成不同 1.指令号 2.数据范围 3.数据内容 如 {code}{addr ...
- 持续集成接口自动化-jmeter+ant+jenkins(一)
ant 批量执行Jmeter 一.环境准备 1.JDK环境:http://www.oracle.com/technetwork/java/javase/downloads/index.html 2.A ...
- android-自定义广告轮播Banner(无限循环实现)
关于广告轮播,大家肯定不会陌生,它在现手机市场各大APP出现的频率极高,它的优点在于"不占屏",可以仅用小小的固定空位来展示几个甚至几十个广告条,而且动态效果很好,具有很好的用户& ...
- ISO c++ 14 重点介绍[译]
原文链接 http://marknelson.us/2014/09/11/highlights-of-iso-c14/ 下面是对你的日常开发有重大影响的C++14新变动,列出了一些示例代码,并讨论何时 ...
- java操作txt文本(二):删除文本括号内的内容
想法由来:之前写读书报告时,遇到一些烦人的文献,总喜欢把注释作为括号内容放到正文中,使文章繁琐冗长,所以写了下面这个代码,剔除了括号内的内容. 适用条件:原txt文本中的括号使用正确,即左右括号匹配正 ...
- java学习笔记----运算符
一.算数运算符 特别说明: 加 ,减 ,乘 ,除 与数学运算一致 取余符号看被除数 自加(减)运算:++a,--a;先做自加(自减)运算在做其他运算 a++,a--;先做其他运算在做自加(自减)运算 ...
- 学习手机端的META差异,打造自己的移动网页
我们先来简单了解下meta标签:meta指元素可提供有关页面的元信息(meta-information),比如针对搜索引擎和更新频度的描述和关键词. 标签位于文档的头部,不包含任何内容. 标签的属性定 ...
- linux之date命令详解
date命令的用处 1.用于显示特殊的时间格式,可以用于对日志文件的命名 2.用于设置时间 ,不过这方面用的比较少,因为一般的服务器都设置的有自动同步网络时间 用法: date [OPTION]... ...
- 解决Appium 抓取toast
首先我们先看看这个gif,图中需要,要抓取的字符串--->请输入转让份数 1.要导入java-client-5.0.0-SNAPSHOT.jar 包的地址:链接:http://pan.baidu ...