2013年8月8日木曜日

phpPgAdmin nginx install

# cd /usr/local/src/
# wget http://downloads.sourceforge.net/phppgadmin/phpPgAdmin-5.1.tar.gz?download
# tar zxvf phpPgAdmin-5.1.tar.gz
# cp -R phpPgAdmin-5.1 /usr/local/nginx/html/phpPgAdmin
# vim /usr/local/nginx/html/phpPgAdmin/conf/config.inc.php

postgresql 9.2.4 install

# useradd postgres
# yum install readline* ncurses* zlib*
# cd /usr/local/src/
# wget http://ftp.postgresql.org/pub/source/v9.2.4/postgresql-9.2.4.tar.gz
# cd postgresql-9.2.4
# ./configure
# make
# make install
# mkdir /usr/local/pgsql/data
# chown postgres:postgres /usr/local/pgsql/data
# cp /usr/local/src/postgresql-9.2.4/contrib/start-scripts/linux /etc/init.d/postgresql
# chmod 755 /etc/init.d/postgresql

※PostgreSQL 自動起動

# chkconfig --add postgresql
# su - postgres
$ vim .bashrc
export PATH=/usr/local/pgsql/bin:$PATH
export LD_LIBRATY_PATH=/usr/local/pgsql/bin:$LD_LIBRATY_PATH
export PGDATA=/usr/local/pgsql/data
$ initdb -E UTF-8 --no-locale
$ vim /usr/local/pgsql/data/postgresql.conf
listen_addresses = '*'
$ vim /usr/local/pgsql/data/pg_hba.conf
host    all             all             192.168.0.0/24                 trust

※PostgreSQL 起動

$ pg_ctl -D /usr/local/pgsql/data -l postmaster.log start

※PostgreSQL 停止

$ pg_ctl -D /usr/local/pgsql/data stop

※PostgreSQL 再起動

$ pg_ctl restart

※DataBase 一覧

$ psql -l

※DataBase 作成

$ createdb DataBase名

※DataBase ログイン

$ psql DataBase名

※User 作成

$ createuser User名

※DataBase ユーザーでログイン

$ psql -U User名 DataBase名

※DataBase バックアップ

$ pg_dump DataBase名 > バックアップファイル名

※DataBase バックアップからリストア

$ dropdb DataBase名
$ createdb DataBase名
$ psql -f バックアップファイル名 > DataBase名

2013年8月7日水曜日

Zend FrameWork 2.2 nginx

# cd /usr/local/src/
# wget https://packages.zendframework.com/releases/ZendFramework-2.2.2/ZendFramework-2.2.2.zip
# unzip ZendFramework-2.2.2.zip
# cp -R ZendFramework-2.2.2/library/Zend /usr/local/lib/php/Zend

# mkdir MyProject
# cd MyProject
# git clone git://github.com/zendframework/ZendSkeletonApplication.git
# cd ZendSkeletonApplication/
# vim /usr/local/nginx/conf/nginx.conf
    server {
        listen  8080;
        server_name   localhost;
        root   MyProject/ZendSkeletonApplication/public;
        index  index.php index.html index.htm;

        location / {
            if (!-e $request_filename) {
                rewrite ^.*$ /index.php last;
            }
        }

        location ~ .php$ {
            fastcgi_pass   unix:/tmp/php.socket;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            fastcgi_param  PATH_INFO  $fastcgi_script_name;
            fastcgi_param  APPLICATION_ENV  development;
            fastcgi_param  ZF2_PATH  /usr/local/lib/php;
            include        fastcgi_params;
        }
    }
# service nginx restart

2013年8月6日火曜日

nginx php install

php5.3.3以前のバージョンの場合はphp-fpmをインストールする必要があるが
本環境では5.5.1を使用するため説明を省略します。

# yum install ImageMagick*
# yum install gd*
# yum install libxml2*
# yum install libevent*
# yum install curl*
# yum install libjpeg*
# yum install libpng*
# yum install freetype*
# yum install libxslt*

