Recent Comments

This is default featured slide 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

顯示具有 centos6 標籤的文章。 顯示所有文章
顯示具有 centos6 標籤的文章。 顯示所有文章

2013年12月20日 星期五

PostgreSQL 安裝 pldebugger USE_PGSX

PostgreSQL 安裝 pldebugger USE_PGSX

使用 USE_PGSX=1 make,在pldebugger編好後就會直接把編好的plugin_debugger.so和pldbgapi--1.0.sql放到/usr/pgsql-9.3相對應的位置。

yum install git readline-devel zlib-devel openssl-devel

cd /opt
tar xvzf postgresql-9.3.2.tar.gz

cd /opt/postgresql-9.3.2
USE_PGXS=1 ./configure
USE_PGXS=1 make

cd /opt/postgresql-9.3.2/contrib/
git clone git://git.postgresql.org/git/pldebugger.git
make 

cd /opt/postgresql-9.3.2/contrib/pldebugger
USE_PGXS=1 make
USE_PGXS=1 make install

[root@localhost pldebugger]# USE_PGXS=1 make install                                                                                                         gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -I/usr/include/et -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fpic -shared -o plugin_debugger.so plpgsql_debugger.o plugin_debugger.o dbgcomm.o pldbgapi.o -L/usr/pgsql-9.3/lib -L/usr/lib64 -Wl,--as-needed
/bin/mkdir -p '/usr/pgsql-9.3/lib'
/bin/mkdir -p '/usr/pgsql-9.3/share/extension'
/bin/mkdir -p '/usr/pgsql-9.3/share/extension'
/bin/mkdir -p '/usr/share/doc/pgsql/extension'
/usr/bin/install -c -m 755  plugin_debugger.so '/usr/pgsql-9.3/lib/plugin_debugger.so'
/usr/bin/install -c -m 644 ./pldbgapi.control '/usr/pgsql-9.3/share/extension/'
/usr/bin/install -c -m 644 ./pldbgapi--1.0.sql ./pldbgapi--unpackaged--1.0.sql  '/usr/pgsql-9.3/share/extension/'
/usr/bin/install -c -m 644 ./README.pldebugger '/usr/share/doc/pgsql/extension/'


vim /var/lib/pgsql/9.3/data/postgresql.conf
加入下面的設定
shared_preload_libraries = '$libdir/plugin_debugger'

重新啟動
service postgresql-9.3 restart

安裝pldbgapi
su - postgres
psql
CREATE EXTENSION pldbgapi;
\dx

-bash-4.1$ psql
psql (9.3.2)
Type "help" for help.

postgres=# CREATE EXTENSION pldbgapi;
CREATE EXTENSION
postgres=# \dx
                              List of installed extensions
   Name    | Version |   Schema   |                     Description
-----------+---------+------------+------------------------------------------------------
adminpack | 1.0     | pg_catalog | administrative functions for PostgreSQL
pldbgapi  | 1.0     | public     | server-side support for debugging PL/pgSQL functions
plpgsql   | 1.0     | pg_catalog | PL/pgSQL procedural language
(3 rows)

================================================================
當pldebugger在USE_PGXS=1 make時出現下面的錯誤要安裝 openssl-devel套件,安裝好後再重新執行USE_PGXS=1 make

[root@localhost pldebugger]# USE_PGXS=1 make
gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -I/usr/include/et -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fpic -I. -I. -I/usr/pgsql-9.3/include/server -I/usr/pgsql-9.3/include/internal -I/usr/include/et -D_GNU_SOURCE -I/usr/include/libxml2  -I/usr/include  -c -o pldbgapi.o pldbgapi.c
In file included from pldbgapi.c:98:
/usr/pgsql-9.3/include/server/libpq/libpq-be.h:25:25: error: openssl/ssl.h: No such file or directory
/usr/pgsql-9.3/include/server/libpq/libpq-be.h:26:25: error: openssl/err.h: No such file or directory
/usr/pgsql-9.3/include/server/libpq/libpq-be.h:36:27: error: gssapi/gssapi.h: No such file or directory
In file included from pldbgapi.c:98:
/usr/pgsql-9.3/include/server/libpq/libpq-be.h:86: error: expected specifier-qualifier-list before ‘gss_buffer_desc’
/usr/pgsql-9.3/include/server/libpq/libpq-be.h:176: error: expected specifier-qualifier-list before ‘SSL’
make: *** [pldbgapi.o] Error 1

PostgreSQL 安裝 pldebugger

yum install git readline-devel zlib-devel

cd /opt
tar xvzf postgresql-9.3.2.tar.gz
cd /opt/postgresql-9.3.2/contrib/
git clone git://git.postgresql.org/git/pldebugger.git

cd /opt/postgresql-9.3.2
./configure
make

cd /opt/postgresql-9.3.2/contrib/pldebugger
make
make install

/bin/mkdir -p '/usr/local/pgsql/lib'
/bin/mkdir -p '/usr/local/pgsql/share/extension'
/bin/mkdir -p '/usr/local/pgsql/share/extension'
/bin/mkdir -p '/usr/local/pgsql/share/doc//extension'
/usr/bin/install -c -m 755  plugin_debugger.so '/usr/local/pgsql/lib/plugin_debugger.so'
/usr/bin/install -c -m 644 ./pldbgapi.control '/usr/local/pgsql/share/extension/'
/usr/bin/install -c -m 644 ./pldbgapi--1.0.sql ./pldbgapi--unpackaged--1.0.sql  '/usr/local/pgsql/share/extension/'
/usr/bin/install -c -m 644 ./README.pldebugger '/usr/local/pgsql/share/doc//extension/'

