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; 这段,

http {
include mime.types;
default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"'; access_log logs/access.log main; sendfile on;
#tcp_nopush on; #keepalive_timeout ;
keepalive_timeout ; gzip on;
include /usr/local/nginx/conf.d/*.conf;

新建conf.d文件夹

新建phpmyadmin.conf如下

server {
listen ;
server_name localhost;
access_log /usr/local/nginx/phpmyadmin-access.log main; location / {
root /usr/local/phpMyAdmin;
index index.php;
} location ~ \.php$ {
root /usr/local/phpMyAdmin;
fastcgi_pass 127.0.0.1:;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
} location ~ /\.ht {
deny all;
}
}

4,config.inc.php修改为:

 * This is needed for cookie based authentication to encrypt password in
* cookie
*/
$cfg['blowfish_secret'] = '123456'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */ /*
* Servers configuration
*/
$i = 0; /*
* First server
*/
$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'config';
/* Server parameters */
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = true; /*
* phpMyAdmin configuration storage settings.
*/ /* User used to manipulate with storage */
// $cfg['Servers'][$i]['controlhost'] = '';
// $cfg['Servers'][$i]['controlport'] = '';
$cfg['Servers'][$i]['controluser'] = 'root';
$cfg['Servers'][$i]['controlpass'] = ''; /* Storage database and tables */
// $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
// $cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark';
// $cfg['Servers'][$i]['relation'] = 'pma__relation';
// $cfg['Servers'][$i]['table_info'] = 'pma__table_info';
// $cfg['Servers'][$i]['table_coords'] = 'pma__table_coords';
// $cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages';
// $cfg['Servers'][$i]['column_info'] = 'pma__column_info';
// $cfg['Servers'][$i]['history'] = 'pma__history';
// $cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs';
// $cfg['Servers'][$i]['tracking'] = 'pma__tracking';
// $cfg['Servers'][$i]['designer_coords'] = 'pma__designer_coords';
// $cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';
// $cfg['Servers'][$i]['recent'] = 'pma__recent';
// $cfg['Servers'][$i]['favorite'] = 'pma__favorite';
$cfg['Servers'][$i]['users'] = 'root';
$cfg['Servers'][$i]['password'] = '';
// $cfg['Servers'][$i]['usergroups'] = 'pma__usergroups';
// $cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding';
// $cfg['Servers'][$i]['savedsearches'] = 'pma__savedsearches';
/* Contrib / Swekey authentication */
// $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. DP入门水题集

    HDU 1087 Input contains multiple test cases. Each test case is described in a line as follow:N value ...

  2. ADC配置成定时器触发的启发

    百度文库:https://wenku.baidu.com/view/99d39413f78a6529647d5344.html STM32关于使用定时器触发ADC转换的解决办法和详细说明 本人在使用S ...

  3. guxh的python笔记四:迭代

    1,可迭代对象iterable,迭代器iterator,生成器generator 可迭代对象iterable: 实现__iter__方法的类.__iter__方法返回iterator或者generat ...

  4. spring cloud 下载依赖慢解决方案

    可以在修改pom文件添加如下代码: <repositories> <repository> <id>spring-snapshots</id> < ...

  5. [hdu P3085] Nightmare Ⅱ

    [hdu P3085] Nightmare Ⅱ Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Oth ...

  6. Android设备终端监控可能用到的工具

    先记录工具,以后详细分析 add-property-tagcheck-lost+foundcpueatercpustatsdaemonizedexdumpdirectiotestfiokexecloa ...

  7. 用python处理html代码的转义与还原

    用python处理html代码的转义与还原   转义 escape: import cgi s = cgi.escape("""& < >" ...

  8. 一次完整的http事务的过程

    1.域名解析 2.发起TCP三次握手 3.建立TCP连接以后发起http请求 4.服务器端响应请求,浏览器得到html代码 5.浏览器解析html代码并请求html中的资源 6.浏览器对页面进行渲染呈 ...

  9. [Codeforces441E]Valera and Number

    Problem 给定一个数x,有p%的概率乘2,有1-p%的概率加1,问操作k次,其二进制数下末尾零的个数的期望. Solution 每次操作只会影响到最后的8位 我们用dp[i][j]表示i个操作后 ...

  10. windows下安装rabbitmq的步骤详解

    (仅作为个人的备忘记录) Rabbit MQ 是建立在强大的Erlang OTP平台上,因此安装Rabbit MQ的前提是安装Erlang.通过下面两个连接可以下载安装最新的版本: 下载并安装Eral ...