# cd /usr/local/src/
#wget http://jp1.php.net/get/php-5.5.1.tar.gz/from/this/mirror
# tar zxvf php-5.5.1.tar.gz
# cd php-5.5.1
# ./configure \
--enable-mbstring \
--enable-mbregex \
--enable-fpm \
--enable-json \
--enable-pcntl \
--enable-exif \
--enable-sockets \
--enable-gd-native-ttf \
--with-pgsql=/usr/local/pgsql/ \
--with-pdo-pgsql=/usr/local/pgsql/ \
--with-openssl \
--with-zlib \
--with-gd \
--with-jpeg-dir \
--with-png-dir \
--with-freetype-dir \
--with-mhash \
--with-xmlrpc \
--with-xsl \
--with-pear
# make
# make install
# cp php.ini-production /usr/local/lib/php.ini
# cp /usr/local/etc/php-fpm.conf.default /usr/local/etc/php-fpm.conf

# cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
# chmod 755 /etc/init.d/php-fpm
# chkconfig --add php-fpm 
# chkconfig php-fpm on
# chkconfig --list php-fpm 
nginx           0:off 1:off 2:on 3:on 4:on 5:on 6:off
# service php-fpm start

2013年8月3日土曜日

nginx install

nginx (エンジンエックス)

# yum install gcc
# yum install pcre pcre-devel
# yum install zlib zlib-devel
# yum install openssl openssl-devel
# cd /usr/local/src/
# wget http://nginx.org/download/nginx-1.4.2.tar.gz
# tar zxvf nginx-1.4.2.tar.gz 
# cd nginx-1.4.2
# ./configure 
Configuration summary
  + using system PCRE library
  + OpenSSL library is not used
  + md5: using system crypto library
  + sha1: using system crypto library
  + using system zlib library

  nginx path prefix: "/usr/local/nginx"
  nginx binary file: "/usr/local/nginx/sbin/nginx"
  nginx configuration prefix: "/usr/local/nginx/conf"
  nginx configuration file: "/usr/local/nginx/conf/nginx.conf"
  nginx pid file: "/usr/local/nginx/logs/nginx.pid"
  nginx error log file: "/usr/local/nginx/logs/error.log"
  nginx http access log file: "/usr/local/nginx/logs/access.log"
  nginx http client request body temporary files: "client_body_temp"
  nginx http proxy temporary files: "proxy_temp"
  nginx http fastcgi temporary files: "fastcgi_temp"
  nginx http uwsgi temporary files: "uwsgi_temp"
  nginx http scgi temporary files: "scgi_temp"
# make
# make install

# vim /etc/init.d/nginx

#!/bin/sh

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ "$NETWORKING" = "no" ] && exit 0

nginx="/usr/local/nginx/sbin/nginx"
prog=$(basename $nginx)

NGINX_CONF_FILE="/usr/local/nginx/conf/nginx.conf"

[ -f /etc/sysconfig/nginx ] && . /etc/sysconfig/nginx

start() {
    [ -x $nginx ] || exit 5
    [ -f $NGINX_CONF_FILE ] || exit 6
    echo -n $"Starting $prog: "
    daemon $nginx -c $NGINX_CONF_FILE
    retval=$?
    echo
    [ $retval -eq 0 ] && touch $lockfile
    return $retval
}

stop() {
    echo -n $"Stopping $prog: "
    killproc $prog -QUIT
    retval=$?
    echo
    [ $retval -eq 0 ] && rm -f $lockfile
    return $retval
}

restart() {
    configtest || return $?
    stop
    sleep 1
    start
}

reload() {
    configtest || return $?
    echo -n $"Reloading $prog: "
    killproc $nginx -HUP
    RETVAL=$?
    echo
}

force_reload() {
    restart
}

configtest() {
  $nginx -t -c $NGINX_CONF_FILE
}

rh_status() {
    status $prog
}

rh_status_q() {
    rh_status >/dev/null 2>&1
}

case "$1" in
    start)
        rh_status_q && exit 0
        $1
        ;;
    stop)
        rh_status_q || exit 0
        $1
        ;;
    restart|configtest)
        $1
        ;;
    reload)
        rh_status_q || exit 7
        $1
        ;;
    force-reload)
        force_reload
        ;;
    status)
        rh_status
        ;;
    condrestart|try-restart)
        rh_status_q || exit 0
            ;;
    *)
        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload|configtest}"
        exit 2
