AIX 5.3, APACHE2.2 설치, TOMCAT7 연동

AIX 서버에서 신규 서비스를 제공하기 위해 기존 웹서버에 아파치를 설치해야할 일 이 생겼다.

추후 누군가에게 도움이 되길 바라며 정리를 함.

—————————–아파치 설치 시작————————————-

참조사이트 : http://killmewild.blog.me/30135030451

위 사이트 분께 큰 도움을 받았습니다. AIX 쪽에서 도움을 많이 받을수 있습니다.

1. 아파치 RPM 사이트에서 필요한 파일 다운로드

http://gnome.bullfreeware.com/aixtoolbox/RPMS/ppc/apache/

httpd-2.2.9-1.aix5.3.ppc.rpm
httpd-devel-2.2.9-1.aix5.3.ppc.rpm
httpd-manual-2.2.9-1.aix5.3.ppc.rpm

httpd-2.2.9-1.aix5.3.ppc.rpm 만 설치했을때는 아래와 같은 오류 발생

rpm -Uhv httpd-2.2.9-1.aix5.3.ppc.rpm

hostname:/app/apache22] rpm -Uhv httpd-2.2.9-1.aix5.3.ppc.rpm
file /usr/bin/apr-1-config from install of httpd-2.2.9-1 conflicts with file from package apr-devel-1.4.6-1

흠…httpd-devel-2.2.9-1.aix5.3.ppc.rpm 먼저 설치해본다

hostname:/app/apache22] rpm -Uhv httpd-devel-2.2.9-1.aix5.3.ppc.rpm
httpd-devel ##################################################
hostname:/app/apache22]

apr-devel-1.4.6-2.aix5.3.ppc.rpm 요녀석을 다운받아 설치해보고 해보자

hostname:/app/apache22] rpm -Uhv apr-devel-1.4.6-2.aix5.3.ppc.rpm
apr-devel ##################################################
cannot remove /opt/freeware/lib/apr-1/build – directory not empty
cannot remove /opt/freeware/lib/apr-1 – directory not empty
hostname:/app/apache22]

그래도 안됨…

먼가 계속 시도했으나 모조리 안되서……….먼가 걸리적 거리는걸 삭제해보기로 함.

개발서버니깐 믿고…

hostname:/app/apache22] rpm -Uhv httpd-2.2.9-1.aix5.3.ppc.rpm
file /usr/bin/apr-1-config from install of httpd-2.2.9-1 conflicts with file from package apr-devel-1.4.6-2
hostname:/app/apache22]
hostname:/app/apache22] rpm -e apr-devel-1.4.6-2
hostname:/app/apache22] rpm -e apr-1.4.6-2
error: removing these packages would break dependencies:
apr >= 1.4.5 is needed by apr-util-1.5.1-1
apr = 1.4.6 is needed by apr-devel-1.4.6-2
libapr-1.so is needed by apr-util-1.5.1-1

hostname:/app/apache22] rpm -e apr-1.4.6-2
error: removing these packages would break dependencies:
apr >= 1.4.5 is needed by apr-util-1.5.1-1
libapr-1.so is needed by apr-util-1.5.1-1

hostname:/app/apache22] rpm -e apr-util-1.5.1-1
error: removing these packages would break dependencies:
apr-util = 1.5.1-1 is needed by apr-util-odbc-1.5.1-1

hostname:/app/apache22] rpm -e apr-util-odbc-1.5.1-1
hostname:/app/apache22] rpm -e apr-util-1.5.1-1
hostname:/app/apache22] rpm -e apr-1.4.6-2

삭제순서

apr-util-odbc-1.5.1-1

apr-util-1.5.1-1

apr-1.4.6-2

hostname:/app/apache22] rpm -Uhv httpd-2.2.9-1.aix5.3.ppc.rpm
httpd ##################################################
hostname:/app/apache22]

오예!!!

걸리적 거리는 녀석들을 모조리 삭제하니 설치가 잘된다. 문제가 없을까?;;

[hostname:/app/apache22]rpm -q httpd-manual
httpd-manual-2.2.9-1
[hostname:/app/apache22]
[hostname:/app/apache22]
[hostname:/app/apache22]rpm -q httpd-devel
httpd-devel-2.2.9-1
[hostname:/app/apache22]
[hostname:/app/apache22]
[hostname:/app/apache22]rpm -q httpd
httpd-2.2.9-1
[hostname:/app/apache22]

기쁨에 가득차서 아파치 기동에 들어간다.

