對這文章發表回應
發表限制: 非會員 可以發表
發表者: 冷日 發表時間: 2015/1/7 7:44:02
架設Apache run 80、Tomcat run 8080 用 mod_jk 架設的步驟
清除指令make distclean
一、安裝apr
三、安裝apr-iconv-1.2.1
四、安裝pcre-8.32
安裝openssl
other:安裝php
五、安裝Apache Web Server
六、安裝mod_jk.so 編譯tomcat-connectors-1.2.37-src
configure需要進入native folder
七、設定conf/httpd.conf
新增:
修改:將Virtual hosts的config檔案include進httpd.conf
將前面的『#』拿掉
八、從tomcat-connectors-1.2.37-src
(一)、複製httpd-jk.conf到/usr/local/apache2/conf/extra/
將httpd-jk.conf重新命名為mod_jk.conf
(二)、複製 workers.properties到/usr/local/apache2/conf/extra/
九、修改conf/extra/mod_jk.conf
(一)、把第22行變成註解,在該行最前面加上『#』
因為so檔已經在httpd.conf裡面載入了,不需重覆載入。
(二)、在 前面加上下面的敘述
(三)、修改第28行workers.properties的位置
十、修改conf/extra/workers.properties
在檔案最後加上
十一、修改conf/extra/httpd-vhosts.conf
將舊的設定全部加上『#』變成註解,並在下面的資料加在最後面
十二、修改tomcat server 的conf/server.xml
十三、先啟動Tomcat Server再啟動Apache Server
原文出處:架設Apache run 80、Tomcat run 8080 用 mod_jk 架設的步驟 | Fly&Fly
清除指令make distclean
一、安裝apr
./configure –prefix=/usr/local/apr
make && make install
[code]
二、安裝apr-util
[code]
./configure –with-apr=/usr/local/apr –prefix=/usr/local/apr
make && make install
三、安裝apr-iconv-1.2.1
./configure –with-apr=/usr/local/apr –prefix=/usr/local/apr
make && make install
四、安裝pcre-8.32
./configure –prefix=/usr/local/pcre –docdir=/usr/share/doc/pcre-8.34 –enable-unicode-properties
–enable-pcre16 –enable-pcre32 –enable-pcregrep-libz –enable-pcregrep-libbz2
–enable-pcretest-libreadline –disable-static
make && make install
安裝openssl
./config shared
make && make install
other:安裝php
./configure –prefix=/usr/local/php –with-config-file-path=/usr/local/php/etc –with-mysql=/usr/local/mysql
–with-mysqli=/usr/local/mysql/bin/mysql_config –with-iconv-dir=/usr/local –with-freetype-dir
–with-jpeg-dir –with-png-dir –with-zlib –with-libxml-dir=/usr –with-ldap –with-ldap-sasl
–with-xmlrpc –with-curl –with-curlwrappers –with-mcrypt –with-gd –with-openssl –with-mhash
–enable-xml –enable-rpath –enable-discard-path –enable-safe-mode –enable-bcmath –enable-shmop
–enable-sysvsem –enable-inline-optimization –enable-mbregex –enable-fastcgi –enable-fpm
–enable-force-cgi-redirect –enable-mbstring –enable-gd-native-ttf –enable-pcntl –enable-sockets
–enable-zip –enable-soap –enable-so –with-openssl=/usr/local/openssl –with-openssl=shared
–with-apxs2=/usr/local/httpd/bin/apxs –with-ldap=/usr/lib64
make && make install
五、安裝Apache Web Server
./configure –prefix=/usr/local/httpd –with-apr=/usr/local/apr –with-apr-util=/usr/local/apr
–with-pcre=/usr/local/pcre –with-ssl=/usr/local/openssl –enable-ssl –enable-so
make && make install
六、安裝mod_jk.so 編譯tomcat-connectors-1.2.37-src
configure需要進入native folder
./configure –with-apxs=/usr/local/apache2/bin/apxs
make && make install
七、設定conf/httpd.conf
新增:
LoadModule jk_module modules/mod_jk.so
Include conf/extra/mod_jk.conf
修改:將Virtual hosts的config檔案include進httpd.conf
將前面的『#』拿掉
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
八、從tomcat-connectors-1.2.37-src
(一)、複製httpd-jk.conf到/usr/local/apache2/conf/extra/
將httpd-jk.conf重新命名為mod_jk.conf
(二)、複製 workers.properties到/usr/local/apache2/conf/extra/
九、修改conf/extra/mod_jk.conf
(一)、把第22行變成註解,在該行最前面加上『#』
#LoadModule jk_module modules/mod_jk.so
因為so檔已經在httpd.conf裡面載入了,不需重覆載入。
(二)、在 前面加上下面的敘述
JkLogStampFormat “[%a %b %d %H:%M:%S %Y] "
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
JkRequestLogFormat “%w %V %T"
JkMount /folder1/ mobile
JkMount /folder1/* mobile
JkMount /folder2/ pcweb
JkMount /folder2/* pcweb
(三)、修改第28行workers.properties的位置
JkWorkersFile conf/extra/workers.properties
十、修改conf/extra/workers.properties
在檔案最後加上
worker.balancer.balance_workers=pcweb
worker.list=pcweb
worker.pcweb.reference=worker.template
worker.pcweb.host=192.168.10.153
worker.pcweb.port=8009
worker.pcweb.type=ajp13
worker.pcweb.activation=A
worker.balancer.balance_workers=mobile
worker.list=mobile
worker.mobile.reference=worker.template
worker.mobile.host=192.168.10.154
worker.mobile.port=8009
worker.mobile.type=ajp13
worker.mobile.activation=A
十一、修改conf/extra/httpd-vhosts.conf
將舊的設定全部加上『#』變成註解,並在下面的資料加在最後面
<VirtualHost *:80>
JkMount /folder1 mobile
JkMount /folder1/* mobile
JkMount /folder2 pcweb
JkMount /folder2/* pcweb
</VirtualHost>
十二、修改tomcat server 的conf/server.xml
<Connector port="8009″ protocol="AJP/1.3″ redirectPort="8443″ /> <!–這是導向https 443–>
改成
<Connector port="8009″ protocol="AJP/1.3″ redirectPort="8080″ /> <!–這是導向8080 ports–>
十三、先啟動Tomcat Server再啟動Apache Server
原文出處:架設Apache run 80、Tomcat run 8080 用 mod_jk 架設的步驟 | Fly&Fly