centos7 下安装apache mysql php phpmyadmin。
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。的更多相关文章
- PHP基础 windows环境下安装Apache Mysql PHP
本篇文章主要是讲一下我自己安装wamp环境的一些步骤和见解,前方多图预警,慎入!!!!! PHP运行环境 : Linux下的三种安装方式:源码包安装.rpm包安装.集成环境安装(lnmp) wind ...
- Centos7 下安装Apache2 + MySQL + PHP7
Apache 1.安装Apache yum install httpd 2.设置服务器开机自动启动Apache systemctl enable httpd.service 若要验证是否自动启动可在重 ...
- 【Linux】Debian 下安装 Apache,MySQL,PHP
首先,对你的源进行更新: $ sudo apt-get update 第一步--安装 Apache Apache 是一个开源软件,它目前运行在全球超过 50% 的服务器上,是 LAMP(Linux,A ...
- centos7下安装apache服务器httpd的yum方式安装
转自Clement-Xu的csdn博客 http://blog.csdn.net/clementad/article/details/41620631 Apache在Linux系统中,其实叫&qu ...
- 转-centos7下安装apache服务器httpd的yum方式安装
转自Clement-Xu的csdn博客 http://blog.csdn.net/clementad/article/details/41620631 Apache在Linux系统中,其实叫“ht ...
- Ubuntu下安装Apache mysql php的命令
sudo apt-get install apache2 php5-mysql libapache2-mod-php5 mysql-serversudo apt-get install php5-gd ...
- Ubuntu 18.04 安装 Apache, MySQL, PHP7, phpMyAdmin
https://blog.csdn.net/sanve/article/details/80770675
- Unbnutu下安装Apache,Mysql,php,phpmyadmin
先写一键部署脚本,肯定是先要知道如何手动安装Apache,Mysql,php,phpmyadmin 一 Apache2的安装 apt install apache2 安装好之后,手动看一下apach ...
- (转载)Linux下安装配置MySQL+Apache+PHP+WordPress的详细笔记
Linux下安装配置MySQL+Apache+PHP+WordPress的详细笔记 Linux下配LMAP环境,花了我好几天的时间.之前没有配置过,网上的安装资料比较混乱,加上我用的版本问题,安装过程 ...
随机推荐
- synchronized 作为悲观锁,锁住了什么?
继续来认识 synchronized,上篇文章加不加 synchronized 有什么区别?我们了解了 synchronized 是在多线程并发竞争同一资源的时候使用,这一篇我们来了解,synchro ...
- TokenMismatchException Laravel
随便写写:很久没写了,今天闲的. 1.错误原因:出现这个错误肯定是因为你在Laravel开启了csrf防御,但是你post提交过去的字段中没有生成_token. 2.如果你提交的字段中带有了_toke ...
- PHP Callable强制指定回调类型的方法
如果一个方法需要接受一个回调方法作为参数,我们可以这样写 <?php function dosth($callback){ call_user_func($callback); } functi ...
- Linux源码安装步骤
来源:https://www.cnblogs.com/benwu/articles/8436209.html 1. 获取源码 2. 查看INSTALL与README文件 (解压后查看INSTAL ...
- 字符串的z型转换
class Solution(object): def convert(self, s, numRows): if numRows==1: return ...
- Ubuntu 安装 Qt, 安装辅助软件
sudo apt-get install libgl1-mesa-dev libglu1-mesa-dev sudo apt-get install gcc g++ sudo apt-get inst ...
- QtConcurrent::run 运行类的成员函数
https://stackoverflow.com/questions/2152355/is-it-possible-to-use-qtconcurrentrun-with-a-function-me ...
- rabbitMQ安装docker版 /权限管理命令
1.进入docker hub镜像仓库地址:https://hub.docker.com/ 2.搜素rabbitMQ 查询镜像,可以看到多种类型,选择带有web页面的(managment) 3.拉取镜像 ...
- 飞机大战-面向对象-pygame
飞机大战 最近学习了python的面向对象,对面向对象的理解不是很深刻. 面向对象是数据和函数的'打包整理',将相关数据和处理数据的方法集中在一个地方,方便使用和管理. 本着学习的目的,在网上找了这个 ...
- JS实现元素的全屏、退出全屏功能
在实际开发中,我们很可能需要实现某一元素的全屏和退出全屏功能,如canvas.所幸的是,js提供了相关api用来处理这一问题,只需简单的调用requestFullScreen.exitFullScr ...