[hostname:/home/webadm]cd /usr/bin
[hostname:/usr/bin]./httpd
httpd: bad group name daemon
[hostname:/usr/bin]

[hostname:/opt/freeware/apache/bin]./apachectl start
httpd: bad group name daemon
[hostname:/opt/freeware/apache/bin]

음…

httpd.conf 파일을 열어 아래처럼 수정

Listen localhost:2012

#User daemon
#Group daemon

User nobody
Group nobody

[hostname:/opt/freeware/apache/bin]./apachectl start
httpd: Could not reliably determine the server’s fully qualified domain name, using 서버IP for Server
Name
(13)Permission denied: httpd: could not open error log file /opt/freeware/apache/logs/error_log.
Unable to open logs
[hostname:/opt/freeware/apache/bin]

로그파일 경로를 바꾸자

#ErrorLog “logs/error_log”
ErrorLog “/app/apache22/logs/error_log”

[hostname:/opt/freeware/apache/bin]./apachectl start
httpd: Could not reliably determine the server’s fully qualified domain name, using 서버IP for Server
Name
[hostname:/opt/freeware/apache/bin]

음 이건 뭘까나..

아래처럼 httpd.conf 에 넣어주니 해결됨

ServerName 서버IP:2012

[Thu Oct 16 15:26:29 2014] [error] (13)Permission denied: could not open transfer log file /opt/freeware/apache/logs/access_log.
Unable to open logs

음…

아래처럼 하여 해결

#CustomLog “logs/access_log” common
CustomLog “/app/apache22logs/access_log” common

[Thu Oct 16 15:29:14 2014] [error] (13)Permission denied: could not create /opt/
freeware/apache/logs/httpd.pid
[Thu Oct 16 15:29:14 2014] [error] httpd: could not log pid to file /opt/freewar
e/apache/logs/httpd.pid

아래처럼 시도

#ServerRoot “/opt/freeware/apache”
ServerRoot “/app/apache22”

그러나 아래처럼 에러터짐

httpd: Syntax error on line 55 of /opt/freeware/apache/conf/httpd.conf: Cannot load /app/apache22/modules/mod_
authn_file.so into server: Could not load module /app/apache22/modules/mod_authn_file.so.\nSystem error: No su
ch file or directory

걍 포기하고 ServerRoot 원복후 root 로 구동하니 성공!!!

—————————–아파치 설치 끝————————————-

—————————–톰켓 연동 시작————————————-

참고사이트 : http://arcsit.tistory.com/entry/AIX-AIX61-%EA%B8%B0%EB%B0%98%EC%9D%98-Apache-tomcat-jk2

mod_jk 와 자카르타 커넥터는 무슨차이일까..

다른 사이트에서는 mod_jk로 연동하라는데 먼지 잘 모르겠다.

아파치 사이트에서 mod_jk2 파일을 받자

http://archive.apache.org/dist/jakarta/tomcat-connectors/jk2/jakarta-tomcat-connectors-jk2-src-current.tar.gz

gzip -d jakarta-tomcat-connectors-jk2-src-current.tar.gz

tar -xvf jakarta-tomcat-connectors-jk2-src-current.tar

cd jakarta-tomcat-connectors-jk2-2.0.4-src

cd jk

cd native2

./configure –with-apxs=/usr/local/apache/httpd-2.2.9/bin/apxs

잘 되는 듯 하다가 막판에 아래와 같은 에러가 뾱

configure: error: Invalid location for apxs: ‘/usr/local/apache/httpd-2.2.9/bin/apxs’

apxs 란 파일을 찾는걸로 보아 어딘가에 있을것 같아 실제 아파치 설치위치에 가보니 있음. 그래서 아래처럼 재시도

./configure –with-apxs=/opt/freeware/apache/bin/apxs

다시 에러

configure: error: Do not use –with-apxs but –with-apxs2

아래처럼 재시도

./configure –with-apxs2=/opt/freeware/apache/bin/apxs

새로운 에러

configure: error: jk2 and apache compilers must be the same

포기 구버전의 jk로 해보자

jakarta-tomcat-connectors-current-src.tar.gz

cd jakarta-tomcat-connectors-1.2.14.1-src/jk/native

./configure –with-apxs=/opt/freeware/apache/bin/apxs

앗 된듯하다

config.status: executing depfiles commands

그렇타면 make 과정 ㄱㄱ

make && make install

