Ubuntu 安装phpMyAdmin + 配置nginx

0x01 安装phpMyAdmin

```
sudo apt-get install phpmyadmin
```

0x02 添加链接

```
sudo ln -s /usr/share/phpMyAdmin /usr/share/nginx/html
```
 

0x03 配置nginx

添加server节点,监听端口8001
 
server {
charset utf-8;
client_max_body_size 128M;
 
listen 8001; ## listen for ipv4
#listen [::]:80 default_server ipv6only=on; ## listen for ipv6
 
server_name phpmyadmin;
root /usr/share/phpmyadmin ;
index index.php;
 
 
location / {
# Redirect everything that isn't a real file to index.php
try_files $uri $uri/ /index.php$is_args$args;
}
 
# uncomment to avoid processing of calls to non-existing static files by Yii
#location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ {
# try_files $uri =404;
#}
#error_page 404 /404.html;
 
# deny accessing php files for the /assets directory
location ~ ^/assets/.*\.php$ {
deny all;
}
 
location ~ \.php$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass 127.0.0.1:9000;
#fastcgi_pass unix:/var/run/php7.2-fpm.sock;
try_files $uri =404;
}
 
location ~* /\. {
deny all;
}

0x04 重启nginx

```
sudo service nginx restart
```
 

0x05 测试

1.访问http://127.0.0.1:8001

 

2.登陆
用户名:root
密码:abc123_

 


作  者: Jackson0714
出  处:http://www.cnblogs.com/jackson0714/
关于作者:专注于微软平台的项目开发。如有问题或建议,请多多赐教!
版权声明:本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文链接。
特此声明:所有评论和私信都会在第一时间回复。也欢迎园子的大大们指正错误,共同进步。或者直接私信
声援博主:如果您觉得文章对您有帮助,可以点击文章右下角推荐一下。您的鼓励是作者坚持原创和持续写作的最大动力!

转载于:https://www.cnblogs.com/jackson0714/p/phpMyAdmin.html

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值