# rpm -qa | grep postgres | xargs rpm -e # rpm -qa | grep httpd | xargs rpm -e # rpm -qa | grep php | xargs rpm -e
¥Ð¡¼¥¸¥ç¥ó¥¢¥Ã¥×¤¹¤ë¾ì¹ç¤Ïpg_dump¤·¤Æpg_ctl stop¤·¤Æ¤ª¤¤Þ¤·¤ç¤¦
postgres ¥æ¡¼¥¶¡¼¤ÎºîÀ®
# /usr/sbin/useradd -d /usr/local/pgsql postgres # passwd postgres
ºî¶È¥Ç¥£¥ì¥¯¥È¥êºîÀ®
# mkdir -p /usr/local/src/postgresql-7.4.3 # chown postgres /usr/local/src/postgresql-7.4.3 # mkdir -p /usr/local/pgsql # chown postgres /usr/local/pgsql
¥½¡¼¥¹¼èÆÀ http://www.postgresql.jp/
# su postgres $ tar xvzf postgresql-7.4.3.tar.gz $ cd postgresql-7.4.3 $ ./configure
7.3°Ê¹ß¤Ï¥Þ¥ë¥Á¥Ð¥¤¥È¥µ¥Ý¡¼¥È¤Ï¥Ç¥Õ¥©¥ë¥È¤Ç͸ú¤Ë¤Ê¤ë
¥í¥°¤ò¼è¤ë¤È¤¤Ï --enable-syslog ODBCÀܳ¤¹¤ë¾ì¹ç¤Ï --enable-odbc --with-unixodbc
JDBC¥É¥é¥¤¥Ð¤ò¥Ó¥ë¥É¤¹¤ë¾ì¹ç¤Ï --with-java ¤Ç¤âANT1.5°Ê¾å¤¬¤¤¤ë¤é¤·¤¤
--without-readline ¤ò»ØÄꤷ¤í¤È¤«¸À¤ï¤ì¤ë¤È readline-devel ¤È libtermcap-devel ¤òÆþ¤ì¤Æ¤ß¤è¤¦
$ make all $ make check $ make install
¥Ð¡¼¥¸¥ç¥ó¤ò¾å¤²¤ë¤È¥¨¥é¡¼¤¬½Ð¤Æmake check¤¬¤Ç¤¤Ê¤¤¤³¤È¤¬¤¢¤ë ¤³¤ó¤Ê´¶¤¸¢
============== removing existing temp installation ============== ============== creating temporary installation ============== ============== initializing database system ============== ============== starting postmaster ============== running on port 65432 with pid 4246 ============== creating database "regression" ============== /usr/local/src/postgresql- 7.4.2/src/test/regress/./tmp_check/install//usr/local/pgsql/bin/createdb: relocation error: /usr/local/src/postgresql-7.4.2/src/test/regress/./tmp_check/install//usr/local/pgsql /bin/createdb: undefined symbol: get_progname pg_regress: createdb failed make[2]: *** [check] ¥¨¥é¡¼ 2 make[2]: ½Ð¤Þ¤¹ ¥Ç¥£¥ì¥¯¥È¥ê `/usr/local/src/postgresql-7.4.2/src/test/regress' make[1]: *** [check] ¥¨¥é¡¼ 2 make[1]: ½Ð¤Þ¤¹ ¥Ç¥£¥ì¥¯¥È¥ê `/usr/local/src/postgresql-7.4.2/src/test' make: *** [check] ¥¨¥é¡¼ 2
¤³¤ì¤Ï¸Å¤¤libpq.so¤¬»Ä¤Ã¤Æ¤¤¤ë¤«¤é¤é¤·¤¤
# rm -fr /usr/local/pgsql/lib
¤Ê¤É¤È¤·¤Æºï½ü¤·¤Á¤ã¤¤¤Þ¤·¤ç¤¦
Ê̤˥¤¥ó¥¹¥È¡¼¥ëɬÍפϤ¢¤ê¤Þ¤»¤ó
bison¤¬É¬ÍפǤ¹
$ su postgres $ cd /usr/local/src/postgresql-7.4.3/contrib $ gmake all $ gmake install
postgres¤ÈPostgreSQL¤ò»ÈÍѤ¹¤ë¥æ¡¼¥¶¡¼Á´¤Æ¤Î.bashrc¤Ë°Ê²¼¤òÄɲÃ
PATH="$PATH":/usr/local/pgsql/bin export POSTGRES_HOME=/usr/local/pgsql export PGLIB=$POSTGRES_HOME/lib export PGDATA=$POSTGRES_HOME/data export MANPATH="$MANPATH":$POSTGRES_HOME/man export LD_LIBRARY_PATH="$LD_LIBRARY_PATH":"$PGLIB"
ÀßÄê¤ÎÈ¿±Ç
$ source ~/.bashrc
¥Ç¡¼¥¿¥Ù¡¼¥¹½é´ü²½
$ initdb --encoding=EUC_JP --no-locale
postmaster¤Îµ¯Æ°
$ pg_ctl -w start
°ì¹ÔÄɲÃ
# vi /etc/ld.so.conf /usr/local/pgsql/lib # /sbin/ldconfig
¼«Æ°µ¯Æ°¤ÎÀßÄê
# cp /usr/local/src/postgresql-7.4.3/contrib/start-scripts/linux /etc/rc.d/init.d/postgresql # chmod 755 /etc/rc.d/init.d/postgresql # /sbin/chkconfig --add postgresql
Pg.pm¤Ï7.3¤«¤éÊÌ´ÉÍý¤Ë¤Ê¤Ã¤¿¤½¤¦¤Ê
Perl¤«¤éPg.pm¤ÇÀܳ¤¹¤ë¾ì¹ç¤Ï°Ê²¼¤ò¼Â¹Ô
http://gborg.postgresql.org/project/pgperl/download/download.php
pgperl-2.0.2.tar.gz
# tar xvzf pgperl-2.0.2.tar.gz # cd Pg-2.0.2 # POSTGRES_HOME=/usr/local/pgsql # export POSTGRES_HOME # perl Makefile.PL # make # make test # make install
$ vi /usr/local/pgsql/data/postgresql.conf log_connections = true # Àܳ¥í¥°¤ò»Ä¤¹ log_statement = true # Á´¤Æ¤ÎSQLʸ¤òµÏ¿ debug_print_parse = true # ¥Ñ¡¼¥¹¥Ä¥ê¡¼¤ò½ÐÎϤ·¤Þ¤¹ debug_print_rewritten = true # ½ñ¤´¹¤¨¸å¤Î¥Ñ¡¼¥¹¥Ä¥ê¡¼¤ò½ÐÎϤ·¤Þ¤¹ debug_print_plan = ture # Ìä¹ç¤»¥×¥é¥ó¤ò½ÐÎϤ·¤Þ¤¹ syslog = 2 # ½ÐÎϤòÀ©¸æ¤·¤Þ¤¹(0:½ÐÎϤʤ· 1:syslog¤Èstdout¤Ë½ÐÎÏ 2:syslog¤Î¤ß¤Ë½ÐÎÏ) syslog_facility = 'LOCAL0'
$ pg_ctl stop $ pg_ctl -w start
PostgreSQL¤Î¥í¥°¥Õ¥¡¥¤¥ë¤ÏÊ̤ËÅǤ½Ð¤¹¤è¤¦¤ËÀßÄê
$su # vi /etc/syslog.conf local0.* /var/log/postgres # ¾¤Ëlocal0¤ò»È¤Ã¤Æ¤¤¤Ê¤¤¤«Ãí°Õ
# ps ax | grep syslog # kill -HUP Ä´¤Ù¤¿syslogd¤ÎPID
¥í¥°¥í¡¼¥Æ¡¼¥·¥ç¥óÀßÄê
# vi /etc/logrotate.d/postgres "/var/log/postgres" { rotate 4 weekly sharedscripts postrotate /usr/bin/killall -HUP syslogd endscript }
# tar xvzf apache_1.3.31.tar.gz # cd apache_1.3.31 # OPTIM="-O2" ./configure --enable-module=so --enable-module=rewrite # make # make install
Options
FollowSymLinks | ¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤ò͸ú |
Indexes | ¥Ç¥£¥ì¥¯¥È¥êÆâ´Ý¸«¤¨ |
Includes | SSI͸ú |
ExecCGI | CGI͸ú |
MultiViews | ¥Ö¥é¥¦¥¶¤òȽÄê(?) |
AllowOverride
AuthConfig | ǧ¾Ú͸ú |
FileInfo | ¥É¥¥å¥á¥ó¥È¥¿¥¤¥×¤Î¥Ç¥£¥ì¥¯¥Ç¥£¥Ö»ÈÍѵö²Ä |
Indexes | ¥Ç¥£¥ì¥¯¥È¥ê¥¤¥ó¥Ç¥Ã¥¯¥¹À©¸æ |
Limit | ¥Û¥¹¥È¤Ø¤Î¥¢¥¯¥»¥¹À©¸æ |
Apache¤Î¥Ð¡¼¥¸¥ç¥ó¤òɽ¼¨¤µ¤»¤Ê¤¤¤è¤¦¤Ë¤¹¤ë¤Ë¤Ï httpd.conf ¤Ë¤ª¤¤¤Æ
ServerSignature Off
ServerTokens ProductOnly # ¾¤Ëminimal,OS,Full¤¬»ØÄê¤Ç¤¤ë
²èÁü¥Õ¥¡¥¤¥ë¤Ï¥í¥°¤ËµÏ¿¤·¤Ê¤¤¤¿¤á¤Ë¤Ï httpd.conf ¤Ë¤ª¤¤¤Æ
<IfModule mod_setenvif.c> # no add images log SetEnvIf Request_URI "\.(gif)|(jpg)|(png)$" no_log ..... CustomLog /usr/local/apache/logs/access_log combined env=!no_log
# tar xvzf php-4.3.7.tar.gz # cd php-4.3.7 # ./configure --with-pgsql --with-apxs=/usr/local/apache/bin/apxs --enable-zend-multibyte --enable-mbstring --enable-mbregex
--enable-mbstr-enc-trans ¤Ï4.3.0°Ê¹ß¤ÏÇÑ»ß
--enable-trans-sid ¤Ï4.2.0°Ü¹Ô¤Ï¾ï¤Ë¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤Þ¤¹
¥³¥Þ¥ó¥É¥é¥¤¥óÈǤÏ4.3.0¤«¤é¾ï¤Ë¹½ÃÛ¤µ¤ì¤ë
CGIÈǤÈCLIÈǤϰ㤦¤â¤Î¤é¤·¤¤¤¾¤Ã
GD¤ò»ÈÍѤ¹¤ë¾ì¹ç¤Ï¤³¤ó¤Ê´¶¤¸
# ./configure \ --with-pgsql --with-apxs=/usr/local/apache/bin/apxs \ --enable-zend-multibyte --enable-mbstring --enable-mbregex \ --with-gd --with-zlib-dir=/usr --with-jpeg-dir=/usr \ --with-png-dir=/usr --with-freetype-dir=/usr --with-ttf \ --enable-gd-native-ttf --enable-gd-jis-conv
libpng, libjpeg, freetype ¤¬¤Ê¤¤¤È¸À¤ï¤ì¤¿¤é devel ¤òÆþ¤ì¤Æ¤ß¤ë
php.ini¤ÎÀßÄê
# cp /usr/local/src/php-4.3.7/php.ini-dist /usr/local/lib/php.ini
;; ½ÐÎϥХåե¡¥ê¥ó¥°¤ò͸ú¤Ë¤¹¤ë output_buffering = On ;; mb_output_handler¤Ë¤è¤ë½ÐÎÏÊÑ´¹¤ò͸ú¤Ë¤¹¤ë output_handler = mb_output_handler ;; HTTP¥Ø¥Ã¥À charset ¤òÀßÄê default_charset = Shift_JIS ;;ÆüËܸì¼çÂΤǻÈÍÑ mbstring.language = Japanese ;; ÆâÉô¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°¤òEUC-JP¤ËÀßÄê mbstring.internal_encoding = EUC-JP ;; HTTPÆþÎÏ¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°ÊÑ´¹¤òauto¤ËÀßÄê mbstring.http_input = auto ;; SJIS¤ËÊÑ´¹ mbstring.http_output = SJIS mbstring.encoding_translation = On¡¡É¬Íס© mbstring.detect_order = auto¡¡É¬Íס© ;; ̵¸ú¤Êʸ»ú¤ò½ÐÎϤ·¤Ê¤¤ mbstring.substitute_character = none; mbstring.func_overload = 0 ;; 4.1.0¤«¤é¿ä¾© register_globals = Off
# make # make install
httpd.conf¤Î½ñ¤´¹¤¨
AddType application/x-httpd-php .php
¤òÄɲä·¤ÆApacheºÆµ¯Æ°
CGIÈǤò¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë¾ì¹ç(4.3.0°Ê¹ß¤ÏÉÔÍ×)
# make distclean # ./configure --with-pgsql --enable-track-vars --enable-force-cgi-redirect --enable-mbstring --enable-mbstr-enc-trans # make # make install
¤³¤ì¤Ç/usr/local/bin/php ¤Ë¥Ð¥¤¥Ê¥ê¤¬¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤ë
/etc/rc.d/rc.local¤Ë°Ê²¼¤òµ½Ò
if [ -x /usr/local/apache/bin/apachectl ]; then /usr/local/apache/bin/apachectl start fi
¥¤¥ó¥¹¥È¡¼¥ë¤·¤¿¤Þ¤Þ¤Ç¤Ï¥í¥°¥Õ¥¡¥¤¥ë¤¬ÈîÂ礷¤Æ¥Ç¥£¥¹¥¯ÍÆÎ̤ò°µÇ÷¤¹¤ë¤Î¤Çɬ¤ºÀßÄꤷ¤Þ¤·¤ç¤¦ /etc/logrotate.d/apache ¥Õ¥¡¥¤¥ë¤òºîÀ®¤·¤Æ°Ê²¼¤òµ½Ò
/usr/local/apache/logs/*_log { rotate 4 compress # ZIP°µ½Ì¤¹¤ë¾ì¹ç weekly sharedscripts postrotate /usr/local/apache/bin/apachectl restart endscript }
# /usr/sbin/logrotate -f /etc/logrotate.d/apache
¥³¥Þ¥ó¥É¤Ë¤Æ /usr/local/apache/logs Æâ¤Ë access_log.1 error_log.1 ¤¬ºîÀ®¤µ¤ì¤Æ¤¤¤ì¤ÐOK
PostgreSQL7.3¤«¤é¤Ï¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤Î .pgpass ¤Ë¡¢ ¥Ç¡¼¥¿¥Ù¡¼¥¹¥Û¥¹¥È¤È¥æ¡¼¥¶¥Ñ¥¹¥ï¡¼¥É¤¬µ½Ò¤Ç¤¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤·¤¿¡£ ´Ä¶ÊÑ¿ô PGPASSWORD ¤Ç¤Ï¤Ê¤¯¡¢.pgpass ¤ò»ÈÍѤ¹¤ë¤è¤¦¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£