{"id":421,"date":"2021-02-26T16:52:09","date_gmt":"2021-02-26T07:52:09","guid":{"rendered":"https:\/\/java.ihavenomoney.co.kr\/?p=421"},"modified":"2022-11-18T16:40:39","modified_gmt":"2022-11-18T07:40:39","slug":"centos7-%ec%95%84%ed%8c%8c%ec%b9%98apache2-%ec%99%80-%ed%86%b0%ec%ba%a3tomcat8-%ec%97%b0%eb%8f%99%ed%95%98%ea%b8%b0","status":"publish","type":"post","link":"https:\/\/java.ihavenomoney.co.kr\/?p=421","title":{"rendered":"CentOS7 \uc544\ud30c\uce58(Apache2) \ud1b0\ucea3(Tomcat8) \uc5f0\ub3d9"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">remark :<\/h3>\n\n\n\n<p>WAS (\ud1b1\ucf13) 8080 \ud3ec\ud2b8 \ub300\uc2e0 80 \ud3ec\ud2b8\ub85c \ubcc0\ud658\uae30\ud558 \uc704\ud574 Tomcat Connectors \uc778 mod_jk\ub97c \uc138\ud305\ud574 \ubcf4\uc790.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"991\" height=\"320\" src=\"https:\/\/java.ihavenomoney.co.kr\/wp-content\/uploads\/2021\/01\/mod_jk.jpg\" alt=\"\" class=\"wp-image-385\" srcset=\"https:\/\/java.ihavenomoney.co.kr\/wp-content\/uploads\/2021\/01\/mod_jk.jpg 991w, https:\/\/java.ihavenomoney.co.kr\/wp-content\/uploads\/2021\/01\/mod_jk-300x97.jpg 300w, https:\/\/java.ihavenomoney.co.kr\/wp-content\/uploads\/2021\/01\/mod_jk-768x248.jpg 768w, https:\/\/java.ihavenomoney.co.kr\/wp-content\/uploads\/2021\/01\/mod_jk-660x213.jpg 660w\" sizes=\"auto, (max-width: 991px) 100vw, 991px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">1. Download Site link : https:\/\/tomcat.apache.org\/download-connectors.cgi<\/h3>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"949\" height=\"613\" src=\"https:\/\/java.ihavenomoney.co.kr\/wp-content\/uploads\/2021\/02\/download-connectors.jpg\" alt=\"\" class=\"wp-image-536\" srcset=\"https:\/\/java.ihavenomoney.co.kr\/wp-content\/uploads\/2021\/02\/download-connectors.jpg 949w, https:\/\/java.ihavenomoney.co.kr\/wp-content\/uploads\/2021\/02\/download-connectors-300x194.jpg 300w, https:\/\/java.ihavenomoney.co.kr\/wp-content\/uploads\/2021\/02\/download-connectors-768x496.jpg 768w\" sizes=\"auto, (max-width: 949px) 100vw, 949px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">2. Download \/tmp<\/h3>\n\n\n\n<pre class=\"wp-block-code lang:vim decode:true\"><code># cd \/tmp\n# wget http:\/\/mirror.apache-kr.org\/tomcat\/tomcat-connectors\/jk\/tomcat-connectors-1.2.48-src.tar.gz<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">3. tar \ud480\uae30<\/h3>\n\n\n\n<pre class=\"wp-block-code lang:vim decode:true\"><code># tar xvfz tomcat-connectors-1.2.48-src.tar.gz<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">4. configure \uba85\ub839\uc5b4\ub97c \uc774\uc6a9\ud574\uc11c make \ud30c\uc77c \uc0dd\uc131<\/h3>\n\n\n\n<pre class=\"wp-block-code lang:vim decode:true\"><code># cd \/tmp\n# cd tomcat-connectors-1.2.48-src\n# cd native\n\n# .\/buildconf.sh\n\n# .\/configure --with-apxs=\/usr\/bin\/apxs\t\n# make\n# make install\t\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">4.1 Error solution<\/h3>\n\n\n\n<pre class=\"wp-block-code lang:vim decode:true\"><code>configure: error: Invalid location for apxs: '\/usr\/bin\/apxs'\n\n# yum install httpd-devel\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">4.2 mod_jk.so file check<\/h3>\n\n\n\n<pre class=\"wp-block-code lang:vim decode:true\"><code># ls -1 \/etc\/httpd\/modules\/mod_jk.so\n\/etc\/httpd\/modules\/mod_jk.so\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">5. mod_jk.conf configuration<\/h3>\n\n\n\n<pre class=\"wp-block-code lang:vim decode:true\"><code># vi \/etc\/httpd\/conf.modules.d\/mod_jk.conf\n\nLoadModule proxy_module  modules\/mod_proxy.so\nLoadModule rewrite_module  modules\/mod_rewrite.so\nLoadModule jk_module \/etc\/httpd\/modules\/mod_jk.so\n\nJkWorkersFile \/etc\/httpd\/conf\/workers.properties\nJkShmFile     \/var\/run\/httpd\/mod_jk.shm\nJkLogFile     \/var\/log\/httpd\/mod_jk.log\nJkLogLevel    info\nJkLogStampFormat \"&#91;%a %b %d %H:%M:%S %Y] \"\nJkRequestLogFormat     \"%w %V %T\"\n\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">6. workers.properties configuration<\/h3>\n\n\n\n<pre class=\"wp-block-code lang:vim decode:true\"><code># vi \/etc\/httpd\/conf\/workers.properties\n\nworkers.tomcat_home=\/opt\/tomcat\nworkers.java_home=\/usr\/lib\/jvm\/java-1.8.0-openjdk\nps=\/\n\n#worker.apache_log=\/var\/log\/httpd\n\nworker.list=ajp13_worker\nworker.ajp13_worker.port=8009\nworker.ajp13_worker.host=localhost\nworker.ajp13_worker.type=ajp13\n\nworker.ajp13_worker.lbfactor=1\nworker.loadbalancer.type=lb\nworker.loadbalancer.balance_workers=ajp13_worker\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">7. Tomcat8 server.xml configuration add<\/h3>\n\n\n\n<pre class=\"wp-block-code lang:vim decode:true\"><code># vim \/opt\/tomcat\/conf\/server.xml    \/\/tomcat \uacbd\ub85c \ucc3e\uc544\uc11c \n\n\n&lt;!-- Define an AJP 1.3 Connector on port 8009 --&gt;\n&lt;Connector port=\"8009\"\nprotocol=\"AJP\/1.3\" redirectPort=\"8443\" URIEncoding=\"UTF-8\" useBodyEncodingForURI=\"true\" \/&gt;\n\n\n\n&lt;!-- \ub610\ub294 secret\ub85c \uc138\ud305 --&gt;\n&lt;Connector port=\"8009\"\nprotocol=\"AJP\/1.3\" secret=\"ajpSecretKey\" address=\"::1\" secretRequired=\"true\"\nredirectPort=\"8443\" URIEncoding=\"UTF-8\"\nuseBodyEncodingForURI=\"true\" \/&gt;\n \n\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">8. virtual Site Setting<\/h3>\n\n\n\n<pre class=\"wp-block-preformatted lang:vim decode:true\">sudo mkdir \/etc\/httpd\/sites-available\nsudo mkdir \/etc\/httpd\/sites-enabled<\/pre>\n\n\n\n<pre class=\"wp-block-code lang:vim decode:true\"><code># sudo vim \/etc\/httpd\/conf\/httpd.conf\n\n#Add this line to the end of the file:\n\nIncludeOptional sites-enabled\/*.conf<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code lang:vim decode:true\"><code># vi \/etc\/httpd\/sites-available\/jsp.conf\n&lt;VirtualHost *:80&gt;\n\n       ServerName jsp.test.co.kr\n       #ServerAlias jsp.test.co.kr\n\n        ServerAdmin root@localhost\n        DocumentRoot \/var\/www\/jsp\/ROOT\n\n       &lt;IfModule mod_jk.c&gt;\n       JKMount \/ ajp13_worker\n       JKMount \/* ajp13_worker\n       &lt;\/IfModule&gt;\n\n       ErrorLog \/var\/log\/httpd\/error.log\n       CustomLog \/var\/log\/httpd\/access.log combined\n\n&lt;Directory \/var\/www\/jsp\/ROOT &gt;\n   Options FollowSymLinks\n   AllowOverride None\n   Order Deny,Allow\n   Allow from all\n   Require all granted\n&lt;\/Directory&gt;\n\n&lt;\/VirtualHost&gt;\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">9. Tomcat Virtual Setting Site Add<\/h3>\n\n\n\n<pre class=\"wp-block-code lang:vim decode:true\"><code>vi \/opt\/tomcat\/conf\/server.xml    \/\/tomcat \uacbd\ub85c \ucc3e\uc544\uc11c \n\n&lt;Host name=\"jsp.test.co.kr\" appBase=\"\/var\/www\/jsp\"\n            unpackWARs=\"true\" autoDeploy=\"true\"\n             xmlValidation=\"false\" xmlNamespaceAware=\"false\"&gt;\n\n&lt;\/Host&gt;\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">10. Site load ln -s<\/h3>\n\n\n\n<pre class=\"wp-block-code lang:vim decode:true\"><code>sudo ln -s \/etc\/httpd\/sites-available\/jsp.conf \/etc\/httpd\/sites-enabled\/jsp.conf\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">11. Tomcat\/ Apache restart<\/h3>\n\n\n\n<pre class=\"wp-block-code lang:vim decode:true\"><code># systemctl restart tomcat\n# systemctl restart httpd\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">12. port 8090 Check<\/h3>\n\n\n\n<p>tcp6 0 0 ::1:8009<\/p>\n\n\n\n<pre class=\"wp-block-code lang:vim decode:true\"><code># netstat -tnlp\nActive Internet connections (only servers)\nProto Recv-Q Send-Q Local Address           Foreign Address         State       PID\/Program name\ntcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      950\/sshd\ntcp6       0      0 :::21                   :::*                    LISTEN      5456\/vsftpd\ntcp6       0      0 :::22                   :::*                    LISTEN      950\/sshd\ntcp6       0      0 ::1:8009                :::*                    LISTEN      2582\/java\ntcp6       0      0 :::80                   :::*                    LISTEN      2621\/httpd\ntcp6       0      0 :::8080                 :::*                    LISTEN      2582\/java\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">13. Error check: mod_jk.log<\/h3>\n\n\n\n<pre class=\"wp-block-code lang:vim decode:true\"><code>&#91;info] jk_open_socket::jk_connect.c (815): connect to ::1:8009 failed (errno=111)<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">tomcat(tcp6 :::8080) -&gt; mod_jk (tcp6 ::1:8009) -&gt; httpd (tcp6 :::80)<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\ube44\uace0) \uc2ec\ubcfc\ub9ad \ub9c1\ud06c \uc0ad\uc138 -&gt; \uac00\uc0c1\ud654\ub97c \uc0ad\uc81c<\/h3>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:vim decode:true \">rm -f \/etc\/httpd\/sites-enabled\/jsp.conf<\/pre><\/div>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>remark : WAS (\ud1b1\ucf13) 8080 \ud3ec\ud2b8 \ub300\uc2e0 80 \ud3ec\ud2b8\ub85c \ubcc0\ud658\uae30\ud558 \uc704\ud574 Tomcat Connectors \uc778 mod_jk\ub97c \uc138\ud305\ud574 \ubcf4\uc790. 1. Download Site link : https:\/\/tomcat.apache.org\/download-connectors.cgi 2. Download \/tmp 3. tar \ud480\uae30 4. configure \uba85\ub839\uc5b4\ub97c \uc774\uc6a9\ud574\uc11c make \ud30c\uc77c \uc0dd\uc131 4.1 Error solution 4.2 mod_jk.so file check 5. mod_jk.conf configuration 6. workers.properties configuration 7. Tomcat8 server.xml configuration add 8. &hellip;<br \/><a href=\"https:\/\/java.ihavenomoney.co.kr\/?p=421\" class=\"more-link pen_button pen_element_default pen_icon_arrow_double\"><span class=\"screen-reader-text\">CentOS7 \uc544\ud30c\uce58(Apache2) \ud1b0\ucea3(Tomcat8) \uc5f0\ub3d9<\/span> \ub354\ubcf4\uae30<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-421","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/java.ihavenomoney.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/421","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/java.ihavenomoney.co.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/java.ihavenomoney.co.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/java.ihavenomoney.co.kr\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/java.ihavenomoney.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=421"}],"version-history":[{"count":12,"href":"https:\/\/java.ihavenomoney.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/421\/revisions"}],"predecessor-version":[{"id":883,"href":"https:\/\/java.ihavenomoney.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/421\/revisions\/883"}],"wp:attachment":[{"href":"https:\/\/java.ihavenomoney.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=421"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/java.ihavenomoney.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=421"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/java.ihavenomoney.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=421"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}