리눅스, 자료실, 성경검색, 추억의게임, 고전게임, 오락실게임, rootman, http://www.rootman.co.kr
* 54.224.118.247 *
| Home | Profile | Linux | 자료실 | zabbix | Mysql 5.6 | 갤러리 | 성경검색 | 해피니스 | 자유게시판 | 게시물검색 | L | O | R |    

 
[Doc/Faq] APM+Zend+gd+imap+Tomca+JDBC+JDK1.3
 작성자 : rootman
Date : 2003-07-21 13:27  |  Hit : 22,490  
------------------------------------------------------------------------------------------
#. 설치에 필요한 파일 다운받기
------------------------------------------------------------------------------------------
mysql-3.23.58.tar.gz ( http://www.rootman.co.kr/bbs/zboard.php?category=6&id=dataroom )
apache_1.3.34.tar.gz ( http://www.rootman.co.kr/bbs/zboard.php?category=4&id=dataroom )
php-4.4.1.tar.gz ( http://www.rootman.co.kr/bbs/zboard.php?category=5&id=dataroom )
ZendOptimizer-2[1].1.0-Linux_glibc21-i386.tar ( http://www.rootman.co.kr/bbs/zboard.php?category=12&id=dataroom )
jakarta-tomcat.tar.gz ( http://jakarta.apache.org/builds/tomcat/release/v3.1/bin/jakarta-tomcat.tar.gz )
mod_jserv.so ( http://jakarta.apache.org/builds/tomcat/release/v3.1/bin/linux/i386/mod_jserv.so )
JDK 1.1 이상 mm.mysql-2.0.2-bin.jar : mysql용 jdbc gd, imap
http://www.fastio.com : pdflib-4.0.2.tar.gz
http://www.pdflib.com : clibpdf202r1.tar.gz
http://freetype.sourceforge.net/download.html
http://www.libtiff.org
ftp://sunsite.unc.edu/pub/Linux/libs/graphics/


---------------------------------------------------------------------------------
#. RPM으로 설치된 패키지 제거하기
---------------------------------------------------------------------------------
지금부터의 작업은 반드시 root의 권한으로 해야 한다.
배포본 리눅스에 기본적으로 설치되어 있는 RPM 패키지를 제거한다.

[[email protected] root]# service httpd stop
[[email protected] root]# rpm -e apache --nodeps


--------------------------------------------------------------
#. MySQL, Apache, PHP4 바이너리 파일 압축풀기
--------------------------------------------------------------
tmp 디렉토리에 있는 tar.gz 소스 파일들을 푼다.
[[email protected] root]# tar zxvf mysql-3.23.58.tar.gz
[[email protected] root]# tar zxvf apache_1.3.34.tar.gz
[[email protected] root]# tar zxvf php-4.4.1.tar.gz
[[email protected] root]# tar zxvf ZendOptimizer-RC1-Linux-glibc2.1.tar.gz
[[email protected] root]# tar zxvf jakarta-tomcat.tar.gz
[[email protected] root]# tar zxvf imap-4.7b-patch.tar.gz
[[email protected] root]# tar zxvf gd1_5.tar.gz
[[email protected] root]# tar zxvf jsdk20-solaris2-sparc.tar.Z

주: mod_jserv.so (풀지 않고 그대로 사용합니다.)

mm.mysql-2.0.2-bin.jar


---------------------------------------------------------------
#. MySQL 설치
---------------------------------------------------------------
[[email protected] root]# cd mysql-3.23.27
[[email protected] /mysql-3.23.58]#
./configure --prefix=/usr/local/mysql --with-charset=euc_kr --with-berkeley-db --localstatedir=/usr/local/mysql/data
[[email protected] /mysql-3.23.58]# make && make install


- 디렉토리를 별로로 지정하시려면
--localstatedir=/usr/local/mysql/data 으로 하면 된다.

- 재컴파일을 하여야 할 시
make distclean 명령수행

[[email protected] root]# useradd mysql -s /bin/false <----- mysql 유저생성을 해준다.<BR>[[email protected] root]# chown -R mysql.mysql /usr/local/mysql/data <--- 소유권변경<BR>[[email protected] root]# cd /usr/local/mysql/bin && ./mysql_install_db
[[email protected] /bin]# safe_mysqld --language=korean &
[[email protected] /bin]# mysqladmin -u root password 'new-pass'[enter]
[[email protected] root]# cp /usr/local/mysql/share/mysql/my-medium.cnf /etc/my.cnf
[[email protected] root]# vi /etc/my.cnf
# The MySQL server
[mysqld]
set-variable = max_connections=3000
set-variable = wait_timeout=30
[[email protected] root]#


------------------------------------------------------------------------------------------
#. IMAP 소스디텍토리를 /usr/local/imap으로 바꾸고 아래와 같이 컴파일한다.
------------------------------------------------------------------------------------------
[[email protected] imap]# rpm -qa|grep imap <----- imap 이 설치 되어 있는가 확인<BR>[[email protected] imap]# make slx or make lrh <----- redhat linux 9.0 에서는 make lrh<BR> 리눅스에 맞게 컴파일하기 위해 make 뒤에 slx 옵션을 붙여준다.
컴파일이 완료되면 imapd 디렉토리에 imapd가 ipopd디렉토리에는 ipop2d, ipop3d가 생성된다.

[[email protected] imap]# cp ipopd/ipop[23]d /usr/sbin/
[[email protected] imap]# cp imapd/imapd /usr/sbin/


::: redhat 6.2 일경우 :::
[[email protected] imap]# vi /etc/inetd.conf
pop-2 stream tcp nowait root /usr/sbin/tcpd ipop2d
pop-3 stream tcp nowait root /usr/sbin/tcpd ipop3d
imap stream tcp nowait root /usr/sbin/tcpd imapd

/etc/inetd.conf 파일을 열어서 주석을 풀어준다.

[[email protected] imap]# killall -HUP inetd


::: redhat 7.x :::
[[email protected] xinetd.d]# cat > imapd
service imap
{
disable = no
socket_type = stream
wait = no
user = root
server = /usr/sbin/imapd
log_on_success += DURATION USERID
log_on_failure += USERID
}

[[email protected] xinetd.d]# cat > ipop3d
service pop3
{
disable = no
socket_type = stream
wait = no
user = root
server = /usr/sbin/ipop3d
log_on_success += USERID
log_on_failure += USERID
}

[[email protected] xinetd.d]# vim /etc/services
......
pop3 110/tcp pop-3 # POP version 3
pop3 110/udp pop-3
imap2 143/tcp imap # Interim Mail Access
imap2 143/udp
imap

위와 같이 주석을 풀어준다.

[[email protected] xinetd.d]# /etc/rc.d/init.d/xinetd restart
[[email protected] imap]# telnet localhost 143 <----- imap 으로 접속을 시도한다.<BR>
[[email protected] imap]# cp /usr/local/imap/c-client/c-client.a /usr/lib/libc-client.a
[[email protected] imap]# mkdir /usr/local/include
[[email protected] imap]# cp /usr/local/imap/c-client/mail.h /usr/local/include
[[email protected] imap]# cp /usr/local/imap/c-client/rfc822.h /usr/local/include
[[email protected] imap]# cp /usr/local/imap/c-client/linkage.h /usr/local/include


==========================================================================================
#. zlib -> libpng -> freetype -> jpeg -> libtiff -> t1lib 그래픽 라이브러리
==========================================================================================
#. zlib GD graphics library 구하기
------------------------------------------------------------------------------------------
[[email protected] zlib-1.2.3] ./configure -s && make ----------> libz.a 를 만든다.
[[email protected] zlib-1.2.3] ./configure && make test && make install
[[email protected] zlib-1.2.3] cp libz.so* /usr/local/lib
[[email protected] zlib-1.2.3] cd /usr/local/lib; rm -rf libz.so; rm -rf libz.so.1
[[email protected] zlib-1.2.3] ln -s libz.so.1.1.4 libz.so; ln -s libz.so.1.1.4 libz.so.1

------------------------------------------------------------------------------------------
#. libpng 지원 라이브러리 설치
------------------------------------------------------------------------------------------
[[email protected] libpng]# make -f scripts/makefile.std CC=gcc ZLIBLIB=../zlib ZLIBINC=../zlib-1.2.3


------------------------------------------------------------------------------------------
#. freetype 설치
------------------------------------------------------------------------------------------
[[email protected] freetype] ./configure --prefix=/usr/local/freetype-2.1.5 && make && make install


------------------------------------------------------------------------------------------
#. jpeg 지원 라이브러리 설치
------------------------------------------------------------------------------------------
[[email protected] jpeg-6b]# ./configure --enable-shared --enable-static
[[email protected] jpeg-6b]# make && make test && make install


------------------------------------------------------------------------------------------
#. libtiff 지원 라이브러리 설치 <-- 필수사항아님</B>
------------------------------------------------------------------------------------------
[[email protected] libtiff]# ./configure && make install


------------------------------------------------------------------------------------------
#. t1lib 지원 라이브러리 설치 <-- 필수사항아님</B>
------------------------------------------------------------------------------------------
[[email protected] t1lib]# ./configure && make without_doc && make install


------------------------------------------------------------------------------------------
#. gd 지원 라이브러리 설치 <-- make 했을경우 에러시 다음과 같이 수정, 별도추가시(php에 gd 포함됨)<BR>------------------------------------------------------------------------------------------
[[email protected] gd]# vi gd.c
#include "/usr/local/zlib/zlib.h"

[[email protected] gd]# vi gd_jpeg.c
#include "/usr/local/jpeg6b/jpeglib.h"
#include "/usr/local/jpeg6b/jerror.h"

[[email protected] gd]# vi gd_png.c
#include "/usr/local/libpng121/png.h"

[[email protected] gd]# vi Makefile
INCLUDEDIRS=-I. -I/usr/local/include/freetype2 -I/usr/local/include
LIBDIRS=-L/usr/local/lib -L/usr/lib
INSTALL_LIB=/usr/local/lib
INSTALL_INCLUDE=/usr/local/include

[[email protected] gd]# make && make install

------------------------------------------------------------------------------------------
#. Apache Configure(1)
------------------------------------------------------------------------------------------
[[email protected] /mysql]# cd /tmp/apache_1.3.34
[[email protected] /apache_1.3.34]#
./configure --prefix=/usr/local/apache --enable-module=so
--activate-module=src/modules/php4/libphp4.a ---> static일 경우만
--enable-rule=SHARED_CORE --enable-shared=max && make && make install


------------------------------------------------------------------------------------------
#. PHP4설치
------------------------------------------------------------------------------------------
[[email protected] root]# cd php-4.4.1
[[email protected] /php-4.4.1]#
./configure --prefix=/usr/local/php \\
--with-apxs=/usr/local/apache/bin/apxs \\
--with-mysql=/usr/local/mysql \\
--with-imap=/usr/local/imap \\
--with-freetype=/usr/local/freetype-2.1.5 \\
--with-gd \\
--enable-track-vars \\
--with-language=korean \\
--with-charset=euc_kr \\
--with-xml \\
--with-jpeg-dir=/usr/local/jpeg-6b \\
--with-gdbm \\
--with-ldap \\
--with-exec-prefix=/usr/bin \\
--with-zlib-dir=/usr/local/zlib-1.2.3 \\
--enable-magic-quotes \\
--enable-sysvsem=yes \\
--enable-sysvshm=yes \\
--enable-mailparse \\
--disable-debug \\
--with-regex=php

[[email protected] /php-4.4.1]# make && make install
[[email protected] /php-4.4.1]# cp php.ini-dist /usr/local/php/lib/php.ini


----------------------------------------------------------------------------------------
#. Zend Optimizer 설치
----------------------------------------------------------------------------------------
[[email protected] root]# tar zvxf ZendOptimizer-2.5.10a-linux-glibc21-i386.tar.gz
[[email protected] root]# ./install.sh


----------------------------------------------------------------------------------------
#. 환경설정 파일 편집
----------------------------------------------------------------------------------------
[[email protected] /conf]# vi php.ini
zend_optimizer.optimization_level=7
zend_extension="/usr/local/Zend/lib/ZendOptimizer.so"
php 버전 4.0 이하에서는 php.ini에서 위 두 라인을 추가해 줘야 한다.


[[email protected] root]# vi /usr/local/apache/conf/httpd.conf
[[email protected] /conf]# vi httpd.conf

DirectoryIndex index.php index.php3 index.php4 index.htm index.html

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



DocumentRoot /home/myrootman
ServerName rootman.co.kr
ServerAlias www.rootman.co.kr
ThrottlePolicy Volume 2000M 1d
ErrorLog logs/error_rootman.co.kr
CustomLog logs/access_rootman.co.kr combined


[[email protected] root]# /usr/local/apache/bin/apachectl start


------------------------------------------------------------------------------------------
#. Test 하기
------------------------------------------------------------------------------------------
[[email protected] root]# cat > ~rootman/public_html/test.php


:: 브라우저에서
http://www.rootman.co.kr:8080/


------------------------------------------------------------------------------------------
#. 시스템 부팅시 자동 데몬화
------------------------------------------------------------------------------------------
[[email protected] root]# cat >> /etc/rc.d/rc.local
/usr/local/apache/bin/apachectl start
/usr/local/mysql/bin/safe_mysqld&
/usr/local/jakarta/bin/startup.sh


--------------------------------------------------------------
#. Jdk 1.3.2
--------------------------------------------------------------

참고) jdk가 설치되어 있어야. 톰캣에서 서블릿을 가동할수 있슴.
[[email protected] root]# tar xvfz jdk1_3_2-linux-i386.tar.gz
[[email protected] root]# mv jdk1_2_2 /usr/local/
[[email protected] root]# ln -s /usr/local/jdk1_2_2 jdk
[[email protected] root]# vi /etc/profile 하시고..

PATH="$PATH:/usr/local/jdk/bin"
PATH="$PATH:/usr/local/jdk/lib"
PATH="$PATH:/usr/local/jakarta-tomcat/bin"

export JAVA_HOME=/usr/local/jdk
export TOMCAT_HOME=/usr/local/jakarta-tomcat
export CLASSPATH="$CLASSPATH:.:$JAVA_HOME/lib/tools.jar:$TOMCAT_HOME/lib/servlet.jar:$JAVA_HOME/mm.mysql-2.0.2-bin.jar:$JAVA_HOME/mysqljdbc:$JAVA_HOME/activation.jar:$JAVA_HOME/mail.jar:$JAVA_HOME/pop3.jar:$JAVA_HOME/lib/classes12.jar"

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

[[email protected] root]# source /etc/profile <---------- profile 재실행<BR>[[email protected] root]#


-----------------------------------------------------------------------------------
#. Jsdk 2.0
-----------------------------------------------------------------------------------
[[email protected] root]# tar xvfz jsdk20-solaris2-sparc.tar.Z
[[email protected] root]# mv JSDK20 /usr/local/

[[email protected] root]# ln -s /usr/local/JSDK20 JSDK
[[email protected] root]# vi /etc/profile

PATH="$PATH:/usr/local/JSDK"
export CLASSPATH=".:/usr/local/JSDK/lib/jsdk.jar"

[[email protected] root]# source /etc/profile <---------- profile 재실행<BR>

------------------------------------------------------------------------------------------
#. Tomcat 설치하기
------------------------------------------------------------------------------------------
[[email protected] root]# mv jarkarta-tomcat-3.2-b7 /usr/local/jakarta
[[email protected] root]# cd /usr/local/apache/conf
[[email protected] root]# vi /usr/local/apache/conf/httpd.conf

Include /usr/local/jakarta-tomcat/conf/tomcat.conf

httpd.conf 화일을 열어 적당한 곳에 tomcat.conf 를 인식시킨다.



:: tomcat 에는 두개의 configure 파일이 있는데,

tomcat.conf ---> apache 를 위한 것,
server.xml ---> jsp 엔진 자체

디폴트폴트는 8007과 8080 을 사용한다.


[[email protected] /jakarta]# vi ./bin/startup.sh
다음 2개의 라인을 입력한다.

TOMCAT_HOME=`/usr/local/jakarta-tomcat`
JAVA_HOME=`/usr/local/jdk1.3.1_01`


------------------------------------------------------------------------------------------
#. JDBC의 설정과 테스트
------------------------------------------------------------------------------------------
1.jdbc driver설치&설정
------------------------------
http://www.worldserver.com/mm.mysql/ 에 가서 mm.mysql-2.0.2-bin.jar을 받는다
http://juntack.xto.co.kr/repository/mm.mysql-2.0.2-bin.jar 에서 다운받으세요

리눅스의 /usr/local/jdk/jdbc/에 복사해 놓는다

#주의# "."을 잊지말것

[[email protected] root]# /etc/profile 에

클래스패스설정
export CLASSPATH="$CLASSPATH:.:/usr/local/pgsql/jdbc/postgresql.jar:/usr/local/jdk1.3/jdbc/mm.mysql-2.0.2-bin.jar"
[[email protected] mysql]# source /etc/profile


2. mysql에 user설정

mysql을 root로 로그인을 하여

mysql> insert into user values("%","testuser",password("1234"),"N"......."N");
mysql> insert into user values("xxx.xxx.xxx.xxx","testuser",password("1234"),"N"......."N");
mysql> insert into user values("localhost","testuser",password("1234"),"N"......."N");
mysql> insert into db values("%","testdb","testuser","Y","Y",.......,"Y");
mysql> flush privileges;


3. 연결을 확인합니다
[[email protected] root]# cat > Test.java
import java.sql.*;

public class Test {
public static void main(String args[]) {
Connection con;
try {
Class.forName("org.gjt.mm.mysql.Driver");
System.out.println("1 단계. JDBC 를 접근 : 성공");
}
catch(ClassNotFoundException e) {
System.out.println("1 단계. JDBC 를 접근 : 실패 !!!");
System.out.println(e.getMessage());
}
try {
String url = "jdbc:mysql://218.38.13.215/testdb";
con = DriverManager.getConnection(url,"testuser","1234");
System.out.println("2 단계. MYSQL 에 접근 : 성공");
con.close();
}
catch(SQLException e) {
System.out.println("2 단계. MYSQL 에 접근 : 실패 !!!");
System.out.println(e.getMessage());
}
}
}

4. [[email protected] root]# java Test
1 단계. JDBC 를 접근 : 성공
2 단계. MYSQL 에 접근 : 실패 !!!

 
 

Total. 645
번호 분류 제목 작성자 등록일 조회수
645 기초강좌 NFS server unable to open connection to tcp6/udp6 networks rootman 09-27 2212
644 php [php] mssql ms-sql 한글 변환 끄적임.. 정리 rootman 03-29 3244
643 기초강좌 java vim 에서 자바 환경 만들기 rootman 02-16 2436
642 삭제예정 [xencenter] xenserver tool 설치 rootman 08-24 3405
641 mysql [mysql] Creating a File-Per-Table Tablespace Outside the Dat… rootman 08-03 3587
640 기초강좌 Centos Xwindow 설치 rootman 06-16 4449
639 php [php] highlight 함수 rootman 04-01 4309
638 qmail [qmail] qmail-scanner에 filtering 된 이메일 처리 rootman 02-14 4753
637 Shell [날짜] awk를 이용하여 unixtime의 시간 차 구하기 rootman 01-27 5626
636 기초강좌 centos에 그놈(gnome) 설치하기 rootman 01-10 5549
635 쉘(awk) [awk] shell 변수 사용하기 rootman 12-27 5257
634 기초강좌 서버 캐시 메모리 초기화하기 (drop_caches) rootman 12-11 6223
633 windows tips 그리드 제거 배치 스크립트 rootman 11-28 5828
632 기초강좌 패스워드 lockgin control rootman 09-06 4
631 windows tips win7 자동 로그인 설정하기 rootman 08-18 5650
 1  2  3  4  5  6  7  8  9  10    
AND OR