글목록

레이블이 CentOS인 게시물을 표시합니다. 모든 게시물 표시
레이블이 CentOS인 게시물을 표시합니다. 모든 게시물 표시

2015. 2. 13.

[CentOS 6.6] NodeJS Install





32Bit or 64Bit Check

# uname -m




# wget http://nodejs.org/dist/v0.12.0/node-v0.12.0-linux-x64.tar.gz

# tar xvfz node-v0.12.0-linux-x64.tar.gz

# mv ./node-v0.12.0-linux-x64 /usr/local/node

# vim /etc/profile



export NODE_HOME=/usr/local/node
export PATH=$PATH:$NODE_HOME/bin

# source /etc/profile


# node
> console.log("hellow, world");



[CentOS 6.6] NTP Install


# yum install ntp

# cat /etc/ntp.conf

# ntpdate kr.pool.ntp.org

# service ntpd start

# chkconfig ntpd on (아무메세지출력안됨)

# ntpq -p

2014. 5. 13.

[CentOS 6.4] Yum Install Svn Server in CentOS 6.4




# rpm -qa subversion
# yum remove subversion
# yum install httpd httpd-devel subversion mod_dav_svn mod_auth_mysql
# cd /etc/httpd/modules
# ls | grep svn
mod_authz_svn.so
mod_dav_svn.so





# svnserve --version 


svnserve, version 1.6.11 (r934486)

compiled Mar  6 2014, 10:33:29

Copyright (C) 2000-2009 CollabNet.

