1,解压缩phpmyadmin4.2.8压缩包到/usr/local/phpMyAdmin

2,复制config.sample.inc.php为config.inc.php

3,修改nginx.conf 里

加入 include /usr/local/nginx/conf.d/*.conf; 这段,

  1. http {
  2. include mime.types;
  3. default_type application/octet-stream;
  4.  
  5. log_format main '$remote_addr - $remote_user [$time_local] "$request" '
  6. '$status $body_bytes_sent "$http_referer" '
  7. '"$http_user_agent" "$http_x_forwarded_for"';
  8.  
  9. access_log logs/access.log main;
  10.  
  11. sendfile on;
  12. #tcp_nopush on;
  13.  
  14. #keepalive_timeout ;
  15. keepalive_timeout ;
  16.  
  17. gzip on;
  18. include /usr/local/nginx/conf.d/*.conf;

新建conf.d文件夹

新建phpmyadmin.conf如下

  1. server {
  2. listen ;
  3. server_name localhost;
  4. access_log /usr/local/nginx/phpmyadmin-access.log main;
  5.  
  6. location / {
  7. root /usr/local/phpMyAdmin;
  8. index index.php;
  9. }
  10.  
  11. location ~ \.php$ {
  12. root /usr/local/phpMyAdmin;
  13. fastcgi_pass 127.0.0.1:;
  14. fastcgi_index index.php;
  15. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  16. include fastcgi_params;
  17. }
  18.  
  19. location ~ /\.ht {
  20. deny all;
  21. }
  22. }

4,config.inc.php修改为:

  1. * This is needed for cookie based authentication to encrypt password in
  2. * cookie
  3. */
  4. $cfg['blowfish_secret'] = '123456'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
  5.  
  6. /*
  7. * Servers configuration
  8. */
  9. $i = 0;
  10.  
  11. /*
  12. * First server
  13. */
  14. $i++;
  15. /* Authentication type */
  16. $cfg['Servers'][$i]['auth_type'] = 'config';
  17. /* Server parameters */
  18. $cfg['Servers'][$i]['host'] = '127.0.0.1';
  19. $cfg['Servers'][$i]['connect_type'] = 'tcp';
  20. $cfg['Servers'][$i]['compress'] = false;
  21. $cfg['Servers'][$i]['AllowNoPassword'] = true;
  22.  
  23. /*
  24. * phpMyAdmin configuration storage settings.
  25. */
  26.  
  27. /* User used to manipulate with storage */
  28. // $cfg['Servers'][$i]['controlhost'] = '';
  29. // $cfg['Servers'][$i]['controlport'] = '';
  30. $cfg['Servers'][$i]['controluser'] = 'root';
  31. $cfg['Servers'][$i]['controlpass'] = '';
  32.  
  33. /* Storage database and tables */
  34. // $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
  35. // $cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark';
  36. // $cfg['Servers'][$i]['relation'] = 'pma__relation';
  37. // $cfg['Servers'][$i]['table_info'] = 'pma__table_info';
  38. // $cfg['Servers'][$i]['table_coords'] = 'pma__table_coords';
  39. // $cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages';
  40. // $cfg['Servers'][$i]['column_info'] = 'pma__column_info';
  41. // $cfg['Servers'][$i]['history'] = 'pma__history';
  42. // $cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs';
  43. // $cfg['Servers'][$i]['tracking'] = 'pma__tracking';
  44. // $cfg['Servers'][$i]['designer_coords'] = 'pma__designer_coords';
  45. // $cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';
  46. // $cfg['Servers'][$i]['recent'] = 'pma__recent';
  47. // $cfg['Servers'][$i]['favorite'] = 'pma__favorite';
  48. $cfg['Servers'][$i]['users'] = 'root';
  49. $cfg['Servers'][$i]['password'] = '';
  50. // $cfg['Servers'][$i]['usergroups'] = 'pma__usergroups';
  51. // $cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding';
  52. // $cfg['Servers'][$i]['savedsearches'] = 'pma__savedsearches';
  53. /* Contrib / Swekey authentication */
  54. // $cfg['Servers'][$i]['auth_swekey_config'] = '/etc/swekey-pma.conf';

  