esac

# chmod 755 /etc/init.d/nginx 
# chkconfig --add nginx 
# chkconfig nginx on
# chkconfig --list nginx 
nginx           0:off 1:off 2:on 3:on 4:on 5:on 6:off


2013年8月2日金曜日

centos6.4 google chrome install chromium install

centos6.4 に yum で google chrome インストール

# vim /etc/yum.repos.d/google.repo
[google] name=Google - i386 baseurl=http://dl.google.com/linux/rpm/stable/i386 enabled=1 gpgcheck=1 gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub [google64] name=Google - x86_64 baseurl=http://dl.google.com/linux/rpm/stable/x86_64 enabled=1 gpgcheck=1 gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub
# yum install google-chrome-stable
Loaded plugins: fastestmirror, refresh-packagekit, security Loading mirror speeds from cached hostfile * base: www.ftp.ne.jp * extras: www.ftp.ne.jp * updates: www.ftp.ne.jp Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package google-chrome-stable.x86_64 0:28.0.1500.95-213514 will be installed --> Processing Dependency: libstdc++.so.6(GLIBCXX_3.4.15)(64bit) for package: google-chrome-stable-28.0.1500.95-213514.x86_64 --> Finished Dependency Resolution Error: Package: google-chrome-stable-28.0.1500.95-213514.x86_64 (google64) Requires: libstdc++.so.6(GLIBCXX_3.4.15)(64bit) You could try using --skip-broken to work around the problem You could try running: rpm -Va --nofiles --nodigest

エラーでインストール出来ない。
どうやら, google chrome については, 今後は RHEL6 (とそのクローン) のサポートがされないらしい

仕方がないので chromium をインストールする

$ wget http://people.centos.org/hughesjr/chromium/6/chromium-el6.repo
# cp chromium-el6.repo /etc/yum.repos.d/
# yum install chromium
 
root ユーザーで使用する場合は
# vim /opt/chromium/chrome-wrapper
exec $CMD_PREFIX "$HERE/chrome" "$@"
下記の様に --user-data-dir 文字を追記
exec $CMD_PREFIX "$HERE/chrome" "$@" --user-data-dir

eclipse install centos6.4

Eclipse Standard 4.3
ダウンロード
http://www.eclipse.org/downloads/

# mv Downloads/eclipse-standard-kepler-R-linux-gtk-x86_64.tar.gz /usr/local/src/
# cd /usr/local/src/
# tar zxvf eclipse-standard-kepler-R-linux-gtk-x86_64.tar.gz
# mv eclipse /usr/local/eclipse
# ln -s /usr/local/eclipse/eclipse /usr/local/bin/eclipse


日本語化 プラグイン Pleiade
ダウンロード 1.4.0版
http://sourceforge.jp/projects/mergedoc/downloads/58165/pleiades_1.4.0.zip/

# mkdir /usr/local/src/pleiades
# mv Downloads/pleiades_1.4.0.zip /usr/local/src/pleiades/
# cd /usr/local/src/pleiades
# unzip pleiades_1.4.0.zip
# less readme/readme_pleiades.txt
# cp -R plugins/* /usr/local/eclipse/plugins/
# cp -R features/* /usr/local/eclipse/features/

 eclipse.ini の最終行に以下の記述を追加
# vim /usr/local/eclipse/eclipse.ini
-javaagent:plugins/jp.sourceforge.mergedoc.pleiades/pleiades.jar

Pleiades スプラッシュ画像を使う場合は
# vim /usr/local/eclipse/eclipse.ini
eclipse.ini の 1、2 行目の -showsplash org.eclipse.platform を削除

eclipse 初回起動方法
# eclipse -clean
次回以降 eclipse 起動方法
# eclipse

PDTをインストールするには、まずEclipseを起動し、メニューバーから Help > Install New Software… を選択します。次にInstallダイアログのWork with:の部分でKepler - http://download.eclipse.org/releases/keplerを選択し、type filter textの入力欄にphpと入力します。次にPHP Development Tools (PDT)を一つ選択し、Next >ボタンをクリックします。
あとはウィザードを進めていき最後にFinishボタンをクリックします。