cp /usr/local/pgsql/lib/plugin_debugger.so /usr/pgsql-9.3/lib/  
cp /usr/local/pgsql/share/extension/pldbgapi--1.0.sql /usr/pgsql-9.3/share/extension/  
cp /usr/local/pgsql/share/extension/pldbgapi--unpackaged--1.0.sql /usr/pgsql-9.3/share/extension/
cp /usr/local/pgsql/share/extension/pldbgapi.control /usr/pgsql-9.3/share/extension/

vim /var/lib/pgsql/9.3/data/postgresql.conf
加入
shared_preload_libraries = '$libdir/plugin_debugger'

service postgresql-9.3 restart

su - postgres
psql
CREATE EXTENSION pldbgapi;
\dx

-bash-4.1$ psql
psql (9.3.2)
Type "help" for help.

postgres=# CREATE EXTENSION pldbgapi;
CREATE EXTENSION
postgres=# \dx
                              List of installed extensions
   Name    | Version |   Schema   |                     Description
-----------+---------+------------+------------------------------------------------------
adminpack | 1.0     | pg_catalog | administrative functions for PostgreSQL
pldbgapi  | 1.0     | public     | server-side support for debugging PL/pgSQL functions
plpgsql   | 1.0     | pg_catalog | PL/pgSQL procedural language
(3 rows)

postgres=#

2012年6月28日 星期四

CentOS6用yum安裝webmin

vim /etc/yum.repos.d/webmin.repo
加入下面的內容

[Webmin]
name=Webmin Distribution Neutral 
baseurl=http://download.webmin.com/download/yum 
enabled=1

rpm --import http://www.webmin.com/jcameron-key.asc
yum install webmin
yum install gcc openssl openssl-devel

http://localhost:10000
帳號密碼為系統管理者root

2012年5月3日 星期四

install phpPgAdmin

yum install httpd php

設定 vim /etc/httpd/conf/httpd.conf
DirectoryIndex後面加入index.php



安裝phpPgAdmin

  • yum安裝
    yum install phpPgAdmin
    會將相關的apache php等套件一同安裝
    使用yum安裝完後在/var/www/html並沒有發現phpPgAdmin的資料夾
    主要分成兩個部分
    主程式:/usr/share/phpPgAdmin
    設定檔:/etc/phpPgAdmin/config.inc.php
    網址:127.0.0.1/phpPgAdmin就可以連到,系統會自動設好
    
  • 手動下載安裝:
    下載網站:http://phppgadmin.sourceforge.net/doku.php?id=download
    下載完後解開到/var/www/html下即可
    設定檔:phpPgAdmin/conf/config.inc.php
    網址:127.0.0.1/phpPgAdmin就可以連到
    

設定config.inc.php

vim /etc/phpPgAdmin/config.inc.php

$conf['servers'][0]['host'] = 'localhost';

// Only show owned databases?
// Note: This will simply hide other databases in the list - this does
// not in any way prevent your users from seeing other database by
// other means. (e.g. Run 'SELECT * FROM pg_database' in the SQL area.)
$conf['owned_only'] = true;

// 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;

設定vim /etc/httpd/conf.d/phpPgAdmin.conf
刪除Allow from 127.0.0.1
增加allow from all
重啟httpd

設定SELinux讓網頁可以連接資料庫

setsebool -P httpd_can_network_connect_db=1


2012年5月2日 星期三

Server instrumentation not install

安裝完postgresql後,用PgAdminIII連線會出現Server instrumentation not install的視窗

解決方法:
yum install postgresql91-contrib
su - postgres
psql < /usr/pgsql-9.1/share/extension/adminpack--1.0.sql
再用PgAdminIII重新連線一次,點選在 Server instrumentation not install的視窗下方的『Fix it!』按鈕

2012年4月30日 星期一

CentOS6 Mount NTFS

安裝好rpmforge-release後,再安裝fuse-ntfs-3g即可
yum install fuse-ntfs-3g

2012年4月16日 星期一

phpPgAdmin You don't have permission to access /phpPgAdmin on this server.

安裝完phpPgAdmin後
192.168.1.XXX/phpPgAdmin會出現You don't have permission to access /phpPgAdmin on this server.
但在127.0.0.1/phpPgAdmin或localhost/phpPgAdmin都可以連上

解決方式:
設定vim /etc/httpd/conf.d/phpPgAdmin.conf
刪除Allow from 127.0.0.1
增加allow from all
重啟httpd

==================================

Alias /phpPgAdmin /usr/share/phpPgAdmin


    Order deny,allow
    Deny from all
#    Allow from 127.0.0.1
    allow from all
    Allow from ::1
    # Allow from .example.com


2012年4月4日 星期三

CENTOS6 安裝 rpmforge-release

32位元
http://apt.sw.be/redhat/el6/en/i386/rpmforge/RPMS/rpmforge-release-0.5.2-2.el6.rf.i686.rpm

64位元
http://apt.sw.be/redhat/el6/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm

rpm -Uvh http://apt.sw.be/redhat/el6/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm


centos5


CENTOS6 安裝EPEL

32位元
http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm

64位元
http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-5.noarch.rpm
http://download.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm

http://ftp.jaist.ac.jp/pub/Linux/Fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm

導入key
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

安裝 yum-priorities
yum install yum-priorities