Making all in common
/opt/freeware/apache/build/libtool –silent –mode=compile gcc -I/opt/freeware/apache/include -g -O2 –
g -qHALT=E -DHAVE_APR -I/opt/freeware/apache/include -I/opt/freeware/apache/include -g -O2 -U__STR__ -D_THREA
D_SAFE -D_USE_IRS -D_LARGEFILE64_SOURCE -I /include -I /include/ -c ./jk_ajp12_worker.c -o ./jk_ajp12_worker.l
o
/opt/freeware/apache/build/libtool: line 390: /usr/linux/bin/sed: No such file or directory
/opt/freeware/apache/build/libtool: line 789: /usr/linux/bin/sed: No such file or directory
*** Warning: inferring the mode of operation is deprecated.
*** Future versions of Libtool will require –mode=MODE be specified.
/opt/freeware/apache/build/libtool: line 1100: /usr/linux/bin/sed: No such file or directory
/opt/freeware/apache/build/libtool: line 1100: /usr/linux/bin/sed: No such file or directory
/opt/freeware/apache/build/libtool: line 1100: /usr/linux/bin/sed: No such file or directory
/opt/freeware/apache/build/libtool: line 1100: /usr/linux/bin/sed: No such file or directory
/opt/freeware/apache/build/libtool: line 1100: /usr/linux/bin/sed: No such file or directory
/opt/freeware/apache/build/libtool: line 1100: /usr/linux/bin/sed: No such file or directory
/opt/freeware/apache/build/libtool: line 1100: /usr/linux/bin/sed: No such file or directory
/opt/freeware/apache/build/libtool: line 1100: /usr/linux/bin/sed: No such file or directory
/opt/freeware/apache/build/libtool: line 1100: /usr/linux/bin/sed: No such file or directory
/opt/freeware/apache/build/libtool: line 1100: /usr/linux/bin/sed: No such file or directory
/opt/freeware/apache/build/libtool: line 1100: /usr/linux/bin/sed: No such file or directory
/opt/freeware/apache/build/libtool: line 1100: /usr/linux/bin/sed: No such file or directory
/opt/freeware/apache/build/libtool: line 1100: /usr/linux/bin/sed: No such file or directory
/opt/freeware/apache/build/libtool: line 1100: /usr/linux/bin/sed: No such file or directory
/opt/freeware/apache/build/libtool: line 1100: /usr/linux/bin/sed: No such file or directory
/opt/freeware/apache/build/libtool: line 1100: /usr/linux/bin/sed: No such file or directory
/opt/freeware/apache/build/libtool: line 1100: /usr/linux/bin/sed: No such file or directory
/opt/freeware/apache/build/libtool: line 1100: /usr/linux/bin/sed: No such file or directory
/opt/freeware/apache/build/libtool: line 1100: /usr/linux/bin/sed: No such file or directory
/opt/freeware/apache/build/libtool: line 1100: /usr/linux/bin/sed: No such file or directory
/opt/freeware/apache/build/libtool: line 1153: /usr/linux/bin/sed: No such file or directory
: compile: cannot determine name of library object from `’
make: The error code from the last command is 1.
Stop.
make: The error code from the last command is 1.
Stop.

제길 libtool 이런게 필요한가 보다

다시 검색 ㄱㄱ

http://gnome.bullfreeware.com/aixtoolbox/RPMS/ppc/libtool/libtool-2.2.6b-3.aix5.3.ppc.rpm

파일 업로드 후 rpm 설치

하지만 이미 설치가 되있음

에러로그를 보니 좀더 최신버전을 깔라, 해당 디렉이 없다 이소리인데…

aix 5.3용 최신버전이 이미 깔린것 같은데…그럼 디렉토리를 만들어볼까..

해당 디렉을 가보니 다들 링크가 걸렸을 뿐이다. sed란 패키지가 필요한것 같아 검색해보니 sed란 패키지가 있다.

http://www.bullfreeware.com/affichage.php?id=1270

sed-4.2.1-3.aix5.3.ppc.rpm

hostname:/app/apache22] rpm -Uhv sed-4.2.1-3.aix5.3.ppc.rpm
sed ##################################################
hostname:/app/apache22]

오케 mod_jk make 시에 발생했던 위치에 sed 가 생성되었음

hostname:/usr/linux/bin] ls -al -rt

total 8
lrwxrwxrwx 1 root system 26 Jul 5 2007 zcat@ -> /usr/opt/freeware/bin/zcat*
lrwxrwxrwx 1 root system 27 Jul 5 2007 patch@ -> /usr/opt/freeware/bin/patch*
lrwxrwxrwx 1 root system 30 May 18 2009 make@ -> ../../../opt/freeware/bin/make*
lrwxrwxrwx 1 root system 26 Jun 7 2012 cpp@ -> ../../opt/freeware/bin/cpp*
lrwxrwxrwx 1 root system 28 Jun 7 2012 m4@ -> ../../../opt/freeware/bin/m4*
lrwxrwxrwx 1 root system 31 Jun 19 2013 iconv@ -> ../../../opt/freeware/bin/iconv*
lrwxrwxrwx 1 root system 32 Jun 19 2013 ssleay@ -> ../../../opt/freeware/bin/ssleay*
lrwxrwxrwx 1 root system 33 Jun 19 2013 openssl@ -> ../../../opt/freeware/bin/openssl*
lrwxrwxrwx 1 root system 34 Jun 19 2013 c_rehash@ -> ../../../opt/freeware/bin/c_rehash*
drwxr-xr-x 6 root system 256 Jun 19 2013 ../
lrwxrwxrwx 1 root system 29 Oct 16 17:31 sed@ -> ../../../opt/freeware/bin/sed*
drwxr-xr-x 2 root system 4096 Oct 16 17:31 ./

다시 make ㄱㄱ

Making all in common
/opt/freeware/apache/build/libtool –silent –mode=compile gcc -I/opt/freeware/apache/include -g -O2 –
g -qHALT=E -DHAVE_APR -I/opt/freeware/apache/include -I/opt/freeware/apache/include -g -O2 -U__STR__ -D_THREA
D_SAFE -D_USE_IRS -D_LARGEFILE64_SOURCE -I /include -I /include/ -c ./jk_ajp12_worker.c -o ./jk_ajp12_worker.l
o
libtool: compile: unable to infer tagged configuration
libtool: compile: specify a tag with `–tag’
make: The error code from the last command is 1.
Stop.
make: The error code from the last command is 1.
Stop.

