달력

5

« 2024/5 »

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
2017. 7. 2. 22:26

APM + GD + Tomcat + JDK 설치하기 C. Oracle2017. 7. 2. 22:26


★FreeType의 설치
http://www.freetype.org 에서 다운받는다
## rpm -qa | grep freetype
## rpm -e freetype --nodeps
## tar zxvf freeType-2.1.10.tar.gz
## ./configure
## make && make install

★jpeg의 설치
http://www.ijg.org 에서 다운받는다
## rpm -qa | grep jpeg
## rpm -e libjpeg --nodeps
## tar zxvf jpegsrc.v6b.tar.tar
## cd jpeg-6b
## mkdir /usr/local/man
## mkdir /usr/local/man/man1
## ./configure --enable-shared --enable-static
## make && make install

★libpng의 설치
http://www.libpng.org 에서 다운받는다
## rpm -qa | grep libpng
## rpm -e libpng --nodeps
## tar zxvf libpng-1.2.8-config.tar.gz
## cd libpng-1.2.8-config
## cp scripts/makefile.linux Makefile
## make test && make install

★GD의 설치
http://www.boutel.com/gd/ 에서 다운받는다
## rpm -qa | grep gd
## tar zxvf gd-2.0.33.tar.gz
## cd gd-2.0.33
## ./configure --prefix=/usr/local/gd
## make && make install

★MySQL의 설치
http://www.mysql.com 에서 다운받는다
## groupadd mysql
## useradd -g mysql mysql
## tar zxvf mysql-5.0.15.tar.gz
## ./configure --prefix=/usr/local/mysql --localstatedir=/usr/local/mysql/data    //data가 실제DB 파일이다.
## make
## make install
## cp support-files/my-medium.cnf /etc/my.cnf    //mysql의 설정파일이다
## cd /usr/local/mysql
## bin/mysql_install_db --user=mysql
## chown -R root  .
## chown -R mysql data
## chgrp -R mysql .
## bin/mysqld_safe --user=mysql &

★Apache2의 설치
http://www.apache.org 에서 다운받는다
## tar zxvf httpd-2.0.55.tar.gz
## ln -s httpd-2.0.55/ httpd
## cd httpd
## ./configure --enable-so
## make
## make install

★PHP5의 설치
http://php.net 에서 다운받는다
## tar zxvf php-5.0.5.tar.gz
## ln -s php-5.0.5 php
## cd php
## ./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql/ --with-mysql-sock=/tmp --with-gd --with-gdbm --with-freetype-dir --with-png-dir --with-zlib --with-jpeg-dir
## make
## make install

## cp php.ini-dist /usr/local/lib/php.ini
## vi /usr/local/apache2/conf/httpd.conf
다음을 추가한다.
AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps

DirectoryIndex index.html index.htm index.php index.php

 

-----------------------------------------------------------------------------------------------------------------------

※Fedora4 의 bison 버젼은 2.0X 버젼이다 php5.0.5버젼설치는 bison 1.X 버젼에서 가능하다.
Fedora4 에서의 php 설치시 5.1.1을 다운받아서 설치한다.(2005년11월29일현재 최신버젼)

★ZendOptimizer의 설치
PHP ZendOptimizer는 PHP소스코드를 분석하여 최적화한 다음 실행하므로 웹서비스의 속도를 향상시킬수 있다.


http://zend.com 에서 다운받는다
123we@yahoo.com  // qwer@1234
##tar zxvf ZendOptimizer-2.5.10a-linux-glibc21-i386.tar.gz
##cd ZendOptimizer-2.5.10a-linux-glibc21-i386
##sh install.sh
다음다음을 계속 누르면 설치가 된다( !!※httpd가 실행중이어야 설치가 된다※!!)

★JDK의 설치
http://java.sun.com 에서 다운받는다.
jdk-1_5_0_05-linux-i586-rpm.bin

##chmod +x jdk-1_5_0_05-linux-i586-rpm.bin
##./jdk-1_5_0_05-linux-i586-rpm.bin
##ln -s /usr/java/jdk1.5.0_05  /usr/java/jdk
##vi /etc/profile
맨밑에 다음과 같이 추가한다.

export JAVA_HOME=/usr/java/jdk                          //java path를 지정해 주는 부분이다.
export CLASSPATH=.:$JAVA_HOME/lib
export PATH=$PATH:$JAVA_HOME/bin:$CLASSPATH

