博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Ubuntu 12.04环境下配置Postgresql和phppgadmin
阅读量:4333 次
发布时间:2019-06-07

本文共 2110 字,大约阅读时间需要 7 分钟。

Ubuntu 12.04环境下配置Postgresql 9.1 和phppgadmin

 

 

本系列文章由ex_net(张建波)编写,转载请注明出处。

作者:张建波 邮箱:  电话:13577062679 欢迎来电交流!

 

 

 

一、系统环境准备

         先下载ubuntu 12.04的安装包,这里我用的是64位的系统

        http://mirrors.zju.edu.cn/ubuntu-releases//precise/ubuntu-12.04.3-server-amd64.iso

         一路Next,默认安装即可。 只是配置防火墙的时候注意吧 ssh 、postgresql勾勒!

二、系统配置

       为了方便后面的安装配置,先把root账号启用

 

 

     sudo passwd root   #给root用户设置密码

     设置密码为123456

     su root    #切换到root账户

    

 

    root账户启用后,用ssh远程登录上去配置,这样方便些。毕竟在服务器上操作不是很方便(我们单位有20多台服务器,接在了一个该死的KVM切换器上,由于VGA线路过长(20M),显示器跳的厉害。

推荐用 xshell这个软件进行远程管理

 

三、开始安装软件包

(1)安装postgresql

         apt-get install postgresql

         由于安装Ubuntu时,勾选了postgresql,所以系统提示已经安装了

 

(2)安装php运行环境

        apt-get install apache2

 

        apt-get install php5

 

        apt-get install php5-pgsql

 

        apt-get install php5-gd

 

(3)安装phppgadmin

        apt-get install phppgadmin

 

 四、配置phppgadmin和apache

       phppgadmin安装完毕后,默认的配置文件位于 /etc/phppgadmin 目录下

       

 

       (1)vi /etc/phppgadmin/apache.conf 

      

     #allow from 127.0.0.0/255.0.0.0 ::1/128
      allow from all     取消这行注释,运行所有ip访问

 

 

       (2)vi /etc/phppgadmin/config.inc.php 

 // If extra login security is true, then logins via phpPgAdmin with no
// password or certain usernames (pgsql, postgres, root, administrator)
// will be denied. Only set this false once you have read the FAQ and
// understand how to change PostgreSQL's pg_hba.conf to enable
// passworded local connections.
$conf['extra_login_security'] = false;

 

     (3)重新启动apache2

             /etc/init.d/apache2 restart

 

        打开浏览器输入phppgadmin的网址就可以看到了

 

(4)配置postgresql 账户,不然phppgadmin是无法正常使用的

      postgresql默认安装后,配置文件在 /etc/postgresql/9.1/main 目录下

 

先修改pg_hba.conf 文件

 vi pg_hba.conf 

 

加入: hostallall0.0.0.0 0.0.0.0 md5

允许所有IP通过md5密码验证方式访问

 

修改postgresql.conf 

 vi postgresql.conf 

 

        

listen_addresses = '*'

 

重启数据库,让刚刚修改的配置文件生效

/etc/init.d/postgresql restart

 

给Postgresql的管理员账号 postgres配置密码,以便远程用户可以访问

 

 

  su - postgres

  psql

  ALTER USER postgres PASSWORD '190123';

  \q

  exit

 

五、测试phppgadmin

输入刚刚修改的密码,例如postgres   、190123

 

至此,phpPgadmin安装配置成功了。

 

 

六、顺便推荐一个windows下的客户端

        Windows 7 下面的PostgreSQL客户端管理工具安装

           下载地址:

                         http://www.postgresql.org/ftp/pgadmin3/release/v1.18.1/win32/

 下载完毕后,一路 Next就可以安装完毕了

 

软件装好了,打开如下界面

 

 

 

参考文献:

        http://wiki.ubuntu.org.cn/index.php?title=UbuntuHelp:PhpPgAdmin&redirect=no

转载于:https://www.cnblogs.com/riasky/p/3429111.html

你可能感兴趣的文章
小D课堂-SpringBoot 2.x微信支付在线教育网站项目实战_1-3.在线教育站点需求分析和架构设计...
查看>>
UI基础--烟花动画
查看>>
oracle之三 自动任务调度
查看>>
Android dex分包方案
查看>>
ThreadLocal为什么要用WeakReference
查看>>
删除本地文件
查看>>
FOC实现概述
查看>>
base64编码的图片字节流存入html页面中的显示
查看>>
这个大学时代的博客不在维护了,请移步到我的新博客
查看>>
GUI学习之二十一——QSlider、QScroll、QDial学习总结
查看>>
nginx反向代理docker registry报”blob upload unknown"解决办法
查看>>
gethostbyname与sockaddr_in的完美组合
查看>>
kibana的query string syntax 笔记
查看>>
旋转变换(一)旋转矩阵
查看>>
thinkphp3.2.3 bug集锦
查看>>
[BZOJ 4010] 菜肴制作
查看>>
C# 创建 读取 更新 XML文件
查看>>
KD树
查看>>
VsVim - Shortcut Key (快捷键)
查看>>
HDU5447 Good Numbers
查看>>