Subversion is open source software, see http://subversion.tigris.org/
This product includes software developed by CollabNet (http://www.Collab.Net/).

The following repository back-end (FS) modules are available:


* fs_base : Module for working with a Berkeley DB repository.

* fs_fs : Module for working with a plain file (FSFS) repository.

Cyrus SASL authentication is available.










# vi ~/.bash_profile
------------------------ .bash_profile ----------------------------
SVN_EDITOR=/usr/bin/vim
export SVN_EDITOR
----------------------------------------------------------------------
 
# mkdir -p /home/svn/repositories
# svnadmin create /home/svn/repositories

 echo 'OPTIONS="--threads --root 저장소최상위폴더(/home/svn"' > /etc/sysconfig/svnserve
cat /etc/sysconfig/svnserve

# cd /home/svn/repositories/conf

# vim passwd

[users]

# harry = harryssecret
# sally = sallyssecret
toplogic=123456




# vi authz


[ / ]

toplogic=rw 



# vi  svnserve.conf


[general]

 anon-access=none
 auth-access=write
 password-db=passwd
 authz-db=authz
 realm=/home/svn/repositories











# vi /etc/sysconfig/iptables



-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 3690 -j ACCEPT

-A RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --dport 3690 -j ACCEPT

# service iptables restart



# service svnserve start

# ps -ef | grep svnserve | grep -v grep


root      3962     1  0 11:23 ?        00:00:00 /usr/bin/svnserve --daemon --pid-file=/var/run/svnserve.pid --threads --root /home/svn


# netstat -anp | grep svnserve


tcp        0      0 0.0.0.0:3690                0.0.0.0:*                   LISTEN      3962/svnserve





# svn mkdir svn://localhost/저장소이름/trunk
# svn mkdir svn://localhost/저장소이름/branches
# svn mkdir svn://localhost/저장소이름/tag



디렉토리를 생성하는 순간, 해당 디렉토리 관리 파일이 vi로 열린다.
:q 입력하여 vi 종료
변경되지 않았거나 지정되지 않았다며 취소(A), 계속(C), 수정(E) 로 물어보면 C를 누른다.
root 계정의 암호 입력
svn 사용자 및 비밀번호 입력

YES가 안되면 한글로 예 로 입력


---  svn 정지  -----
# service svnserve stop
                 or
# killall   -9    3962



2014. 3. 28.

[CentOS 6.4] rdate 설정



# yum install rdate

# vi /etc/rc.local

 rdate -s time.bora.net

 rdate -s time.kriss.re.kr 
(한국 표준 과학 연구소의 원자시계-타임서버-를 이용하게 됩니다.) 

# hwclock --systohc 
(시스템 시간과 hardware의 시간-CMOS에서의 시간-을 동기화.) 


# vi /etc/sysconfig/iptables

##### for rdate #####
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 123 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --dport 123 -j ACCEPT


# service iptables restart

2014. 3. 26.

[CentOS 6.4] Apache commons jar and Tomcat jar


Apache Commons Collections 4.0 (Java 5.0+)


Apache Commons Pool 2.2 (Java 6.0+)

Binaries

commons-pool2-2.2-bin.tar.gz
http://commons.apache.org/proper/commons-pool/download_pool.cgi

Apache Commons DBCP 2.0 for JDBC 4.1 (Java 7.0+)

Binaries

commons-dbcp2-2.0-bin.tar.gz
http://commons.apache.org/proper/commons-dbcp/download_dbcp.cgi

urlrewritefilter-4.0.3.jar
jimi.jar

2014. 3. 25.

[CentOS 6.4] php 5.5.8 -> php 5.2.8 downgrade



CentOS 6.4 32bit
Apache 2.4.4 
Mysql 5.6.15




./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-apxs2=/usr/local/apache/bin/apxs --with-config-file-path=/usr/local/lib --with-gd --with-freetype-dir=/usr/local/freetype --with-zlib --enable-sockets --enable-gd-native-ttf --with-png-dir=/usr/local/lib --with-jpeg-dir=/usr/local/lib --enable-sigchild --enable-magic-quotes --with-gettext --enable-mbstring --enable-inline-optimization --enable-bcmath --enable-shmop --enable-calendar --enable-ftp --with-gdbm --with-iconv=/usr/local/lib --enable-mbregex --with-imap --with-imap-ssl --with-openssl=/usr/local/openssl --with-curl --enable-soap --disable-debug --with-mcrypt=/usr/local/libmcrypt --with-kerberos



1. [ext/openssl/openssl.lo] Error 1 


/root/php-5.1.6/ext/openssl/openssl.c:206: error: expected specifier-qualifier-list before 'LHASH'
/root/php-5.1.6/ext/openssl/openssl.c:367: error: expected declaration specifiers or '...' before 'LHASH'
(中略)
/root/php-5.1.6/ext/openssl/openssl.c:2073: error: 'struct php_x509_request' has no member named 'priv_key_encrypt'


make: *** [ext/openssl/openssl.lo]  Error 1 



$ cd /usr/local/src
$ wget http://www.openssl.org/source/openssl-0.9.8e.tar.gz
$ tar zxvf openssl-0.9.8e.tar.gz
$ cd openssl-0.9.8e
$ ./config --prefix=/usr/local/openssl
$ make; make install



2.


/usr/local/src/php-5.2.8/ext/mysqli/mysqli.c: In function 'zm_startup_mysqli':

/usr/local/src/php-5.2.8/ext/mysqli/mysqli.c:644: error: 'MYSQL_RPL_MASTER' undeclared (first use in this function)
/usr/local/src/php-5.2.8/ext/mysqli/mysqli.c:644: error: (Each undeclared identifier is reported only once
/usr/local/src/php-5.2.8/ext/mysqli/mysqli.c:644: error: for each function it appears in.)
/usr/local/src/php-5.2.8/ext/mysqli/mysqli.c:645: error: 'MYSQL_RPL_SLAVE' undeclared (first use in this function)
/usr/local/src/php-5.2.8/ext/mysqli/mysqli.c:646: error: 'MYSQL_RPL_ADMIN' undeclared (first use in this function)
make: *** [ext/mysqli/mysqli.lo] Error 1
make: *** Waiting for unfinished jobs....

       -> mkdir /usr/local/mysql/include/mysql

           ln -s /usr/local/mysql/include/- /usr/local/mysql/include/mysql/
           make ZEND_EXTRA_LIBS = '-liconv' 


在安装nginx + mysql + php 的时候出现这样的错误:

/usr/local/src/php-5.2.15/ext/mysqli/mysqli.c:644: error: (Each undeclared identifier is reported only once
/usr/local/src/php-5.2.15/ext/mysqli/mysqli.c:644: error: for each function it appears in.)
/usr/local/src/php-5.2.15/ext/mysqli/mysqli.c:645: error: 'MYSQL_RPL_SLAVE' undeclared (first use in this function)
/usr/local/src/php-5.2.15/ext/mysqli/mysqli.c:646: error: 'MYSQL_RPL_ADMIN' undeclared (first use in this function)
make: *** [ext/mysqli/mysqli.lo] Error 1

这样真正的解决方法是:

修改/usr/local/include/mysql/mysql.h 文件内容:
mysql.h这个是根据个人安装的mysql路径来找  在mysql下面的include的mysql目录里  别搞错了)
找到
enum mysql_protocol_type 

MYSQL_PROTOCOL_DEFAULT, MYSQL_PROTOCOL_TCP, MYSQL_PROTOCOL_SOCKET, 
MYSQL_PROTOCOL_PIPE, MYSQL_PROTOCOL_MEMORY 
}; 

在这个中间添加这些内容
++++++++++++++++++++++++++++++++++++++++++++
/* 
There are three types of queries - the ones that have to go to 
the master, the ones that go to a slave, and the adminstrative 
type which must happen on the pivot connectioin 
*/ 
enum mysql_rpl_type 

MYSQL_RPL_MASTER, MYSQL_RPL_SLAVE, MYSQL_RPL_ADMIN 
};

