1 安装mysql

yum -y install mariadb-server

systemctl start mariadb.service

systemctl enable mariadb.service

mysql_secure_installation 

  默认安装的是5.5.40-MariaDB ,个人喜欢的版本,不再是5.1的那个了。

  

2 安装apache

 

yum install -y httpd
systemctl start httpd.service
systemctl enable httpd.service

apache 版本为 2.4.6

3 .安装php

yum -y install php
systemctl restart httpd.service

  php5.4

4.安装phpmyadmin

这里直接用 yum install phpmyadmin  ,前提是epel 源已经被配置好了。

/etc/httpd/conf.d 下多了一个  phpMyAdmin.conf 的配置文件。

这里多了一个访问控制

<Directory /usr/share/phpMyAdmin/>
AddDefaultCharset UTF-8

<IfModule mod_authz_core.c>
# Apache 2.4
<RequireAny>
Require ip 114.88.5.47
Require ip 127.0.0.1
Require ip ::1
</RequireAny>
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
Order Deny,Allow
Deny from All
Allow from 127.0.0.1
Allow from ::1
</IfModule>
</Directory>

  也可以看出来,httpd 2.2和2.4是不同的。

5. 其他

其实安装和centos6的版本没啥区别。做了一些软件的升级,但是在启动上面,废弃了原先的/etc/init.d 下面的bash 脚本。而是用了systemctl 这个命令。

相关文件都在 /usr/lib/systemd/system 下面了。看了一下,比之前的bash 脚本简单好多。比如httpd的systemctl文件  

cat /usr/lib/systemd/system/httpd.service
[Unit]
Description=The Apache HTTP Server
After=network.target remote-fs.target nss-lookup.target [Service]
Type=notify
EnvironmentFile=/etc/sysconfig/httpd
ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND
ExecReload=/usr/sbin/httpd $OPTIONS -k graceful
ExecStop=/bin/kill -WINCH ${MAINPID}
# We want systemd to give httpd some time to finish gracefully, but still want
# it to kill httpd after TimeoutStopSec if something went wrong during the
# graceful stop. Normally, Systemd sends SIGTERM signal right after the
# ExecStop, which would kill httpd. We are sending useless SIGCONT here to give
# httpd time to finish.
KillSignal=SIGCONT
PrivateTmp=true [Install]
WantedBy=multi-user.target

  还是之前的chkconfig  ,也集成在systemctl中了。 很简洁 systemctl enable  httpd

systemctl enable  httpd
ln -s '/usr/lib/systemd/system/httpd.service' '/etc/systemd/system/multi-user.target.wants/httpd.service'

  

  做的操作其实是一个软连接。很直观。操作什么直接反馈回来了。

[root@iZ23f0gpuenZ _local]# systemctl status  httpd
httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled)
Active: inactive (dead) Dec 14 04:19:54 iZ23f0gpuenZ systemd[1]: Reloaded The Apache HTTP Server.
Dec 14 14:49:32 iZ23f0gpuenZ systemd[1]: Stopping The Apache HTTP Server...
Dec 14 14:49:34 iZ23f0gpuenZ systemd[1]: Starting The Apache HTTP Server...
Dec 14 14:49:34 iZ23f0gpuenZ httpd[14550]: AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 10.168.19...s message
Dec 14 14:49:34 iZ23f0gpuenZ systemd[1]: Started The Apache HTTP Server.
Dec 14 14:50:23 iZ23f0gpuenZ systemd[1]: Stopping The Apache HTTP Server...
Dec 14 14:50:24 iZ23f0gpuenZ systemd[1]: Starting The Apache HTTP Server...
Dec 14 14:50:24 iZ23f0gpuenZ httpd[14681]: AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 10.168.19...s message
Dec 14 14:50:24 iZ23f0gpuenZ systemd[1]: Started The Apache HTTP Server.
Dec 14 15:37:49 iZ23f0gpuenZ systemd[1]: Stopping The Apache HTTP Server...
Dec 14 15:37:50 iZ23f0gpuenZ systemd[1]: Stopped The Apache HTTP Server.
Hint: Some lines were ellipsized, use -l to show in full.

  status 也做的很hi ,什么时候操作过httpd 的服务也一目了然。

  centos 7 还做了进一步的升级,比如说加入了firewall ,内置了git 等,做了很实用的升级。更多功能正在摸索中。