이건 뭐냐…

jakarta-tomcat-connectors-1.2.14.1-src/jk/native/Makefile 파일을 열어 아래와 같이 수정

as-is

LIBTOOL = /opt/freeware/apache/build/libtool –silent

to-be

LIBTOOL = /opt/freeware/apache/build/libtool –silent –tag=CXX

전혀 변화가 없다.

./configure –with-apxs=/opt/freeware/apache/bin/apxs

configure: creating libtool
appending configuration tag “CXX” to libtool
checking for ld used by g++… /usr/bin/ld

포기

다른 사이트에서 찾아서 해본다

사이트 : http://andang72.blogspot.kr/2012/07/aix-6-apache-tomcat.html

tomcat-connectors-1.2.40-src.tar.gz 을 받아서 설치

./configure –with-apxs=/opt/freeware/apache/bin/apxs

된다… ㅠㅠ

/opt/freeware/apache/conf/httpd.conf 파일에 아래 내용 추가

LoadModule jk_module modules/mod_jk.so

<IfModule jk_module>
JkWorkersFile conf/workers.properties
JkLogFile logs/mod_jk.log
JkLogLevel info
JkMountFile conf/uriworkermap.properties
</IfModule>

동일한 디렉토리에 workers.properties 생성 후 아래와 같이 내용 기재

worker.list=worker1
worker.worker1.port=8009
worker.worker1.host=localhost
worker.worker1.type=ajp13
worker.worker1.lbfactor=1

역시 동일한 디렉토리에 uriworkermap.properties 파일 생성 후 아래와 같이 내용 기재

/*.do=worker1
/*.jsp=worker1
/*.html=worker1
/*.png=worker1
/*=worker1

이 설정들은 요청받은 주소를 뒷단 톰켓에게 전달할 녀석들을 세팅하는 정보로 보인다.

브라우져에서 서버IP:포트 로 치니 아파치에서 It work’s 란 화면이 뜬다!!

다시 서버IP:포트/index.jsp 를 치니 톰켓의 기본 화면이 잘뜬다!! ㅠㅠ

성공~~

—————————–톰켓 연동 끝—————————————-

위에는 RPM으로 설치를 했는데 결과적으로는 아파치의 소스코드를 가지고 AIX에 포팅하여 설치하는 것이 가장 좋아보인다

잘 정리가 되있는 사이트

http://andang72.blogspot.kr/2012/07/aix-6-apache-tomcat.html

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s