++++++++++++++++++++++++++++++++++++++++++++
typedef struct character_set 

unsigned int number; /* character set number */ 
unsigned int state; /* character set state */ 
const char *csname; /* collation name */ 
const char *name; /* character set name */ 


3. make: *** [sapi/cli/php] Error 1 


--with-iconv=/usr/local/lib/



4.httpd: Syntax error on line 163 of /usr/local/apache/conf/httpd.conf: Cannot load modules/libphp5.so into server: /usr/local/apache/modules/libphp5.so: undefined symbol: unixd_config




아파치가 버전업하면서 해당 심볼의 명칭을 바꾼것으로 unixd_config 를 ap_unixd_config로 수정하면된다.
파일 위치는 php-5.2.xxx/sapi/apache2hander/php_functions.c
-       AP_DECLARE_DATA extern unixd_config_rec unixd_config;
+       AP_DECLARE_DATA extern unixd_config_rec ap_unixd_config;
 #endif
        for (n = 0; ap_loaded_modules[n]; ++n) {
@@ -414,7 +414,7 @@
        php_info_print_table_row(2, "Hostname:Port", tmp);
 #if !defined(WIN32) && !defined(WINNT) && !defined(NETWARE)
-       snprintf(tmp, sizeof(tmp), "%s(%d)/%d", unixd_config.user_name, unixd_config.user_id, unixd_config.group_id);
+       snprintf(tmp, sizeof(tmp), "%s(%d)/%d", ap_unixd_config.user_name, ap_unixd_config.user_id, ap_unixd_config.group_id);
이렇게 바꾸고 compile하고 실행하면 문제없이 실행된다.





2014. 3. 12.

[CentOS 6.4] named 설정





# rpm -qa | grep bind
samba-winbind-3.6.9-167.el6_5.i686
bind-chroot-9.8.2-0.23.rc1.el6_5.1.i686
bind-utils-9.8.2-0.23.rc1.el6_5.1.i686
samba-winbind-clients-3.6.9-167.el6_5.i686
rpcbind-0.2.0-11.el6.i686
bind-libs-9.8.2-0.23.rc1.el6_5.1.i686
bind-9.8.2-0.23.rc1.el6_5.1.i686
ypbind-1.20.4-30.el6.i686


# yum install bind* -y


# vi /etc/sysconfig/iptables




# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -p udp -m state --state NEW --dport 53 -j ACCEPT
-A INPUT -p tcp -m state --state NEW --dport 53 -j ACCEPT
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT

# service iptables restart


# vim /etc/named.conf


//

// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//

options {

        #listen-on port 53 { 127.0.0.1; };
        listen-on port 53 { any; };
#       listen-on-v6 port 53 { ::1; };
        directory       "/var/named";
        dump-file       "/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";
        memstatistics-file "/var/named/data/named_mem_stats.txt";
        #allow-query     { localhost; };
        allow-query       { any; };
        allow-query-cache { any; };
        query-source    port 53;
        query-source-v6 port 53;
        version "unknown";
        recursion yes;
        dnssec-enable yes;
        dnssec-validation yes;
        dnssec-lookaside auto;

        /* Path to ISC DLV key */

        bindkeys-file "/etc/named.iscdlv.key";

        managed-keys-directory "/var/named/dynamic";

};

logging {

        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};

zone "." IN {

        type hint;
        file "named.ca";
};

include "/etc/named.rfc1912.zones";

include "/etc/named.root.key";



symbolic link






/var/named/chroot/var/named/

/var/named

ln -s /var/named/chroot/var/named/




# service named restart







2014. 3. 7.

[CentOS 6.4] Apache 자동 실행 (서비스 데몬등록)



# cd /etc/init.d

# vi apache



#!/bin/sh
#
# Startup script for the Apache Web Server
#
# chkconfig: 345 85 15
# description: Apache is a World Wide Web server.
# processname: httpd
# pidfile: /var/run/httpd.pid
# config: /etc/httpd/conf/access.conf
# config: /etc/httpd/conf/httpd.conf
# config: /etc/httpd/conf/srm.conf

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

# See how we were called.
case "$1" in
  start)
    LS_COLORS=""
    CLASSPATH=""
    echo -n "Starting httpd: "
    #daemon httpd
    #daemon  /usr/local/apache/bin/apachectl startssl
    daemon  /usr/local/apache/bin/apachectl start
    echo
    touch /var/lock/subsys/httpd
    ;;
  stop)
    echo -n "Shutting down http: "
    killproc httpd
    echo
    rm -f /var/lock/subsys/httpd
    rm -f /var/run/httpd.pid
    ;;
  status)
    status httpd
    ;;
  restart)
    $0 stop
    sleep 2
    $0 start
    ;;
  reload)
    echo -n "Reloading httpd: "
    killproc httpd -HUP
    echo
    ;;
  *)
    echo "Usage: $0 {start|stop|restart|reload|status}"
    exit 1
