ラベル nginx の投稿を表示しています。 すべての投稿を表示
ラベル nginx の投稿を表示しています。 すべての投稿を表示

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

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