centos7 Apache+PHP+Mysql+phpmyadmin 配置phpmyadmin

1、安装Apache
yum install httpd
安装完成之后,启动Apache
systemctl start httpd #启动Apache
systemctl restart httpd #重新启动Apache
systemctl stop httpd #关闭Apache
systemctl enable httpd #设置Apache自动启动
2、开启防火墙,或者开放80端口,或者开放httpd服务
firewall-cmd --add-service=http --permanent
或者自定义端口:
firewall-cmd --zone=public --add-port=81/tcp --permanent
生效之后,重启防火墙
systemctl restart firewalld
3、关闭SELINUX
vi /etc/selinux/config
\#SELINUX=enforcing #注释掉
\#SELINUXTYPE=targeted #注释掉
SELINUX=disabled #增加
4、使配置立即生效
setenforce 0 #使配置立即生效
5、安装mysql,不多讲
6、安装PHP以及PHP扩展所需要的包
yum install php php-mysql php-gd libjpeg* php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-bcmath php-mhash
7、安装完成后,重启Apache服务器
systemctl restart httpd.service
8、测试php安装是否成功
vi /var/www/html/index.php
输入如下:
<?php
  phpinfo();
?>
保存退出,在浏览器上输入服务器IP,会出现内容,即PHP安装成功
9、开始安装phpadmin
首先安装epel-release
yum install epel-release
然后安装phpadmin
yum install phpmyadmin php-mcrypt
10、修改phpadmin配置文件

<Directory /usr/share/phpMyAdmin/> AddDefaultCharset UTF-8 <IfModule mod_authz_core.c> # Apache 2.4 <RequireAny> # Require ip 127.0.0.1 #注释掉 # Require ip ::1 #注释掉 Require all granted #新添加 </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> <Directory /usr/share/phpMyAdmin/setup/> <IfModule mod_authz_core.c> # Apache 2.4 <RequireAny> #Require ip 127.0.0.1 #注释掉 #Require ip ::1 #注释掉 Require all granted #新添加 </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>

大概就是注释掉所有的Require ip 127.0.0.1 和 Require ip ::1
并在注释的最后新增 Require all granted
11、重启Apaech
systemctl restart httpd

 

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值