phpmyadmin nginx设置的更多相关文章

  1. Nginx设置alias别名目录访问phpmyadmin

    引言:Nginx服务器通过设置alias别名可以使特定的目录(phpmyadmin目录)不出现在网站根目录下面,即使网站根目录被攻破,也不会影响到phpmyadmin目录里面的文件. 说明: 站点:h ...

  2. Nginx设置alias实现虚拟目录 alias与root的用法区别

    Nginx 貌似没有虚拟目录的说法,因为它本来就是完完全全根据目录来设计并工作的.如果非要给nginx安上一个虚拟目录的说法,那就只有alias标签比较"像",干脆来说说alias ...

  3. Nginx设置线程数为整机内核数的俩倍!

    Nginx设置线程数为整机内核数的俩倍!

  4. nginx设置不使用缓存 add_header Cache-Control no-cache

    nginx设置不使用缓存 server { listen 443; #域名 server_name www.dev.163.com; #字符集 charset utf-8; ssl on; ssl_c ...

  5. nginx设置SSL反向代理

    Nginx的反向代理通常用来映射内网中提供的Apache.IIS.Lighttpd服务,以实现负载均衡:同时,由于动态服务程序运行在内网,服务器的整体安全性也有所提高,那么怎样用nginx设置SSL的 ...

  6. nginx 设置进程title

    刚好看到nginx设置进程title的源码,因此做一些总结. linux进程实际是以argv[0]处的值来作为进程的title的,因此若需要修改进程的title只需要修改argv[0]处的值即可. 简 ...

  7. Nginx设置Https反向代理,指向Docker Gitlab11.3.9 Https服务

    目录 目录 1.GitLab11.3.9的安装 2.域名在阿里云托管,申请免费的1年证书 3.Gitlab 的 https 配置 4.Nginx 配置 https,反向代理指向 Gitlab 配置 目 ...

  8. Nginx设置网站维护页面

    网站升级需要停服,可以在Nginx设置静态页面设置强制跳转 修改nginx配置文件nginx.conf http { sendfile on; keepalive_timeout 65; server ...

  9. Nginx 设置临时维护页面

    Nginx 设置临时维护页面 http://www.myexception.cn/open-source/1753957.html http://blog.justwd.net/snippets/ng ...

随机推荐

  1. Win10系统截屏快捷键

    截全屏 win+prt scsysrq 图片位置:C:\Users\ASUS\Pictures\Screenshots     此电脑/图片/屏幕截图 截当前活动窗口 alt+prt scsysrq ...

  2. https://localhost:1158/em运行不正常

    1.页面无法打开 一般是由于网站安全问题直接挂掉,可以更换浏览器,如Google Chrome.Fire Fox等.不建议使用IE Google浏览器使用如下, 直接继续 接着以用户sys,密码cha ...

  3. mysql utf8mb4 设置

    [mysqld]collation-server=utf8mb4_general_ciinit-connect='SET NAMES utf8mb4'character-set-server=utf8 ...

  4. 使用Rancher和私有仓库快速搭建Kubernetes集群

    来来来,先出题:Rancher可以快速部署Kubernetes,但其使用的gcr.io上的镜像无法下载怎么办?使用Rancher可以快速部署Kubernetes,但我们需要下载哪些镜像?Rancher ...

  5. Android View 阴影的总结

    关于 Android 阴影,大家肯定不陌生的.但是Android 中到底有多少种方式可以实现阴影效果以及各种方式之间有什么区别和优缺点,这就是我想总结的.下面我们一个一个来说: 一.各种实现阴影的方式 ...

  6. Vmware ESXi 的虚拟机的开机自启动

    ESXi 6.7 以前就注意到虚拟机有个菜单[action->autostart]可以用来自启动(物理机开机之后), 可是设置完之后,总是没成功. 今天重新google了,发觉不但虚拟机,整个物 ...

  7. [Hibernate] inner Join和 left Join

    @Test public void test11(){ Session ss=HibernateUtil.getSession(); //根据员工名称(SCOTT)找到和他所在的部门的其他员工的信息 ...

  8. VS Code 安装sass插件

    准备工作 在VS Code上新建一个项目,例:SASS  ,文件夹内包括css 和 sass 和 html  文件夹   在sass文件下新新建sass.scss 1.在拓展商店里搜索“easy sa ...

  9. php 安装 redis扩展

    https://segmentfault.com/a/1190000009422920 wget 源码编译

  10. Linux磁盘挂载

            mount命令 用于加载文件系统到指定的加载点.此命令的最常用于挂载cdrom,使我们可以访问cdrom中的数据,因为你将光盘插入cdrom中,Linux并不会自动挂载,必须使用Lin ...