CentOS 安装lamp和phpmyadmin

隐身守侯 提交于 2021-02-06 10:29:26

建立自启动脚本:

从网站下载安装包:https://bitnami.com/stack/lamp

chmod 755 bitnami-APPNAME-VERSION-linux.run
./bitnami-APPNAME-VERSION-linux.run

修改mysql绑定的127.0.0.1。

cd /opt/lampstack/mysql
vi my.cnf

注释bind-address = 127.0.0.1


[mysqladmin]
user=root

[mysqld]
basedir=/opt/lampstack/mysql
datadir="/opt/lampstack/mysql/data"
port=3306
socket=/opt/lampstack/mysql/tmp/mysql.sock
tmpdir=/opt/lampstack/mysql/tmp
max_allowed_packet=32M
#bind-address=127.0.0.1
skip-name-resolve=1

character-set-server=UTF8
collation-server=utf8_general_ci
[client]
port=3306
socket=/opt/lampstack/mysql/tmp/mysql.sock

default-character-set=UTF8
[manager]
port=3306
socket=/opt/lampstack/mysql/tmp/mysql.sock
pid-file=/opt/lampstack/mysql/tmp/manager.pid
default-mysqld-path=/opt/lampstack/mysql/bin/mysqld.bin

激活phpmyadmin

Connect To PhpMyAdmin

修改配置文件:/opt/bitnami/apps/phpmyadmin/conf/httpd-app.conf

<Directory "/opt/bitnami/apps/phpmyadmin/htdocs">
# AuthType Basic
# AuthName phpMyAdmin
# AuthUserFile "/opt/bitnami/apache2/users"
# Require valid-user
AllowOverride None

<IfModule php5_module>
        php_value upload_max_filesize 80M
php_value post_max_size 80M
</IfModule>

<IfVersion < 2.3 >
Order allow,deny
Allow from all
Satisfy all
</IfVersion>
<IfVersion >= 2.3>
Require all granted
</IfVersion>
ErrorDocument 403 "For security reasons, this URL is only accesible using localhost (127.0.0.1) as the hostname"
</Directory>

 

 

 

 

-------------------------------------------------------作废

安装phpmyadmin(作废~)

下载并解压,将phpmyadmin移到/opt/lampstack/apache2/htdocs目录下。

mv phpMyAdmin /opt/lampstack/apache2/htdocs/

更新权限

chown root:daemon phpMyAdmin/ -R

在/opt/lampstack/apache2/htdocs/phpMyAdmin目录中新建文件夹tmp(或同上更新权限)。

cd /opt/lampstack/apache2/htdocs/phpMyAdmin/
mkdir -m 777 ./tmp

 

 

 

 

 

 

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!