개발

Apache 1.3x 모듈 프로그래밍

애바른 2006. 12. 11. 15:37
* 1.3x 기준

1. http://httpd.apache.org/download.cgi => 1.3.37.tar.gz 파을을 다운,서버에 푼다.
2. cp -r ~/apache_1.3.37/src/modules/example ~/apache_1.3.37/src/modules/TEST
  => example 폴더를 TEST폴더로 복사
3. TEST폴더에, net.c, net.h 복사 (소켓통신예제용,알아서 구할것)
4. vi src/Configuration => AddModule modules/TEST/mod_example.o 추가
5. cd src; ./Configure 실행 =>  src/modules/TEST/Makefile 이 생성됨.
6. cd ~/apache_1.3.37; ./configure --activate-module=src/modules/TEST/mod_example.o 옵션추가 실행
7. vi Makefile (TEST폴더에생성된파일) => OBJS= mod_example.o ${SRCDIR}/modules/TEST/net.o 변경
  즉, 파일추가로 컴파일시에만..
8. make install
------------------------------------------------------------------------------------

* vi src/Configuration   =>
  AddModule modules/TEST/mod_example.o  
  AddModule modules/TEST/net.o
  => 이렇게 둘을 추가하였으나, 오류발생하였음.
* Makefile.tmpl 파일이 없으면 Makefile 생성불가


아파치설치 디렉토리의 conf/srm.conf
<Location /TEST>
setHandler example-handler
</Location>

http://www.xxxxxxxxxxx.xxx/TEST 하게 되면, mod_example 내용출력
------------------------------------------------------------------------------------
httpd.conf =>
AddHandler  example-handler .example