환경설정을 해준다
##source /etc/profile

alternatives java, javac를 추가해 준다
##alternatives --install  /usr/bin/java  java  /usr/java/jdk/bin/java  2
##alternatives --install  /usr/bin/javac  javac  /usr/java/jdk/bin/javac  2

★Tomcat의 설치
http://tomcat.apache.org 에서 받을수 있다
##tar zxvf apache-tomcat-5.5.12.tar.gz
##cp -R apache-tomcat-5.5.12 /usr/local/tomcat


##vi /etc/profile  //Tomcat 환경설정
마지막에 다음과 같이 추가
export CATALINA_HOME=/usr/local/tomcat 을 추가하자

##source /etc/profile  // 환경저장

##/usr/local/apache/bin/apachectl stop    // 톰캣을 실행하기 위해 아파치를 stop 시킨다
##/usr/local/tomcat/bin/startup.sh start     // 톰캣을 실행한다.
##/usr/local/apache/bin/apachectl start    // 아파치를 실행한다.

http://10.10.10.244:8080 으로 확인

★Tomcat-connector의 설치
http://tomcat.apache.org 에서 받을수 있다

 tomcat 연동을 위한 mod_jk 연동모듈 생성
##tar zxvf jakarta-tomcat-connectors-jk2-2.0.4-src.tar.gz
##cd jakarta-tomcat-connectors-jk2-2.0.4-src/jk/native2
##./configure --with-apxs2=/usr/local/apache/bin/apxs
##make
##cd ../build/jk2/apache2
##cp mod_jk2.so /usr/local/apache/modules   
##cp /usr/local/src/jakarta-tomcat-connectors-jk2-2.0.4-src/jk/conf/workers2.properties /usr/local/apache/conf

## vi /usr/local/apache/conf/httpd.conf
다음과 같이 추가
LoadModule   jk2_module    modules/mod_jk2.so
 
##vi /usr/local/apache/conf/workers2.properties

기존의 내용 삭제 후 다음과 같이 새로 작성
# Shared memory handling. Needs to be set.
[shm]
file=/var/log/httpd/shm.file
size=1048576
 
# Example socket channel, explicitly set port and host.
[channel.socket:localhost:8009]
port=8009
host=127.0.0.1

 # define the worker
[ajp13:localhost:8009]
channel=channel.socket:localhost:8009
 
# Announce a "status" worker
[status:status]
 
# Uri mapping
[uri:/jsp-examples/*]
worker=ajp13:localhost:8009

[uri:/servlets-examples/*]
worker=ajp13:localhost:8009

[uri:/tomcat-docs/*]
worker=ajp13:localhost:8009

[uri:/status/*]
worker=status:status

[uri:/manager/*]
worker=ajp13:localhost:8009

[uri:/admin/*]
worker=ajp13:localhost:8009

[uri:/*.jsp]
worker=ajp13:localhost:8009

jk2.properties 파일 편집

##cd /usr/local/tomcat/conf/
##vi jk2.properties

## THIS FILE MAY BE OVERRIDEN AT RUNTIME. MAKE SURE TOMCAT IS STOPED
## WHEN YOU EDIT THE FILE.

## COMMENTS WILL BE _LOST_

## DOCUMENTATION OF THE FORMAT IN JkMain javadoc.
 
# Set the desired handler list
# handler.list=apr,request,channelJni
#
# Override the default port for the socketChannel
channelSocket.port=8009
# Default:
# channelUnix.file=$jkHome/work/jk2.socket
# Just to check if the the config  is working
# shm.file=$jkHome/work/jk2.shm
shm.file=/var/log/httpd/jk2.shm

# In order to enable jni use any channelJni directive
# channelJni.disabled = 0
# And one of the following directives:

# apr.jniModeSo=/opt/apache2/modules/mod_jk2.so

# If set to inprocess the mod_jk2 will Register natives itself
# This will enable the starting of the Tomcat from mod_jk2
apr.jniModeSo=inprocess


JSP가 잘 뜨는지 확인해 보자
 DirectoryIndex 부분에 index.jsp 추가

##vi /usr/local/apache/conf/httpd.conf 에 다음을 추가하자

DirectoryIndex index.html index.html.var index.php index.jsp

JSP 테스트
##cd /usr/local/tomcat/webapps/ROOT
##vi test.jsp
<%
out.println("Hello World! JSP");
%>

---------------------------------------------------------------------------------------------------------


:
Posted by sfeg