티스토리 뷰

직업이야기

APM & Tomcat Source Install

겸이 2012. 6. 28. 13:46

목차



    728x90

    이건 나의 작업일지다..

    따라하고서 안된다고 징징대기 없기..

     

    wget http://www.openssl.org/source/openssl-1.0.1c.tar.gz

     

    ./Configure linux-x86_64 -fPIC

     $ ./config -fPIC

      $ make

      $ make test

      $ make install

     

     

    wget http://apache.tt.co.kr/httpd/httpd-2.4.2.tar.gz

     

    tar xvfz httpd-2.4.2.tar.gz

    cd httpd-2.4.2

    yum install openssl*

     

    cd srclib/

     

    wget http://apache.tt.co.kr/apr/apr-1.4.6.tar.gz

    tar xvfz apr-1.4.6.tar.gz

    mv apr-1.4.6 apr

     

    wget http://apache.tt.co.kr/apr/apr-util-1.4.1.tar.gz

    tar xvfz apr-util-1.4.1.tar.gz

    mv apr-util-1.4.1 apr-util

     

    yum install pcre-devel

     

    ./configure --prefix=/usr/local/apache --with-ssl=/usr/local/ssl --with-included-apr --enable-mods-shared=all --enable-so --enable-ssl --enable-modules=ssl --enable-rewrite

    make

    make install

    cd /usr/local/apache/

    cp bin/apachectl /etc/init.d/httpd

     

    vi /etc/init.d/httpd  <- vi httpd파일을 열고 아래내용을 맨 밑에 추가한다.

                

    # chkconfig: 2345 90 90

    # description: init file for Apache server daemon

    # processname: /usr/local/apache/bin/apachectl

    # config: /usr/local/apache/conf/httpd.conf

    # pidfile: /usr/local/apache/logs/httpd.pid

     

    chkconfig --add httpd

    chkconfig --list | grep httpd

     

     

    wget http://mirror.apache-kr.org/tomcat/tomcat-7/v7.0.27/bin/apache-tomcat-7.0.27.tar.gz

     

    tar xvfz apache-tomcat-7.0.27.tar.gz

    mv apache-tomcat-7.0.27 /usr/local/tomcat

     

    wget http://www.php.net/get/php-5.4.4.tar.gz/from/kr.php.net/mirror

     

    tar xvfz php-5.4.4.tar.gz

    cd php-5.4.4

    yum -y install libxml2-devel

    yum -y install libmcrypt-devel

    CentOS 5.x

     ./configure  --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-config-file-path=/usr/local/apache/conf --disable-debug --enable-sockets --enable-mod-charset --enable-calendar --enable-sysvsem=yes --enable-sysvshm=yes --enable-ftp --enable-gd-native-ttf --enable-inline-optimization --enable-bcmath --with-zlib --with-jpeg-dir=/usr --with-png-dir=/usr/lib --with-freetype-dir=/usr --with-libxml-dir=/usr --enable-exif --with-gd --with-gettext --enable-sigchild enable-mbstring with-mcrypt

    CentOS 6.x

    ./configure  --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-config-file-path=/usr/local/apache/conf --disable-debug --enable-sockets --enable-mod-charset --enable-calendar --enable-sysvsem=yes --enable-sysvshm=yes --enable-ftp --enable-gd-native-ttf --enable-inline-optimization --enable-bcmath --with-zlib  --with-png-dir=/usr/lib --with-freetype-dir=/usr --with-libxml-dir=/usr --enable-exif --with-gd --with-gettext --enable-sigchild

    make

    make test

    make install

     

    # cp php.ini-production /usr/local/apache/conf/php.ini    php 설정파일을 아파치가 설치된 디렉토리의 conf 디렉토리로 복사

    # vi /usr/local/apache/conf/httpd.conf    아파치 환경설정파일을 열어 아래의 내용을 추가/수정 한다.

     

    # 수정

    <IfModule dir_module>

     DirectoryIndex index.html index.htm index.php

    </IfModule>

     

    # AddType 지시어 추가

    <IfModule mime_module>

     

      AddType application/x-compress .Z

      AddType application/x-gzip .gz .tgz

     

      밑에부분에 추가

     

      AddType application/x-httpd-php .php .htm .html .inc .php4 .php3

      AddType application/x-httpd-php-source .phps

     

    </IfModule>

     

    vi /usr/local/apache/conf/php.ini

    short_open_tag = Off <- On 으로 수정(<?php <? 로도 사용 가능하게 한다)

     

     6) php 설치가 제대로 됐는지 테스트 해본다.

     

    # /etc/init.d/httpd restart    바뀐 환경설정 적용을 위해 아파치데몬 재시작

     

     

    wget http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.22.tar.gz/from/http://ftp.jaist.ac.jp/pub/mysql/

     

    tar xvfz mysql-5.5.22.tar.gz

    cd mysql-5.5.22

    shell> groupadd mysql

    shell> useradd -r -g mysql mysql

    shell> cd /usr/local

    shell> tar zxvf /path/to/mysql-VERSION-OS.tar.gz

    shell> ln -s full-path-to-mysql-VERSION-OS mysql

    shell> cd mysql

    shell> chown -R mysql .

    shell> chgrp -R mysql .

    shell> scripts/mysql_install_db --user=mysql

    shell> chown -R root .

    shell> chown -R mysql data

    # Next command is optional

    shell> cp support-files/my-medium.cnf /etc/my.cnf

    shell> bin/mysqld_safe --user=mysql &

    # Next command is optional

    shell> cp support-files/mysql.server /etc/init.d/mysql.server

     

     

     wget http://download.oracle.com/otn-pub/java/jdk/7u3-b04/jdk-7u3-linux-x64.tar.gz

     

    tar xvfz jdk-7u3-linux-x64.tar.gz

    mv jdk1.7.0_03/ /usr/local/java

     

     

    or

    sh jdk-6u25-linux-i586.bin

    mv jdk1.6.0_25/ /usr/local/java

     

    cd /etc/

    vi profile - /etc/profile 수정 - 아래 내용 추가

    export JAVA_HOME=/usr/local/java

    export CATALINA_HOME=/usr/local/tomcat

    PATH=$PATH:/usr/local/java/bin

    export PATH

     

    source /etc/profile

     

     

    톰캣 시작

    cd /usr/local/tomcat/

    ./bin/startup.sh

     

    tomcat native 설치

     

    yum install apr-devel

    cd bin/

    tar xvfz tomcat-native.tar.gz

    cd /usr/local/tomcat/bin/tomcat-native-1.1.23-src/jni/native/

    ./configure --with-apr=/usr/bin/apr-1-config -with-java-home=/usr/local/java --with-ssl=yes --prefix=/usr/local/tomcat

    make

    make install

     

     

     

    JDBC 설치

     wget http://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.19.tar.gz/from/http://ftp.jaist.ac.jp/pub/mysql/

     

    tar xvfz mysql-connector-java-5.1.19.tar.gz

    cd mysql-connector-java-5.1.19

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

     

     

    jk 모듈 설치

    wget http://mirror.apache-kr.org/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

    ./configure --with-apxs=/usr/local/apache/bin/apxs

    make

    make install

     

     

     

    * httpd.conf 설정

    vi /usr/local/apache/conf/httpd.conf - 아래 내용 추가

    # mod_jk

    Include conf/extra/mod_jk.conf

     

    vi /usr/local/apache/conf/extra/mod_jk.conf - 아래 내용 작성

    # Load mod_jk module

    # Update this path to match your modules location

    LoadModule jk_module modules/mod_jk.so

    # Declare the module for <IfModule directive> (remove this line on Apache 2.x)

    # AddModule mod_jk.c

    # Where to find workers.properties

    # Update this path to match your conf directory location (put workers.properties next to httpd.conf)

    JkWorkersFile /usr/local/apache/conf/extra/workers.properties

    # Where to put jk shared memory

    # Update this path to match your local state directory or logs directory

    JkShmFile /usr/local/apche/logs/mod_jk.shm

    # Where to put jk logs

    # Update this path to match your logs directory location (put mod_jk.log next to access_log)

    JkLogFile /usr/local/apache/logs/mod_jk.log

    # Set the jk log level [debug/error/info]

    JkLogLevel info

    # Select the timestamp log format

    JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "

    # Send everything for context /examples to worker named worker1 (ajp13)

    # JkMount /examples/* worker1

    <IfModule mod_jk>

    JkMount /*.jsp worker1

    JkMount /*.do worker1

    #-> 확장자가 jsp 혹은 do로 끝날경우 worker1 작업자에게 넘겨라는 의미라고 보시면 됩니다.

    </IfModule>

     

    * workers.properties 생성 및 설정

    cp /apm/tomcat-connectors-1.2.35-src/native/iis/installer/conf/workers.properties.minimal /usr/local/apache/conf/extra/workers.properties

    vi /usr/local/apache/conf/extra/workers.properties - 아래 내용 수정

    # The workers that jk should create and work with

    worker.list=wlb,jkstatus

    #-> mod_jk.conf에서 jkMount 지시어로 설정한 worker를 넣어줍니다.

    worker.list=worker1

    # Defining a worker named ajp13w and of type ajp13

    # Note that the name and the type do not have to match.

    #worker.ajp13w.type=ajp13

    #worker.ajp13w.host=localhost

    #worker.ajp13w.port=8009

    #-> worker worker1으로 하였으므로 변경해 줍니다.

    worker.worker1.type=ajp13

    worker.worker1.host=localhost

    worker.worker1.port=8009

    # Defining a load balancer

    #worker.wlb.type=lb

    #worker.wlb.balance_workers=ajp13w:wq

    # Define status worker

    #worker.jkstatus.type=status

     

    * vi /usr/local/apache/conf/httpd.conf - 인덱스 페이지 등록

    <IfModule dir_module>

    DirectoryIndex index.html index.jsp

    </IfModule>

     

    OpenSSL 설정

     

    httpd.conf 수정

    Include conf/extra/httpd-mpm.conf

    Include conf/extra/httpd-vhosts.conf

    Include conf/extra/httpd-default.conf

    Include conf/extra/httpd-ssl.conf

     

    [apache]

    1. httpd.conf

                 # mod_jk

                 Include conf/extra/mod_jk.conf

                

                 Include conf/extra/httpd-ssl.conf

                

                 <VirtualHost *:80>

                     ServerAdmin sysinfo@kr.net

                     DocumentRoot /data/WebRoot/www.globalpaymentsvc.com

                     ServerName www.globalpaymentsvc.com

                     ErrorLog logs/www.globalpaymentsvc.com-error_log

                     CustomLog logs/www.globalpaymentsvc.com-access_log common

                     JkMount / worker1

                               JkMount /* worker1

                 </VirtualHost>

                

                

    2. mod_jk.conf

                 JkMount /*.jsp worker1

                 JkMount /*.do worker1

                

    3. httpd-ssl.conf (인증서 파일 Copy)

                 Listen 11000

                              

                 <VirtualHost 192.168.1.164:11000>

                     ServerAdmin sysinfo@kr.net

                     DocumentRoot /data/WebRoot/www.globalpaymentsvc.com

                     ServerName www.globalpaymentsvc.com:11000

                     ServerAlias globalpaymentsvc.com

                     ErrorLog logs/globalpaymentsvc.com-error_log

                     CustomLog logs/globalpaymentsvc.com-access_log common

                     JkMount / worker1

                               JkMount /* worker1

                              

                     SSLEngine on

                     SSLCertificateFile /usr/local/apache/conf/www.globalpaymentsvc.com.crt

                     SSLCertificateKeyFile /usr/local/apache/conf/www.globalpaymentsvc.com.key

                 #    SSLCertificateChainFile /usr/local/apache/conf/intermediateCAcertificate.crt 

                 #    SSLCACertificateFile /usr/local/apache/conf/Verisign_Chain.cer

                     SSLCACertificateFile /usr/local/apache/conf/chainca.crt

                 </VirtualHost>

                

    4. conf/extra/workers.properties

                

                 worker.list=worker1

                 worker.worker1.type=ajp13

                 worker.worker1.host=localhost

                 worker.worker1.port=8009

                

     

    [tomcat]

    1. server.xml

     

    2. Catalina/www.globalpaymentsvc.com

     

     

    [web.xml]

    1. DB 설정 확인

     

     

     

     

    /etc/rc.local 등록

    /usr/local/apache/bin/apachectl start

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

    '직업이야기' 카테고리의 다른 글

    Cloudera Manager ??  (2) 2018.07.17
    사내 보안 강의 수강중인데...  (0) 2017.11.22
    헤드헌터들에게 고함..  (0) 2017.11.02
    SQL 서버의 리눅스 지원이라..  (0) 2017.11.01
    Logrotate 설정하기  (0) 2012.06.29