centos7 下安装apache mysql php phpmyadmin。的更多相关文章

  1. PHP基础 windows环境下安装Apache Mysql PHP

    本篇文章主要是讲一下我自己安装wamp环境的一些步骤和见解,前方多图预警,慎入!!!!! PHP运行环境  : Linux下的三种安装方式:源码包安装.rpm包安装.集成环境安装(lnmp) wind ...

  2. Centos7 下安装Apache2 + MySQL + PHP7

    Apache 1.安装Apache yum install httpd 2.设置服务器开机自动启动Apache systemctl enable httpd.service 若要验证是否自动启动可在重 ...

  3. 【Linux】Debian 下安装 Apache,MySQL,PHP

    首先,对你的源进行更新: $ sudo apt-get update 第一步--安装 Apache Apache 是一个开源软件,它目前运行在全球超过 50% 的服务器上,是 LAMP(Linux,A ...

  4. centos7下安装apache服务器httpd的yum方式安装

    转自Clement-Xu的csdn博客 http://blog.csdn.net/clementad/article/details/41620631   Apache在Linux系统中,其实叫&qu ...

  5. 转-centos7下安装apache服务器httpd的yum方式安装

    转自Clement-Xu的csdn博客 http://blog.csdn.net/clementad/article/details/41620631   Apache在Linux系统中,其实叫“ht ...

  6. Ubuntu下安装Apache mysql php的命令

    sudo apt-get install apache2 php5-mysql libapache2-mod-php5 mysql-serversudo apt-get install php5-gd ...

  7. Ubuntu 18.04 安装 Apache, MySQL, PHP7, phpMyAdmin

    https://blog.csdn.net/sanve/article/details/80770675

  8. Unbnutu下安装Apache,Mysql,php,phpmyadmin

    先写一键部署脚本,肯定是先要知道如何手动安装Apache,Mysql,php,phpmyadmin 一  Apache2的安装 apt install apache2 安装好之后,手动看一下apach ...

  9. (转载)Linux下安装配置MySQL+Apache+PHP+WordPress的详细笔记

    Linux下安装配置MySQL+Apache+PHP+WordPress的详细笔记 Linux下配LMAP环境,花了我好几天的时间.之前没有配置过,网上的安装资料比较混乱,加上我用的版本问题,安装过程 ...

随机推荐

  1. 关于Google下插件SwitchyOmega用法

    开启代理后,尽管访问很自由了,但是我的搬瓦工,是有流量限制的.所以,在之前,我开启一会自由访问模式(戏称),然后关一会,用来方便打开国内网站. 是的,我这么坚持了半个月,之后,就崩溃了,太尼玛繁琐了! ...

  2. 使用 Python 控制自己的电脑和键盘是一种什么样的体验?python学习的正确姿势

    可能有时候你需要在电脑做一些重复的点击或者提交表单等操作,如果能通过 Python 预先写好相关的操作指令,让它帮你操作,然后你自己爱干嘛干嘛去,有点 “按键精灵” 的意思,是不是感觉有点爽呢? 那么 ...

  3. MySQL基础知识和常用命令总结

    说明:以下内容是阅读书籍<<MySQL必知必会>>的摘要和总结 检索数据 排序检索数据 过滤数据 使用通配符过滤 使用正则表达式进行搜索 创建计算字段 使用数据处理函数 汇总数 ...

  4. php 超全局变量(整理)

    来源:https://www.cnblogs.com/wsybky/p/8745286.html 一.$GLOBALS 在GLOBALS数组中,每一个变量为一个元素,键名对于变量名,值对于变量的内. ...

  5. 20199326《Linux内核原理与分析》第十二周作业

    Collabtive系统跨站请求伪造攻击实验 实验背景 CSRF(Cross-site request forgery),中文名称:跨站请求伪造,也被称为:one click attack/sessi ...

  6. BareTail 观看文件增加的工具

  7. ELK6.3版本安装部署

    一.Elasticsearch 安装 1.部署系统以及环境准备 cat /etc/redhat-release CentOS Linux release 7.4.1708 (Core) uname - ...

  8. Handler 机制(一)—— Handler的实现流程

    由于Android采用的是单线程模式,开发者无法在子线程中更新 UI,所以系统给我提供了 Handler 这个类来实现 UI 更新问题.本贴主要说明 Handler 的工作流程. 1. Handler ...

  9. Android Room SQLite持久层框架

    原文链接 前言 Android中提供了SQLite数据库进行数据的持久化 ,并提供了对应API访问数据库,而Room框架提供了SQLite数据访问抽象层,为高效的数据库访问层带来便捷 APP可以缓存用 ...

  10. python 遍历, 获取目录下所有文件名和文件夹的方法-----os.walk(), os.listdir

    http://www.runoob.com/python/os-walk.html https://www.cnblogs.com/dreamer-fish/p/3820625.html 转载于:ht ...