#1.环境为centos7系统
#2.安装httpd服务
yum -y install http #安装HTTP服务
systemctl start httpd #启动HTTP服务
systemctl enable httpd #开机启动HTTP服务
firewall-cmd --add-service=http --permanent #允许HTTP通过防火墙
firewall-cmd --reload #加载防火墙设置
#3.安装MySQL服务
yum -y install mariadb-server mariadb #安装mysql
systemctl start mariadb #启动MySQL
systemctl enable mariadb #开机启动MySQL
mysql_secure_installation #mariadb默认没密码,设置密码
#4.安装php
yum -y install php php-mysql php-gd php-pear #安装PHP
cat << EOF > /var/www/html/test1php.php
<?php phpinfo(); ?>
EOF
systemctl restart httpd #重新启动HTTP服务
#5.安装PHPmyadmin
yum -y install epel-release
yum makecache
yum -y install phpmyadmin
vi /etc/httpd/conf.d/phpMyAdmin.conf
注释掉:
<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
</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
</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/>
Options none
AllowOverride Limit
Require all granted
</Directory>
修改
vi /etc/phpMyAdmin/config.inc.php
将
"$cfg['Servers'][$i]['auth_type'] = 'cookie'; // Authentication method (config, http or cookie based)?
替换
"$cfg['Servers'][$i]['auth_type'] = 'http'; // Authentication method (config, http or cookie based)?
重启
systemctl restart httpd
访问phpmyadmin
http://XXXXX/phpmyadmin/
输入MySQL username and password
三剑客不熟,没写完,先将就
vi /etc/httpd/conf.d/phpMyAdmin.conf
:11,45s/^#//g
:wq
cat << EOF > /etc/httpd/conf.d/1.conf
<Directory /usr/share/phpMyAdmin/>
Options none
AllowOverride Limit
Require all granted
</Directory>
EOF
cat /etc/httpd/conf.d/1.conf >> /etc/httpd/conf.d/phpMyAdmin.conf
rm -rf /etc/httpd/conf.d/1.conf
sed -i 's/"$cfg['Servers'][$i]['auth_type'] = 'http'; // Authentication method (config, http or cookie based)?"/"$cfg['Servers'][$i]['auth_type'] = 'cookie'; // Authentication method (config, http or cookie based)?"/g' /etc/phpMyAdmin/config.inc.php ##有问题
标签:phpMyadmin,http,httpd,etc,LAMP,cookie,conf,php,图形化 From: https://www.cnblogs.com/SanRiYue/p/16992813.html
例子 :2,5s/^#//g