花鳥記録館

料理よりサーバ構築が得意な、とある嫁の外部記憶場所

Entries

八宝菜



初八宝菜。
きくらげ、ヤングコーン、たけのこ、エビ、具になっているものが好きなものばかり。

今日のインコさま(20120511)



粟穂に必死

今日のインコさま(20120414)



放鳥なう。
*CommentList

今日のインコさま(20120404)



小松菜はさっぱり食べなかったけど、菜の花は好きらしい。

今日のインコさま(20120321)



手には餌で釣って乗るようになったけれど、触ろうとすると怒る…。
慣れてくれないと放鳥もできないんだけどなぁ。

インコさまのお迎え

鳥カテゴリーを追加したので書き込み。
2012年3月3日にお迎えしたセキセイインコさま。

PostgresとPerlの連携

【メモ】

http://www.atmarkit.co.jp/flinux/rensai/postgres03/postgres03.html
「2.PerlによるPostgreSQLの操作」をやってみました。

[root]#rpm -qa |grep postgresql
postgresql-server-8.4.4-2.el6.x86_64
postgresql-odbc-08.04.0200-1.el6.x86_64
postgresql-docs-8.4.4-2.el6.x86_64
postgresql-libs-8.4.4-2.el6.x86_64
postgresql-8.4.4-2.el6.x86_64

[root]#./test1.pl
Can't locate Pg.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5

/usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl

/usr/lib64/perl5 /usr/share/perl5 .) at ./test1.pl line 2.
BEGIN failed--compilation aborted at ./test1.pl line 2.

[root]#cat test1.pl
#!/usr/bin/perl
use Pg;
<略>
※Pgが必要らしい
※「Can't locate Pg.pm in @INC」で検索してみるとCPANを実行しないといけないらしい

プロキシサーバを利用しているので設定
[root]#export ftp_proxy=http://ftp_proxy:8000/
[root]#export http_proxy=http://http_proxy:8000/
※CPAN実行途中でプロキシのIDとパスワードを聞かれる

[root]#perl -MCPAN -e shell
※選択肢は[ENTER]でOK

cpan> m Pg
Module id = Pg
DESCRIPTION PostgreSQL SQL database interface
CPAN_USERID MERGL (Edmund Mergl )
CPAN_VERSION 1.009000
CPAN_FILE M/ME/MERGL/pgsql_perl5-1.9.0.tar.gz
DSLIP_STATUS Rdcf? (released,developer,C,functions,)
INST_FILE (not installed)

cpan> install Pg
<前略>
"http://www.perl.org/CPAN/authors/id/M/ME/MERGL/CHECKSUMS"
Checksum for /root/.cpan/sources/authors/id/M/ME/MERGL/pgsql_perl5-1.9.0.tar.gz ok
pgsql_perl5-1.9.0/
pgsql_perl5-1.9.0/eg/
pgsql_perl5-1.9.0/eg/ApachePg.pl
pgsql_perl5-1.9.0/eg/example.pl
pgsql_perl5-1.9.0/eg/lo_demo.pl
pgsql_perl5-1.9.0/Changes
pgsql_perl5-1.9.0/MANIFEST
pgsql_perl5-1.9.0/Makefile.PL
pgsql_perl5-1.9.0/Pg.pm
pgsql_perl5-1.9.0/Pg.xs
pgsql_perl5-1.9.0/README
pgsql_perl5-1.9.0/test.pl
pgsql_perl5-1.9.0/typemap
<後略>

※findでMakefileの場所を探す。
[root]# cd /root/.cpan/build/pgsql_perl5-1.9.0-IIPFPZ/
[root]# perl Makefile.PL
Configuring Pg
Remember to actually read the README file !
please set environment variables POSTGRES_INCLUDE and POSTGRES_LIB !
※READMEを見ていなかった…。

※READMEから抜粋
The Makefile checks the environment variables POSTGRES_INCLUDE and
POSTGRES_LIB, to find the library libpq.so and the include file
libpq-fe.h.

※findでlibpq.soの場所を探す
[root]# export POSTGRES_LIB=/usr/lib64/
[root]# export POSTGRES_INCLUDE=/usr/lib64/

