본문 바로가기

Linux/설치

[ Linux]linux+JAVA+Apache+Tomcat+Oracle+Mysql+PHP+Curl Setting ]

[ Linux  JAVA+Apache+Tomcat+Oracle+Mysql+PHP+Curl Setting ]


OS : Linux RedHat 7.3 Kernel 2.4.20-28.7
    7.3  설치시 journal관련 kernel BUG 예방을 위해 기본커널(2.4.18-3)에 대한 적용
     - RedHat 7.3 커널 업데이트 참조

JAVA  : j2sdk-1_4_2_10-linux-i586.bin
Oracle  : Oracle9i (9.2.0.4.0)
Mysql  : mysql-4.0.27.tar.gz
Curl   : curl-7.15.5.tar.gz
Apache : httpd-2.0.55.tar.gz
Tomcat  : jakarta-tomcat-4.1.31-LE-jdk14.tar.gz
connector: jakarta-tomcat-connectors-1.2.15-src.tar.gz
     mysql-connector-java-3.1.13.tar.gz


 1. JAVA설치
chomd +x j2sdk-1_4_2_10-linux-i586.bin
./j2sdk-1_4_2_10-linux-i586.bin
mv j2sdk-1_4_2_10 /usr/local/java


 2. Oracle 설치
Oracle 9i (9.2.0.4.0) Installation Guide 참조


 3. Mysql 설치
wget http://dev.mysql.com/get/Downloads/MySQL-4.0/mysql-4.0.27.tar.gz/from/http://mysql.holywar.net/

 *) 설치전 기존 rpm 확인 후 삭제
rpm -e apache --nodeps
rpm -e php --nodeps
rpm -e mysql --nodeps

./configure --prefix=/usr/local/mysql --with-charset=euc_kr
make ; make install
/usr/local/mysql/bin/mysql_install_db &
 chown -R mysql /usr/local/mysql/var/
/usr/local/mysql/share/mysql/mysql.server start


 4. Curl
wget http://curl.haxx.se/download/curl-7.15.5.tar.gz

./configure --prefix=/usr /local/curl
make ; make install


 5. Apache
wget http://archive.apache.org/dist/httpd/httpd-2.0.55.tar.gz

./configure --prefix=/usr/local/apache --enable-mods-shared=most
make
 make 실행 후 srclib/apr/.libs 에 libapr-0.so.0.9.7 파일과 심볼릭 링크들이 없을 경우 install시에 apache/lib 에 libapr이 생성이 되지 않기 때문에
 tomcat을 연동하기 위한 mod_jk.so 파일 생성시 문제가 발생하므로 configure 옵션 또는 기타 다른 부분을 점검해서 꼭 libapr-0.so.0.9.7 파일이 생성 되도록 해야 한다.
make install

- 설치 확인 및 버전 확인
/usr/local/apache/bin 으로 이동
./apachectl -v
./apachectl start
ps auwx | grep httpd


 6. Tomcat
wget http://archive.apache.org/dist/jakarta/tomcat-4/v4.1.31/bin/jakarta-tomcat-4.1.31-LE-jdk14.tar.gz

tar zxvf jakarta-tomcat-4.1.31-LE-jdk14.tar.gz
mv jakarta-tomcat-4.1.31 /usr/local/


 7. apache-tomcat connector
wget http://www.apache.org/dist/tomcat/tomcat-connectors/jk/source/jk-1.2.15/jakarta-tomcat-connectors-1.2.15-src.tar.gz

tar zxvf jakarta-tomcat-connectors-1.2.15-src.tar.gz
cd CONNECTOR_HOME/jk/native
./buildconf.sh
./configure --with-apxs=/usr/local/apache/bin/apxs
make
make install

ls /usr/local/apache/modules 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=$JAVA_HOME

vi /usr/local/apache/conf/mod_jk.conf
LoadModule jk_module /usr/local/apache/modules/mod_jk.so
JkWorkersFile /usr/local/apache/conf/workers.properties
JkLogFile /usr/local/apache/logs/mod_jk.log
JkLogLevel error
JkMount /*.jsp ajp13
JkMount /servlet/* ajp13

echo "include \"/usr/local/apache/conf/mod_jk.conf\"" >> /usr/local/apache/conf/httpd.conf

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

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


 8. java-mysql connector
wget http://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-3.1.13.tar.gz/from/http://mysql.holywar.net/
tar zxvf
cp mysql-connector-java-3.1.13/mysql-connector-java-3.1.13-bin.jar $JAVA_HOME/lib/

PATH 설정

vi /etc/profile

export JAVA_HOME=/usr/local/java
export TOMCAT_HOME=/usr/local/tomcat
export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib/mysql-connector-java-3.1.13-bin.jar:$JAVA_HOME/lib/tools.jar:$TOMCAT_HOME/common/lib/servlet.jar:$TOMCAT_HOME/common/lib/classes12.jar

 *) classes12.jar 는 oracle driver 이며 $ORACLE_HOME/jdbc/lib/classes12.jar 를 복사해준다.
 

./configure \
--prefix=/usr/local/php \
--with-curl=/usr/local/curl \
--with-mysql=/usr/local/mysql \
--with-apxs2=/usr/local/apache/bin/apxs \
--enable-track-vars \
--enable-magic-quotes \
--with-language=korean \
--with-charset=euc_kr \
--disable-debug \
--with-xml \
--with-gdbm \
--enable-module=so \
--with-config-file-path=/usr/local/php \
--with-kerberos \
--with-imap-ssl \
--enable-sockets \
--with-gd-dir \
--with-jpeg-dir \
--with-zlib-dir \
--with-ttf \
--enable-ftp \
--enable-calendar \
--enable-mod-charset \
--disable-posix-threads \
--enable-exif \
--with-oci8=/u01/app/oracle/product/9.2.0

make ; make install

cp php.ini-dist /usr/local/php/php.ini

vi /usr/local/apache/conf/httpd.conf
~
#Tell Apache to parse certain extensions as PHP.  For example,
#let's have Apache parse the .php extension as PHP.  You could
#have any extension(s) parse as PHP by simply adding more, with
#each separated by a space.  We'll add .phtml to demonstrate.
  AddType application/x-httpd-php .php .phtml
#It's also common to setup the .phps extension to show highlighted PHP
#source, this can be done with:
  AddType application/x-httpd-php-source .phps

/usr/local/apache/bin/apachectl restart