{"id":2548,"date":"2024-07-15T16:45:23","date_gmt":"2024-07-15T08:45:23","guid":{"rendered":"https:\/\/yowlab.idv.tw\/wordpress\/?p=2548"},"modified":"2026-04-05T13:44:51","modified_gmt":"2026-04-05T05:44:51","slug":"%e5%b0%87-resin-server-%e5%92%8c-apache-http-server-%e6%95%b4%e5%90%88%e5%9c%a8%e4%b8%80%e8%b5%b7","status":"publish","type":"post","link":"https:\/\/yowlab.idv.tw\/wordpress\/?p=2548","title":{"rendered":"\u5c07 Resin Server \u548c Apache http Server \u6574\u5408\u5728\u4e00\u8d77"},"content":{"rendered":"<p>Resin server \u662f\u8655\u7406 JSP \u8981\u6c42\u7684 Server, Apache http Server \u4e3b\u8981\u662f\u8655\u7406\u975c\u614b\u7db2\u9801\u4ee5\u53ca php \u8981\u6c42\u7684 Server\u3002<\/p>\n<p>\u76ee\u524d Resin server \u96d6\u7136\u5df2\u6709\u63d0\u4f9b\u975c\u614b\u7db2\u9801\u4ee5\u53ca\u8655\u7406 php \u8981\u6c42\u7684\u529f\u80fd\uff0c\u4f46\u7fd2\u6163\u4e0a\uff0c\u4ecd\u4ee5 Apache http Server \u4f86\u8655\u7406\u9019\u4e9b\u8981\u6c42\u3002<\/p>\n<p>\u6240\u4ee5\uff0c\u8a72\u5982\u4f55\u5c07\u5169\u500b Server \u6574\u5408\u8d77\u4f86\uff0c\u7576\u9700\u8981\u57f7\u884c jsp \u9700\u6c42\u6642\uff0c\u5c31\u8f49\u7d66 Resin Server\u3002\u7576\u6709\u975c\u614b\u7db2\u9801\u4ee5\u53ca\u57f7\u884c php \u9700\u6c42\u7684\u5de5\u4f5c\u6642\uff0c\u5c31\u7531 Apache http Server \u4f86\u8655\u7406\u7684\u914d\u7f6e\u65b9\u6cd5\uff0c\u5c31\u662f\u672c\u6587\u5e95\u4e0b\u8981\u4ecb\u7d39\u7684\u3002<\/p>\n<style type=\"text\/css\">\n    li.present01 {line-height:1.5em; background-color:#F5E5C9; padding:5px; border-radius:10px; font-weight:bold; margin:5px;}\n    li.present02 {line-height:1.5em; background-color:#D1EC87; padding:5px; border-radius:10px; font-weight:bold; margin:5px;}\n    li.present03 {line-height:1.5em; background-color:#b3dffa; padding:5px; border-radius:10px; font-weight:bold; margin:5px;}\n    li.present04 {line-height:1.5em; background-color:#FDF6FF; padding:10px; border-radius:10px; font-weight:bold; margin:5px;}\n    ol.lower-alpha {list-style-type:lower-alpha;}\n    ol.lower-roman {list-style-type:lower-roman;}\n    ul.none {list-style-type:none;line-height:1.5em; padding:10px;}\n    ul.note {line-height:1.5em; padding:10px;}\n    .highlight01 {font-weight:bold; line-height:1.5em; background-color:#e7f49c; padding:0px 2px; border:1px; border-radius:10px;}\n    .highlight02 {font-weight:bold; line-height:1.5em; background-color:#F2F26B; padding:1px 1px; border:1px;}\n    .highlight03 {font-weight:bold; line-height:1.5em; background-color:#F9BF72; padding:3px 10px; border:2px; border-radius:10px;}\n   .box01 {margin: 5px; border:1px #19130B solid; border-radius:5px; padding:10px;}\n    .box02 {margin: 5px; font-weight:bold; line-height:1.5em; padding:10px; border:1px #19130B solid; border-radius:5px; float: left;}\n    h3 {border:2px #000 solid; border-width:0px 0px 1px 0px; padding-width:0px 0px 3px 0px;}\n    h4 {border:2px #000 solid; border-width:0px 0px 1px 0px; padding-width:3px 0px 3px 0px;margin: 3px 0px 10px 0px ;font-weight:bold; line-height:1.5em;  }\n    h5 {background-color:#eff0f1; padding:10px; font-weight:bold; line-height:2em; border:1px #000 solid; border-width:1px 0px 1px 0px; margin: 5px 0px 20px 0px;}<\/p>\n<p>    pre {margin: 5px; border:0px #19130B solid; border-radius:5px; padding:10px;line-height:2em;}\n<\/style>\n<p>\u7cfb\u7d71\u793a\u610f\u5716\uff1a<br \/>\n<a href=\"https:\/\/yowlab.idv.tw\/wordpress\/wp-content\/uploads\/2024\/07\/apache_srun.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/yowlab.idv.tw\/wordpress\/wp-content\/uploads\/2024\/07\/apache_srun.png\" alt=\"\" width=\"600\" height=\"276\" class=\"alignnone size-full wp-image-2554\" srcset=\"https:\/\/yowlab.idv.tw\/wordpress\/wp-content\/uploads\/2024\/07\/apache_srun.png 600w, https:\/\/yowlab.idv.tw\/wordpress\/wp-content\/uploads\/2024\/07\/apache_srun-350x161.png 350w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>\u7531\u5716\u4e2d\u53ef\u4ee5\u5f97\u77e5\uff0c\u6211\u5011\u53ef\u4ee5\u5229\u7528\u300cmod_caucho(C)\u300d\u6a21\u7d44\u65b9\u584a\u5c45\u4e2d\u8655\u7406\u5354\u8abf\u3002<\/p>\n<p>\u00a0<\/p>\n<h5>\u82e5\u7db2\u7ad9\u662f\u8655\u65bc\u91cd\u65b0\u90e8\u7f72\u72c0\u614b\uff0c\u90a3\u9ebc\u5efa\u8b70\uff1a<\/h5>\n<ol>\n<li class=\"present01\">\u5b89\u88dd Apache httpd <\/li>\n<p>    sudo apt -y install apache2 apache2-dev<\/p>\n<li class=\"present01\">\u4e0b\u8f09 resin server \u539f\u59cb\u78bc\uff0c\u89e3\u58d3\u7e2e\uff0c\u7de8\u8b6f\uff0c\u5b89\u88dd<\/li>\n<pre>\n .\/configure  --prefix=(resin\u5b89\u88dd\u76ee\u9304\uff09 \\\n              --with-apxs=\/usr\/bin\/apxs  \n  make  \n  sudo make install  \n <\/pre>\n<li class=\"present01\">mod_caochu.so \u6703\u88ab\u7de8\u8b6f\u51fa\u4f86<\/li>\n<p>    \u5728 resin \u7de8\u8b6f\u5b8c\u6210\u5f8c\uff0cmod_caochu.so \u6703\u88ab\u7de8\u8b6f\u51fa\u4f86\uff0c\u4e26\u4e14\u653e\u5165<span class=\"highlight01\"> \/usr\/lib\/apache2\/modules <\/span>\u76ee\u9304\u4e0b\u3002<\/p>\n<\/ol>\n<p>\u00a0<\/p>\n<h5>\u82e5 Apache http server \u8207 Resin Server \u90fd\u5df2\u5728\u57f7\u884c\uff0c\u4e0d\u9700\u8981\u91cd\u65b0\u90e8\u7f72\u3002<\/h5>\n<ol>\n<li class=\"present01\">\u82e5\u7cfb\u7d71\u627e\u4e0d\u5230 apxs \u8005<\/li>\n<p>    \u82e5 Server \u7684\u4f5c\u696d\u7cfb\u7d71\u662f Debian\/Ubuntu \u7cfb\u5217\uff0c\u53ef\u80fd\u53ea\u662f\u5b89\u88dd apache2 \u5957\u4ef6\uff0c\u6b64\u6642\u5247\u9700\u8981\u52a0\u88dd apache2-dev \u5957\u4ef6\uff0c<span class=\"highlight01\">apxs \u5c31\u5728 apache2-dev \u5957\u4ef6\u5167<\/span>\uff0c\u5b89\u88dd\u5b8c\u6210\u5f8c\uff0c\u9810\u8a2d\u6703\u88ab\u653e\u5165 \/usr\/bin \u9019\u500b\u76ee\u9304\u4e0b\uff0c\u6240\u4ee5<span class=\"highlight01\">\u5b8c\u6574\u8def\u5f91\u70ba\uff1a\/usr\/bin\/apxs <\/span> \u3002 <\/p>\n<li class=\"present01\">\u4e0b\u8f09 resin server \u539f\u59cb\u78bc\uff0c\u89e3\u58d3\u7e2e\uff0c\u7de8\u8b6f<\/li>\n<pre>\n cd (resin\u539f\u59cb\u78bc\u76ee\u9304)\/\n .\/configure  --prefix=(resin\u5b89\u88dd\u76ee\u9304\uff09 \\\n              --with-apxs=\/usr\/bin\/apxs  \n make  \n <\/pre>\n<li class=\"present01\">\u5c07 mod_caucho.so \u653e\u5230 apache \u76f8\u95dc\u7684 module \u7684\u76ee\u9304\u4e0b<\/li>\n<pre>\n sudo cp (resin\u539f\u59cb\u78bc\u76ee\u9304)\/modules\/c\/src\/apache2\/.libs\/mod_caucho.so \\\n          \/usr\/lib\/apache2\/modules\/\n <\/pre>\n<\/ol>\n<p>\u00a0<\/p>\n<h5>\u89e3\u6c7a cauchu.so \u554f\u984c\u5f8c\uff0c\u63a5\u4e0b\u4f86\u2026<\/h5>\n<ol>\n<li class=\"present01\">\u5c07\u4ee5\u4e0b\u8a2d\u5b9a\u653e\u5165 apache server \u8a2d\u5b9a\u4e2d<\/li>\n<pre>\nLoadModule caucho_module  \\\n  \/usr\/lib\/apache2\/modules\/mod_caucho.so\n\n# mod_caucho\n&lt;IfModule mod_caucho.c&gt;\n  ResinConfigServer localhost 6800\n  &lt;Location \/webapp&gt;\n    SetHandler caucho-request \n  &lt;\/Location&gt;\n&lt;\/IfModule&gt;\n<\/pre>\n<li class=\"present01\">\u5728 apache server \u8a2d\u5b9a\u4e2d\uff0c\u8a2d\u7f6e\u6587\u4ef6\u8655\u7406\u9806\u5e8f\uff0c\u6dfb\u52a0\u6216\u4fee\u6539\u4ee5\u4e0b\u5167\u5bb9\uff1a<\/li>\n<pre>\n&lt;IfModule mod_dir.c&gt;\n   DirectoryIndex index.jsp index.php index.html index.xhtml index.htm  \n&lt;\/IfModule&gt;\n<\/pre>\n<li class=\"present01\">\u95dc\u9589 Resin Server \u7684 php \u529f\u80fd<\/li>\n<p>    \u5728 Resin \u7684\u914d\u7f6e\u6587\u4ef6 app-default.xml \u4e2d\u5c0b\u627e\u8207 PHP \u76f8\u95dc\u7684\u914d\u7f6e\u3002\u53ef\u80fd\u6703\u6709\u985e\u4f3c\u9019\u6a23\u7684\u5167\u5bb9\uff0c\u627e\u5230\u5f8c\u8acb\u522a\u6389\uff0c\u6216\u662f\u8a3b\u89e3\u8d77\u4f86\uff1a<\/p>\n<pre>\n  &lt;servlet servlet-name=\"resin-php\"\n     servlet-class=\"com.caucho.quercus.servlet.QuercusServlet\"&gt;\n  &lt;\/servlet&gt;\n\n<hr>\n  &lt;resin:if test=\"${! quercus_disable}\"&gt;\n    &lt;servlet-mapping url-pattern=\"*.php\" \n       servlet-name=\"resin-php\"\n       default=\"true\"\/&gt;\n  &lt;\/resin:if&gt;\n\n<hr>\n&lt;welcome-file&gt;index.php&lt;\/welcome-file&gt;\n<\/pre>\n<li class=\"present01\">\u91cd\u65b0\u555f\u52d5\u7db2\u7ad9\u670d\u52d9<\/li>\n<p>    \u6700\u5f8c\u91cd\u65b0\u555f\u52d5 Apache http Server \u548c Resin Server \u670d\u52d9\uff0c\u8b93\u8a2d\u5b9a\u503c\u53ef\u4ee5\u751f\u6548\u3002<\/p>\n<\/ol>\n<p>\u00a0<\/p>\n<h3>2026-04-05 \u88dc\u5145<\/h3>\n<p>Resin Server \u67b6\u597d\u4e4b\u5f8c\uff0c\u5982\u4f55\u8b93\u4ed6\u958b\u6a5f\u81ea\u52d5\u57f7\u884c\uff1f<br \/>\n\u76ee\u524d\u6709\u4ee5\u4e0b\u5169\u500b\u65b9\u6cd5\uff1a<\/p>\n<ol>\n<li>\n<p><span class=\"highlight01\">\u50b3\u7d71\u65b9\u6cd5\uff1aSysV init  <\/span><br \/>\n\u7de8\u8b6f resin \u6642\uff0c\u540c\u6642\u6703\u7522\u751f<span class=\"highlight01\"> init.d \u76ee\u9304\uff0c\u5728\u8a72\u76ee\u9304\u5e95\u4e0b\u6a94\u6848 resin <\/span>\u4fbf\u662f SysV \u7684\u8173\u672c\u6a94\u6848\u3002<span class=\"highlight01\">\u5c07\u8a72\u6a94\u6848 resin \u8907\u88fd\u5230 \/etc\/init.d\/ \u5e95\u4e0b<\/span>\uff0c\u4e26\u505a\u500b\u5c0f\u624b\u8173\uff0c\u6b65\u9a5f\u5982\u4e0b\uff1a<\/p>\n<pre><code>\nsudo cp  (resin\u7de8\u8b6f\u76ee\u9304)\/init..d\/resin  \/etc\/init.d\/\nsudo ln -s \/etc\/init.d\/resin  \/etc\/rc2.d\/S90resin\nsudo ln -s \/etc\/init.d\/resin  \/etc\/rc3.d\/S90resin\nsudo ln -s \/etc\/init.d\/resin  \/etc\/rc4.d\/S90resin\nsudo ln -s \/etc\/init.d\/resin  \/etc\/rc5.d\/S90resin\n<\/code><\/pre>\n<\/li>\n<li>\n<p><span class=\"highlight01\">\u76ee\u524d\u7cfb\u7d71\u5efa\u8b70\u63a1\u7528\u7684\u65b9\u6cd5\uff1aSystemd <\/span><br \/>\n\u76f4\u63a5\u5c07\u7de8\u8b6f\u6642 init.d \u76ee\u9304\u5e95\u4e0b\u6a94\u6848 resin \u6539\u5beb\u6210 Systemd \u683c\u5f0f\uff0c\u5167\u5bb9\u5982\u4e0b\uff1a<\/p>\n<pre><code>\n[Unit]\nDescription=The Resin Java Application Server\nAfter=network.target remote-fs.target\n\n[Service]\nType=forking\nUser=root\n\n#\u6839\u64da\u539f\u8173\u672c\u8a2d\u5b9a\u74b0\u5883\u8b8a\u6578\nEnvironment=RESIN_HOME=\/usr\/local\/resin4\nEnvironment=JAVA_HOME=\/usr\/lib\/jvm\/java-1.25.0-openjdk-amd64\n##\u76ee\u524d openjdk \u7248\u672c\u70ba 1.25.0\n\n#\u555f\u52d5\u8207\u505c\u6b62\u6307\u4ee4\nExecStart=\/usr\/local\/resin4\/bin\/resinctl start-all\nExecStop=\/usr\/local\/resin4\/bin\/resinctl shutdown\n\n#\u65e5\u8a8c\u8207\u5de5\u4f5c\u76ee\u9304\nStandardOutput=append:\/usr\/local\/resin4\/log\/console.log\nStandardError=append:\/usr\/local\/resin4\/log\/console.log\n\n[Install]\nWantedBy=multi-user.target\n\n<\/code><\/pre>\n<p>\u5c07\u4ee5\u4e0a\u5167\u5bb9<span class=\"highlight01\">\u5728\u76ee\u9304 \/etc\/systemd\/system\/ \u4e0b\u5b58\u6210 resin.service <\/span>\u6a94\uff0c\u7136\u5f8c\uff0c\u518d\u505a\u500b\u8a2d\u5b9a\u3002<\/p>\n<pre><code>\nsudo chmod 744 \/etc\/systemd\/system\/resin.service\nsudo systemctl enable \/etc\/systemd\/system\/resin.service\nsudo systemctl start  \/etc\/systemd\/system\/resin.service\n<\/code><\/pre>\n<\/li>\n<\/ol>\n<p>\u4ee5\u4e0a\u4efb\u610f\u4e00\u7a2e\u65b9\u6cd5\uff0c\u90fd\u53ef\u4ee5\u9054\u6210\u958b\u6a5f\u4fbf\u80fd\u81ea\u52d5\u555f\u52d5\u6548\u679c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Resin server \u662f\u8655\u7406 JSP \u8981\u6c42\u7684 Server, Apache h <a class=\"more-link\" href=\"https:\/\/yowlab.idv.tw\/wordpress\/?p=2548\">Continue reading <span class=\"screen-reader-text\">  \u5c07 Resin Server \u548c Apache http Server \u6574\u5408\u5728\u4e00\u8d77<\/span><span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[95,96],"class_list":["post-2548","post","type-post","status-publish","format-standard","hentry","category-3","tag-jsp","tag-resin-server"],"_links":{"self":[{"href":"https:\/\/yowlab.idv.tw\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/2548","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/yowlab.idv.tw\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/yowlab.idv.tw\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/yowlab.idv.tw\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/yowlab.idv.tw\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2548"}],"version-history":[{"count":46,"href":"https:\/\/yowlab.idv.tw\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/2548\/revisions"}],"predecessor-version":[{"id":3865,"href":"https:\/\/yowlab.idv.tw\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/2548\/revisions\/3865"}],"wp:attachment":[{"href":"https:\/\/yowlab.idv.tw\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2548"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/yowlab.idv.tw\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2548"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/yowlab.idv.tw\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2548"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}