esac

exit 0

[CentOS 6.4] Tomcat 자동 실행 (서비스 데몬등록)


# cd /etc/init.d

# vi tomcat


#!/bin/sh
# description: Tomcat Start Stop Restart
# processname: tomcat
# chkconfig: 234 20 80
#JAVA_HOME=/usr/local/java/jdk
#export JAVA_HOME
#PATH=$JAVA_HOME/bin:$PATH
#export PATH
#Source function library.
. /etc/rc.d/init.d/functions
source /etc/profile
export TOMCAT_HOME=/usr/local/tomcat
# See how we were called.
case "$1" in
start)
echo -n "Starting tomcat EXPERIMENTAL: "
daemon $TOMCAT_HOME/bin/startup.sh
echo
;;
stop)
echo -n "Shutting down tomcat EXPERIMENTAL: "
daemon $TOMCAT_HOME/bin/shutdown.sh
echo
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit 0


# chmod 755 tomcat
# chkconfig --add tomcat
# chkconfig --level 234 tomcat on
# chkconfig --list tomcat

2014. 2. 27.

[CentOS 6.4] mysql-connector-5.1.29 컴파일 설치



-> Error Massage 
org.apache.jasper.JasperException: An exception occurred processing JSP page


# wget http://ftp.plusline.de/mysql/Downloads/Connector-J/mysql-connector-java-5.1.29.tar.gz
# tar xvzf mysql-connector-java-5.1.29.tar.gz
# cd mysql-connector-java-5.1.29
# cp mysql-connector-java-5.1.29-bin.jar /usr/local/java/jdk/jre/lib/ext/
# service tomcat restart


Tomat tomcat 8.0 

cp mysql-connector-java-5.1.29-bin.jar /usr/local/tomcat/lib

2014. 1. 21.

[CentOS 6.4] tomcat-connector-1.2.37 컴파일 설치

# cd /usr/local/src

# wget http://apache.mirror.cdnetworks.com//tomcat/tomcat-connectors/jk/tomcat-connectors-1.2.37-src.tar.gz
# tar xvfz tomcat-connectors-1.2.37-src.tar.gz


# cd tomcat-connectors-1.2.37-src/native/
# ./buildconf.sh
# ./configure --with-apxs=/usr/local/apache/bin/apxs
# make; make install


# ls -l /usr/local/apache/modules/mod_jk.so
-rwxr-xr-x 1 root root 1113496 2013-08-16 15:08 /usr/local/apache/modules/mod_jk.so

mod_jk.so 파일이 없다면 아래 경로에서 확인하고 복사
#cd /usr/local/src/tomcat-connectors-1.2.37-src/native/apache-2.0/ 

# cp /usr/local/src/temp/tomcat-connectors-1.2.37-src/native/apache-2.0/mod_jk.so
/usr/local/apache/modules/mod_jk.so


# vi /usr/local/apache/conf/workers.properties

workers.tomcat_home=/usr/local/tomcat
workers.java_home=/usr/java/jdk
ps=/
worker.list=kickingplay
worker.kickingplay.type=ajp13
worker.kickingplay.host=localhost
worker.kickingplay.port=8009
worker.kickingplay.lbfactor=1
worker.kickingplay.connection_pool_timeout=600
worker.kickingplay.socket_keepalive=1


# vi /usr/local/apache/conf/httpd.conf

#### Tomcat-Connector setting by kickingPlay #### 
Include conf/mod_jk.conf


# vi /usr/local/apache/conf/mod_jk.conf

LoadModule jk_module modules/mod_jk.so
        JkWorkersFile conf/workers.properties
        JkShmFile logs/mod_jk.shm
        JkLogFile logs/mod_jk.log
        JkLogLevel info
        JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"
   Options FollowSymLinks
   #AllowOverride All



# vi /usr/local/apache/conf/extra/httpd-vhosts.conf 


   # ServerAdmin        webmaster@dummy-host.example.com
   DocumentRoot        "/kickingplay"
   JkMount                  /* kickingplay
   ServerName            localhost  ( IP address or Domain address)
   # ServerAlias          www.dummy-host.example.com
   # ErrorLog              "logs/dummy-host.example.com-error_log"
   # CustomLog          "logs/dummy-host.example.com-access_log" common



# vi /usr/local/tomcat/conf/server.xml










# /usr/local/apache/bin/apachectl stop

# /usr/local/apache/bin/apachectl start

# /usr/local/tomcat/bin/shutdown.sh

# /usr/local/tomcat/bin/startup.sh


Document root에 index.html, index.jsp넣어 확인
 - localhost://index.html
 - localhost://index.jsp 확인
 - index.jsp는 다음과 같이 간단한 jsp코드를 넣어 서블릿 실행되는 지 확인