mkdir
download
cd
download/
wget http:
//apache
.mirror.cdnetworks.com
//httpd/httpd-2
.4.18.
tar
.gz
tar
xvzf httpd-2.4.18.
tar
.gz
wget http:
//mirror
.apache-kr.org
/apr/apr-1
.5.2.
tar
.gz
tar
xvzf apr-1.5.2.
tar
.gz
wget http:
//mirror
.apache-kr.org
/apr/apr-util-1
.5.4.
tar
.gz
tar
xvzf apr-util-1.5.4.
tar
.gz
mv
apr-1.5.2 httpd-2.4.18
/srclib/apr
mv
apr-util-1.5.4 httpd-2.4.18
/srclib/apr-util
wget http:
//sourceforge
.net
/projects/pcre/files/pcre/8
.37
/pcre-8
.37.
tar
.gz
/download
tar
xvzf pcre-8.37.
tar
.gz
cd
pcre-8.37
.
/configure
--
enable
-unicode-properties=
yes
make
&&
make
install
.
/configure
\
--prefix=
/usr/local/tomcat/apache-2
.4.18 \
--
enable
-so \
--
enable
-rewrite \
--
enable
-proxy \
--
enable
-ssl \
--
enable
-mods-shared=all \
--
enable
-modules=shared \
--
enable
-mpms-shared=all \
--with-included-apr \
--with-included-apr-util
make
&&
make
install
/usr/local/tomcat/apache-2
.4.18
/bin/httpd
-V
chown
root:sys
/usr/local/tomcat/apache-2
.4.18
/bin/httpd
chmod
+s
/usr/local/tomcat/apache-2
.4.18
/bin/httpd
/usr/local/tomcat/apache-2
.4.18
/httpd
.conf
ServerName localhost
//
주석 해제 및 설정
LoadModule slotmem_shm_module modules
/mod_slotmem_shm
.so
//
주석 해제
/usr/local/tomcat/apache-2
.4.18
/bin/httpd
-k start
/usr/local/tomcat/apache-2
.4.18
/bin/httpd
-k stop
wget http:
//apache
.tt.co.kr
/tomcat/tomcat-connectors/jk/tomcat-connectors-1
.2.41-src.
tar
.gz
tar
xvzf tomcat-connectors-1.2.41-src.
tar
.gz
cd
tomcat-connectors-1.2.41-src
/native
.
/configure
--with-apxs=
/usr/local/tomcat/apache-2
.4.18
/bin/apxs
make
&&
make
install
ls
-l
/usr/local/tomcat/apache-2
.4.18
/modules/mod_jk
.so
cp
톰켓롬
/bin/tomcat-native
.
tar
.gz .
tar
xvzf tomcat-native.
tar
.gz
cd
tomcat-native-1.1.33-src
/jni/native
.
/configure
--with-apr=
/usr/local/tomcat/apache-2
.4.18
/bin/apr-1-config
--prefix=
/usr/local/tomcat/apache-tomcat-8
.0.30
make
&&
make
install
톰캣 설정
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CATALINA_HOME
/lib
export
LD_LIBRARY_PATH
Include conf
/extra/mod_jk
.conf
vi
/usr/local/tomcat/apache-2
.4.18
/conf/httpd
.conf
Include conf
/extra/httpd-vhosts
.conf
//
주석 해제
Include conf
/extra/httpd-default
.conf
//
주석 해제
Include conf
/extra/mod_jk
.conf
vi
vi
/usr/local/tomcat/apache-2
.4.18
/conf/extra/mod_jk
.conf
LoadModule jk_module modules
/mod_jk
.so
JkWorkersFile conf
/extra/workers
.properties
JkLogFile
"|logs/mod_jk.log logs/mod_jk.log_%m%d%Y"
JkShmFile logs
/mod_jk
.shm
JkLogLevel info
JkLogStampFormat
"[%Y-%m-%d %H:%M:%S] "
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories +ForwardURICompatUnparsed
JkRequestLogFormat
"%w %V %T %R %s %U"
JkMount
/jkstatus
* jkstatus
<location
/jkstatus
>
JkMount jkstatus
Order Deny,Allow
Allow from 127.0.0.1
Allow from 192
Deny from all
<
/location
>
vi
/usr/local/tomcat/apache-2
.4.18
/conf/extra/workers
.properties
worker.list=jkstatus,testcluster
worker.template.
type
=ajp13
worker.template.maintain=60
worker.template.lbfactor=1
worker.template.ping_mode=A
worker.template.ping_timeout=2000
worker.template.prepost_timeout=2000
worker.template.socket_timeout=300
worker.template.socket_connect_timeout=2000
worker.template.socket_keepalive=
true
worker.template.connection_pool_timeout=300
worker.template.connect_timeout=10000
worker.template.recovery_options=7
worker.testcluster11.reference=worker.template
worker.testcluster11.host=192.168.0.2
worker.testcluster11.port=9401
worker.testcluster21.reference=worker.template
worker.testcluster21.host=192.168.0.3
worker.testcluster21.port=9401
worker.testcluster.
type
=lb
worker.testcluster.method=Session
worker.testcluster.sticky_session=True
worker.testcluster.balance_workers=testcluster11,testcluster21
worker.jkstatus.
type
=status
vi
httpd-vhosts.conf
NameVirtualHost *:80
Include conf
/extra/vhost-tomcat
.conf
vi
vhost-tomcat.conf
<virtualhost *:80>
DocumentRoot
"/data/webroot/test-cluster/webapp"
ServerName testcluster.ddakker.pe.kr
ServerAlias cluster.ddakker.pe.kr
DirectoryIndex
/index
.html
/index
.jsp
JkUnMount /*.js testcluster
JkUnMount /*.css testcluster
JkUnMount /*.jpg testcluster
JkUnMount /*.png testcluster
JkUnMount /*.gif testcluster
JkUnMount /*.htm testcluster
JkUnMount /*.html testcluster
JkUnMount /*.ico testcluster
JkUnMount /*.eot testcluster
JkUnMount /*.woff testcluster
JkMount /* testcluster
JkMount
/jkstatus
* jkstatus
<directory
"/data/webroot/test-cluster/webapp"
>
Options FollowSymLinks
AllowOverride None
<ifversion < 2.3>
Order allow,deny
Allow from all
<
/ifversion
>
<ifversion >= 2.3>
Require all granted
<
/ifversion
>
<
/directory
>
<
/VirtualHost
>