: 서버구축환경
OS: Amazon Linux AMI release 2011.09 <== CentOS 계열(5.x)
WS: Apache/2.2.21 (Unix)
WAS: tomcat-7.0.22
: Apache2(httpd) 설치
$ sudo yum install httpd
: 설치확인
$ chkconfig --list | grep httpd
httpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
$ apachectl -v
Server version: Apache/2.2.21 (Unix)
Server built: Oct 26 2011 22:12:40
: 설치정보
$ cd /etc/httpd
$ ll
total 8
drwxr-xr-x 2 root root 4096 Feb 2 05:33 conf
drwxr-xr-x 2 root root 4096 Feb 2 05:33 conf.d
lrwxrwxrwx 1 root root 19 Feb 2 05:33 logs -> ../../var/log/httpd
lrwxrwxrwx 1 root root 29 Feb 2 05:33 modules -> ../../usr/lib64/httpd/modules
lrwxrwxrwx 1 root root 19 Feb 2 05:33 run -> ../../var/run/httpd
: apache 실행
$ sudo /usr/sbin/apachectl start
$ netstat -lntp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
tcp 0 0 :::80 :::* LISTEN
tcp 0 0 :::8080 :::* LISTEN
tcp 0 0 :::22 :::* LISTEN
tcp 0 0 ::ffff:127.0.0.1:8005 :::* LISTEN
tcp 0 0 :::8009 :::* LISTEN
: apache2.2 + tomcat7 연동 설정(mod_proxy_proxy)
> 참고: http://bugcide.blogspot.com/2011/07/centos-apache-tomcat-yum.html
>
> /etc/httpd/conf/httpd.conf 에 mod_proxy 활성화 되어있는지 확인 (기본 설치값은 활성화되어 있음)
> /etc/httpd/conf/httpd.conf 에 mod_proxy 활성화 되어있는지 확인 (기본 설치값은 활성화되어 있음)
> * LoadModule proxy_module modules/mod_proxy.so
> conf/httpd.conf 에 주석처리된 mod_proxy.c 부분을 설정해도 좋지만
> /etc/httpd/conf.d/ 에 tomcat.conf 파일을 새로 생성함
$ sudo vi /etc/httpd/conf.d/tomcat.conf
<IfModule mod_proxy.c>
ProxyRequests off
ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/
<IfModule mod_disk_cache.c>
CacheEnable disk /
CacheRoot "/var/cache/mod_proxy"
</IfModule>
</IfModule>
$ sudo /usr/sbin/apachectl restart
끝.