728x90
반응형

그냥 yum install httpd 하면 되긴하다....


이후의 내용은 굳이 컴파일해서 설치하는 경우에 참조할 것

대신 uninstall이 안된다는거~~~ make uninstall 안됨....


0. 우선 yum list installed | grep httpd 하여 아파치웹서버가 이미 설치되어 있으면 삭제한다.

=> yum erase httpd


1.http://httpd.apache.org/download.cgi#apache22 에서 Unix 소스를 다운받는다.

나는 tar.gz 거를 받았다.


2.적당한 곳에 다운받은 소스의 압축을 푼다.


3../configure --with-layout=apache --prefix=/home/test/Tools/Servers/apache-httpd-2.2.17 --enable-mods-shared=all --enable-so -enable-rewrite

(httpd 2.x 버젼부터  다음과 같은 변경사항이 있다고 함. http://blog.blueweb.co.kr/119 참조

--enable-module=so -> --enable-so

--enable-shared=max -> --enable-mods-shared=most

)


--prefix=[인스톨 될 위치. 즉 httpd 홈디렉토리로 사용될 디렉토리] 나는 /home/test/Tools/Servers/apache-httpd-2.2.17 디렉토리에 설치할 거다.

--enable-so ⇒ 요거이 tomcat연동할 때 사용된다나...


※ 추가: 컴파일 모드에 따라 모듈이 *.c(static모드) 로 되느냐 *.so(DSO모드) 로 되느냐가 정해진다고 한다.

DSO모드로 컴파일시 configure의 command는 다음과 같다.


./configure --prefix=/usr/local/apache-httpd-2.2.26 --enable-so --enable-mods-shared=most --enable-rewrite=shared


암튼 한참 기둘린다....


4.make

하세월이다....


5.make install

만만찮은 하세월이다....


/home/test/Tools/Servers/apache-httpd-2.2.17 로 이동해서 ls 해보면 인스톨된 파일들을 볼 수 있다.


6.서비스 등록

cp httpd홈디렉토리/bin/apachectl /etc/init.d/httpd

vi /etc/init.d/httpd

한 후에


다음내용을 #!bin/sh 다음줄에 추가한다.


 

# chkconfig: 2345 90 90
# description: init file for apachectl server daemon
# processname: httpd홈디렉토리/bin/apachectl
# config: httpd홈디렉토리/conf/httpd.conf
# pidfile: httpd홈디렉토리/logs/httpd.pid


추가 완료했으면


chkconfig --add httpd

한 후,


ntsysv

하여 리스트에 httpd가 나오는지 확인한다.


7.퍼미션

웹브라우저에 http://localhost 하면 권한이 없네 어쩌네 하는 메세지가 나올 수가 있다.

httpd가 설치된 디렉토리의 상위 디렉토리에서 접근권한이 없어서 생기는 문제이다.

/home/test 의 권한상태를 보니 drwx------ 이더라... 

요걸 chmod 711 /home/test 해주면 drwx--x--x 로 바뀌면서 웹화면도 잘뜬다.

728x90
반응형
블로그 이미지

nineDeveloper

안녕하세요 현직 개발자 입니다 ~ 빠르게 변화하는 세상에 뒤쳐지지 않도록 우리모두 열심히 공부합시다 ~! 개발공부는 넘나 재미있는 것~!

,