본문 바로가기
server/apache

apache 설치

by "뭉치" 2021. 8. 14.
728x90

centos 6 기준 apache 설치.

참조
아파치 설치 : http://zetawiki.com/wiki/%EB%A6%AC%EB%88%85%EC%8A%A4_%EC%95%84%ED%8C%8C%EC%B9%98_%EC%B5%9C%EC%8B%A0%EB%B2%84%EC%A0%84_%EC%84%A4%EC%B9%98_(%EC%BB%B4%ED%8C%8C%EC%9D%BC)
gcc 설치 : http://zetawiki.com/wiki/CentOS_gcc_%EC%84%A4%EC%B9%98
apr 설치 : http://blog.naver.com/albertx/100171087478
pcre 설치 : http://www.atblog.co.kr/?p=6255
mod_jk 설치 : http://linux.systemv.pe.kr/apache-tomcat-%EC%97%B0%EB%8F%99%ED%95%98%EA%B8%B0-mod_jk/
정리가 잘 되어 있는 사이트 : https://medium.com/@kobi97/centos-6-5%EC%97%90-%EC%84%9C%EB%B9%84%EC%8A%A4-%ED%99%98%EA%B2%BD-%EA%B5%AC%EC%84%B1-2-apache-tomcat-f5e568f7e494
http.conf 설정 관련 : http://jace.tistory.com/100
사전 작업
1. gcc 설치

{확인1}
#rpm -qa | grep ^gcc
#yum list installed gcc
... ( 생략 )
Error : No matching Packages to list
{설치}
#yum install gcc
{확인2}
#rpm -qa gcc
->gcc-4.4.7-16.el6.x86_64
#yum list installed gcc
->...(생략) Installed Packages gcc.x86_64 ..
#gcc
->gcc: no input files

2. expat devel 설치
#yum install expat-devel

3. c++ compiler 설치
#yum -y install gcc gcc-c++

4. 트러블슈팅
-> apr confiure 시 발생 하면 rm: cannot remove `libtoolT': No such file or directory
#cp -arp libtool libtoolT

5. 설치 실패시 재 설치 할땐
#make clean
1. 구글 클라우드에서 VM 인스턴스 하나 만듬.
참조 : http://jybaek.tistory.com/609
2. 주어진 계정 pigohno 으로 apache 설치 및 설정을 할거임.
3. 파일 다운로드
#cd /home/pigohno
1. Apache Portable Runtime 다운
#wget http://mirror.apache-kr.org/apr/apr-1.6.2.tar.gz
2. Apache Portable Runtime Util 다운
#wget http://mirror.apache-kr.org/apr/apr-util-1.6.0.tar.gz
3. apache pcre 다운
#wget https://ftp.pcre.org/pub/pcre/pcre-8.41.tar.gz
4. lua 다운
#wget http://www.lua.org/ftp/lua-5.3.4.tar.gz
5. apache 다운
#wget http://ftp.neowiz.com/apache/httpd/httpd-2.4.29.tar.gz
6. mod_jk 다운
#wget http://mirror.apache-kr.org/tomcat/tomcat-connectors/jk/tomcat-connectors-1.2.42-src.tar.gz
4. 압축해제
#tar xfz apr-1.6.2.tar.gz
#tar xfz apr-util-1.6.0.tar.gz
#tar xfz pcre-8.41.tar.gz
#tar xfz httpd-2.4.29.tar.gz
#tar xfz lua-5.3.4.tar.gz
#tar xfx tomcat-connectors-1.2.42-src.tar.gz
5.apr 설치
#cd apr-1.6.2
#./configure --prefix=/usr/local/apr
#make && make install
6.apr-util 설치
#cd apr-util-1.6.0
#./configure --with-apr=/usr/local/apr
#make && make install
7.pcre 설치
#cd pcre-8.41
#./configure --prefix=/usr/local/pcre
#make && make install
8. lua 설치
#cd lua-5.3.4
#make linux test

##안된다?
#yum -y install lua
8.apache 설치
#cd httpd-2.4.29
#./configure --prefix=/home/pigohno/apache --with-mpm-worker --enable-mods-shared=all --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr --with-pcre=/usr/local/pcre --with-included-lua

#make && make install
9.tomcat-connector ( mod_jk ) 설치
#cd tomcat-connectors-1.2.42-src/native
#./configure --with-apxs=/workspace/web/apache/bin/apxs
#make && make install

##트러블슈팅
# yum install -y perl

위와 같이 need to check for Perl first, ... You must specify a valid --with-apxs path 에러가 발생하면, perl을 찾을 수 없다는 뜻입니다.
이를 해결하기 위해서는 /usr/local/victolee/apache2.4.33/bin/apxs 파일을 열어서 맨 첫 줄을 아래와 같이 수정 합니다.
# vi /usr/local/victolee/apache2.4.33/bin/apxs
#!/replace/with/path/to/perl/interpreter -w     =>	#! /usr/bin/perl -w

출처: http://victorydntmd.tistory.com/225 [victolee]
mod_jk.conf
LoadModule jk_module modules/mod_jk.so
<IfModule mod_jk.c>
JkWorkersFile conf/workers.properties
JkLogFile "|/workspace/web/apache/bin/rotatelogs /workspace/web/apache/logs/mod_jk_log.%Y%m%d 86400 +540"
JkLogLevel info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"
JkOptions +ForwardkeySize +ForwardURICompatUnparsed -ForwardDirectories
JkRequestLogFormat "%w %V %T"
JkShmFile logs/jk.shm
#JkMountFile conf/uri.properties
</IfModule>
#JkMount /*.jsp svr11
worker.properties
worker.list=openapilb

### worker template
worker.template.type=ajp13
worker.template.socket_connect_timeout=3000
worker.template.connect_timeout=1000
worker.template.prepost_timeout=1000
worker.template.connection_pool_timeout=10

### openapi service
worker.openapi1.reference=worker.template
worker.openapi1.port=8009
worker.openapi1.host=IP
worker.openapi1.redirect=openapi2

worker.openapi2.reference=worker.template
worker.openapi2.port=8009
worker.openapi2.host=IP
worker.openapi2.activation=disabled

worker.openapilb.type=lb
worker.openapilb.balance_workers=openapi1,openapi2
worker.openapilb.sticky_session=1
mod_jk 관련 참조할만한 사이트
http://jkkang.net/java/mod_jk/mod_jk_install.html
http://linux.systemv.pe.kr/apache-tomcat-%EC%97%B0%EB%8F%99%ED%95%98%EA%B8%B0-mod_jk/
httpd 권한 관련
참조 : https://m.blog.naver.com/PostView.nhn?blogId=oshnew&logNo=10178849420&proxyReferer=https:%2F%2Fwww.google.co.kr%2F
httpd 파일의 권한 root.apache | 4750
728x90

'server > apache' 카테고리의 다른 글

apache 설치 전 이것저것  (0) 2021.08.14

댓글