[root]# perl Makefile.PL
Configuring Pg
Remember to actually read the README file !
OS: linux
Checking if your kit is complete...
Looks good
Writing Makefile for Pg

[root]# make
Pg.xs:16:22: error: libpq-fe.h: そのようなファイルやディレクトリはありません

[root]# rpm -ivh postgresql-devel-8.4.4-2.el6.x86_64.rpm
警告: postgresql-devel-8.4.4-2.el6.x86_64.rpm: ヘッダ V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
準備中... ########################################### [100%]
1:postgresql-devel ########################################### [100%]
[root]# updatedb
[root]# locate libpq-fe.h
/usr/include/libpq-fe.h
[root]# make
※いくつか警告が出るが無視

[root]# make install
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Installing /usr/local/lib64/perl5/auto/Pg/Pg.bs
Installing /usr/local/lib64/perl5/auto/Pg/Pg.so
Installing /usr/local/lib64/perl5/Pg.pm
Installing /usr/local/lib64/perl5/auto/Pg/autosplit.ix
Installing /usr/local/share/man/man3/Pg.3pm
Appending installation info to /usr/lib64/perl5/perllocal.pod


[root]# cd /var/www/html/
[root]# ./test1.pl
name telno email
--------------------------------------

[root]#vi test1.pl
$dbuser = "user1";
$conn = Pg::connectdb("dbname=$dbname user=$dbuser");

[root]# ./test1.pl
name telno email
--------------------------------------
R.Munechika 070-1234-5678 munetika@hogehoge.com
H.Nishida 070-2345-6789 nishida@hogehoge.com
T.Miyahara 070-3456-7890 miyahara@hogehoge.com
※表示できた

[root]# ./test2.pl
OK
[root]# ./test1.pl
name telno email
--------------------------------------
R.Munechika 070-1234-5678 munetika@hogehoge.com
H.Nishida 070-2345-6789 nishida@hogehoge.com
T.Miyahara 070-3456-7890 miyahara@hogehoge.com
K,Hamano 070-8888-8888 hamano@email.net
※追加できた

Apache-Tomcatの連携

【環境】
OS:WindowsServer2008R2
Web:Apache2.2.x
AP:Tomcat6.0.x

[Apache]=Apacheインストールディレクトリ
[Tomcat]=Tomcatインストールディレクトリ

【メモ】
TomcatのWebポート(8080)の無効
[Tomcat]\conf\server.xml
<!--
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
-->


mod_proxy_ajpモジュールの有効(#を外す)
[Apache]\conf\httpd.conf
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so


コンテキストパスで設定した値に設定
[Tomcat]\conf\Catalina\localhost\hoge.xml
[Tomcat]\conf\Catalina\localhost\manager.xml
[Apache]\conf\extra\httpd-proxy.conf
<Location /hoge/>
ProxyPass ajp://localhost:8009/hoge/
</Location>
<Location /manager/>
ProxyPass ajp://localhost:8009/manager/
</Location>


http-proxy.confを読み込み
[Apache]\conf\httpd.conf
Include conf/extra/httpd-proxy.conf


Apache、Tomcatの再起動

http://localhost/hoge/
http://localhost/manager/html
に接続できればOK

おでんとカブの煮物


おでんとカブの煮物。
かぶといえばそろそろみずほが100円切りそう…。

ドリアとブロッコリーのポタージュ


ドリアとブロッコリーのポタージュ。
ドリアは冷凍ピラフにホワイトソースを混ぜただけの手抜き。
ポタージュは旦那作。ブロッコリーをブレンダーで掻き混ぜたりやたら凝ってた。

左サイドMenu

プロフィール

みさ

Author:みさ
SE時々主婦をやっています
社会人歴5年、主婦歴6ヶ月
鳥好き

最新記事

カレンダー

04 ≪│2012/05│≫ 06
- - 1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31 - -

右サイドメニュー

検索フォーム

Twitter

Twitter < > Reload

アクセスカウンタ

アクセスランキング

[ジャンルランキング]
日記
42006位
アクセスランキングを見る>>

[サブジャンルランキング]
主婦
3923位
アクセスランキングを見る>>