{"id":227,"date":"2015-02-15T23:05:21","date_gmt":"2015-02-15T15:05:21","guid":{"rendered":"http:\/\/weitaoc.com\/?p=227"},"modified":"2015-02-15T23:59:15","modified_gmt":"2015-02-15T15:59:15","slug":"windowsphpapachetomcat%e5%ae%8c%e7%be%8e%e9%9b%86%e6%88%90%e4%b9%8btomcat%e5%92%8capache%e9%9b%86%e6%88%90","status":"publish","type":"post","link":"http:\/\/weitaoc.com\/?p=227","title":{"rendered":"windows+php+apache+tomcat\u5b8c\u7f8e\u96c6\u6210\u4e4btomcat\u548capache\u96c6\u6210"},"content":{"rendered":"<p>\u524d\u9762\u4e5f\u900f\u9732\u4e86\uff0ctomcat\u548capache\u7684\u96c6\u6210\u6ca1\u6709\u7528\u5230\u4f20\u7edf\u7684jk mod\u65b9\u5f0f\u53bb\u96c6\u6210\uff0c\u91c7\u7528\u7684\u662f\u7aef\u53e3\u4ee3\u7406\uff0c\u539f\u7406\u5c31\u662f\u5c06\u67d0\u4e2a\u7aef\u53e3\u7684\u8bf7\u6c42\u8f6c\u53d1\u5230\u6307\u5b9a\u7aef\u53e3\uff0c\u56e0\u4e3a\u6211\u7684vps\u9700\u8981\u652f\u6301php\u548ctomcat\u6240\u4ee5\u5c31\u4e0d\u80fd\u5c06\u8fd9\u4e2aIP\u4e0b80\u7aef\u53e3\u7684\u8bf7\u6c42\u5168\u90e8\u8f6c\u53d1\u52308080\u7aef\u53e3\uff0c\u8fd9\u662f\u6ca1\u610f\u4e49\u7684\u3002\u6240\u4ee5\uff0c\u73b0\u5728\u7684\u9700\u6c42\u5c31\u662f\u5c06\u67d0\u4e2a\u57df\u540d80\u7aef\u53e3\u7684\u8bf7\u6c42\u8f6c\u53d1\u52308080\u7aef\u53e3\u3002<\/p>\n<p>1.httpd.conf\u914d\u7f6e<\/p>\n<p>\u6253\u5f00httpd.conf\u67e5\u627ehttpd-vhosts.conf\uff0c\u627e\u5230\u540e\u5c06\u8fd9\u4e00\u884c\u7684\u6ce8\u91ca\u53d6\u6d88\u6389\u3002<\/p>\n<p>\u4e4b\u524d\uff1a<\/p>\n<div class=\"codecolorer-container text geshi\" style=\"overflow:auto;white-space:nowrap;width:100%;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/><\/div><\/td><td><div class=\"text codecolorer\" style=\"white-space:nowrap\">#Include conf\/extra\/httpd-vhosts.conf<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>\u4e4b\u540e<\/p>\n<div class=\"codecolorer-container text geshi\" style=\"overflow:auto;white-space:nowrap;width:100%;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/><\/div><\/td><td><div class=\"text codecolorer\" style=\"white-space:nowrap\">Include conf\/extra\/httpd-vhosts.conf<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>2.\u52a0\u8f7d\u4ee3\u7406\u6a21\u5757<\/p>\n<p>\u627e\u5230proxy_module\uff0c\u53bb\u6389\u6ce8\u91ca\u3002\u5fd8\u8bb0\u4e4b\u524d\u662f\u600e\u4e48\u6837\u4e86\uff0c\u53cd\u6b63\u73b0\u5728\u7684\u4ee3\u7406\u6a21\u5757\u6211\u662f\u5168\u5f00\u4e86\u3002<\/p>\n<div class=\"codecolorer-container text geshi\" style=\"overflow:auto;white-space:nowrap;width:100%;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/>2<br \/>3<br \/>4<br \/>5<br \/>6<br \/>7<br \/><\/div><\/td><td><div class=\"text codecolorer\" style=\"white-space:nowrap\">LoadModule proxy_module modules\/mod_proxy.so<br \/>\nLoadModule proxy_ajp_module modules\/mod_proxy_ajp.so<br \/>\nLoadModule proxy_balancer_module modules\/mod_proxy_balancer.so<br \/>\nLoadModule proxy_connect_module modules\/mod_proxy_connect.so<br \/>\nLoadModule proxy_ftp_module modules\/mod_proxy_ftp.so<br \/>\nLoadModule proxy_http_module modules\/mod_proxy_http.so<br \/>\nLoadModule proxy_scgi_module modules\/mod_proxy_scgi.so<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>3.\u7f16\u8f91httpd-vhosts.conf\u6587\u4ef6<\/p>\n<p>\u5728conf\u76ee\u5f55\u627e\u5230extra\u76ee\u5f55\uff0c\u6253\u5f00httpd-vhosts.conf\uff0c\u590d\u5236\u4e00\u4e0b\u5185\u5bb9<\/p>\n<div class=\"codecolorer-container text geshi\" style=\"overflow:auto;white-space:nowrap;width:100%;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/>2<br \/>3<br \/>4<br \/>5<br \/>6<br \/>7<br \/>8<br \/>9<br \/>10<br \/>11<br \/>12<br \/>13<br \/>14<br \/>15<br \/>16<br \/>17<br \/>18<br \/>19<br \/>20<br \/>21<br \/>22<br \/>23<br \/>24<br \/>25<br \/>26<br \/>27<br \/>28<br \/>29<br \/>30<br \/>31<br \/>32<br \/>33<br \/>34<br \/>35<br \/>36<br \/>37<br \/>38<br \/>39<br \/>40<br \/>41<br \/>42<br \/>43<br \/>44<br \/>45<br \/><\/div><\/td><td><div class=\"text codecolorer\" style=\"white-space:nowrap\">#<br \/>\n# Virtual Hosts<br \/>\n#<br \/>\n# If you want to maintain multiple domains\/hostnames on your<br \/>\n# machine you can setup VirtualHost containers for them. Most configurations<br \/>\n# use only name-based virtual hosts so the server doesn't need to worry about<br \/>\n# IP addresses. This is indicated by the asterisks in the directives below.<br \/>\n#<br \/>\n# Please see the documentation at<br \/>\n# &amp;lt;URL:http:\/\/httpd.apache.org\/docs\/2.2\/vhosts\/&amp;gt;<br \/>\n# for further details before you try to setup virtual hosts.<br \/>\n#<br \/>\n# You may use the command line option '-S' to verify your virtual host<br \/>\n# configuration.<br \/>\n<br \/>\n#<br \/>\n# Use name-based virtual hosting.<br \/>\n#<br \/>\nNameVirtualHost *:80<br \/>\n<br \/>\n#<br \/>\n# VirtualHost example:<br \/>\n# Almost any Apache directive may go into a VirtualHost container.<br \/>\n# The first VirtualHost section is used for all requests that do not<br \/>\n# match a ServerName or ServerAlias in any &amp;lt;VirtualHost&amp;gt; block.<br \/>\n#<br \/>\n<br \/>\n# \u8bbe\u7f6e\u865a\u62df\u4e3b\u673a\uff0c\u5b9a\u4e49\u7aef\u53e3\u4e3a80<br \/>\n<br \/>\n&lt;VirtualHost *:80&gt;<br \/>\nProxyPreserveHost on<br \/>\nServerName yumuer.com<br \/>\nProxyPass \/ http:\/\/yumuer.com:8080\/<br \/>\nProxyPassReverse \/ http:\/\/yumuer.com:8080\/<br \/>\nErrorLog logs\/yumuer.com-error_log.txt<br \/>\nCustomLog logs\/yumuer.com-access_log.txt common<br \/>\n&lt;\/VirtualHost&gt;<br \/>\n<br \/>\n# \u5141\u8bb8\u5ba2\u6237\u7aef\u8bbf\u95ee\u6b64\u8def\u5f84<br \/>\n&lt;Directory &quot;D:\/soft\/tomcat7\/webapps\/ROOT&quot;&amp;gt;<br \/>\nOptions Indexes FollowSymLinks<br \/>\nAllowOverride None<br \/>\nOrder allow,deny<br \/>\nAllow from all<br \/>\n&lt;\/Directory&gt;<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>ProxyPreserveHost \u4ee3\u7406\u6a21\u5f0f\u662f\u5426\u5f00\u542f\uff0con\u8868\u793a\u5f00\u542f\uff0coff\u8868\u793a\u5173\u95ed\u3002<\/p>\n<p>ServerName \u670d\u52a1\u540d\u79f0\uff0c\u4e5f\u53ef\u4ee5\u7406\u89e3\u4e3a\u6211\u4eec\u7ed1\u5b9a\u7684\u57df\u540d\uff0c\u6211\u7ed1\u5b9a\u7684\u662fyumuer.com\uff08\u53ef\u4ee5\u53bb\u770b\u770b\u54e6\uff0c\u5c0f\u5e7f\u544a\uff09\u3002<\/p>\n<p>ProxyPass \/ http:\/\/yumuer.com:8080\/<\/p>\n<p>ProxyPassReverse \/ http:\/\/yumuer.com:8080\/<\/p>\n<p>\u8fd9\u4e24\u662f\u4ee3\u7406\u8bbf\u95ee\u7684\u8def\u5f84\u548c\u7aef\u53e3\u53f7\uff0c\u8bb0\u5f97\u662f\u8bf7\u6c42\u8f6c\u53d1\u54e6\uff0c\u4e0d\u662f\u8df3\u8f6c\u3002<\/p>\n<p>\u5176\u4ed6\u7684\u5c31\u4e0d\u89e3\u91ca\u4e86\uff0c\u770b\u770b\u5c31\u61c2\u4e86\u3002\u4e0d\u61c2\u7684\u5c31google\u7ffb\u8bd1\u3002<\/p>\n<p>4.\u5173\u95ed\u5fc5\u8981\u6743\u9650<\/p>\n<p>httpd.conf\u4e0b\u9762\u627e\u5230DocumentRoot\u6700\u8fd1\u7684\u4e00\u4e2aDirectory\uff0c\u8bbe\u7f6e\u62d2\u7edd\u8bbf\u95eedeny from all\uff0c\u5982\u679c\u4f60\u7684\u914d\u7f6e\u672c\u8eab\u5c31\u662f\u8fd9\u6837\uff0c\u5c31\u4e0d\u9700\u8981\u4fee\u6539\u4e86\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u597d\u4e86\uff0c\u8bbf\u95ee\u4e00\u4e0b\u4f60\u7684http:\/\/yumuer.com\uff0c\u662f\u5426\u5df2\u7ecf\u8f6c\u53d1\u5230tomcat\u4e0a\u9762\u53bb\u4e86\u3002\u6d4b\u8bd5\u7684\u65f6\u5019\u53ef\u4ee5\u5c06tomcat\u548capache project\u76ee\u5f55\u653e\u4e0d\u540c\u7684\u6587\u4ef6\uff0c\u65b9\u4fbf\u6d4b\u8bd5\u4e0d\u540c\u8bbf\u95ee\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"http:\/\/weitaoc.com\/archives\/227\/1-6\" rel=\"attachment wp-att-228\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-228\" alt=\"1\" src=\"http:\/\/weitaoc.com\/wp-content\/uploads\/2015\/02\/1.jpg\" width=\"152\" height=\"121\" \/><\/a><\/p>\n<p>\u8f6c\u8f7d\u8bf7\u6ce8\u660e\uff1a<a href=\"http:\/\/weitaoc.com\">\u8ff7\u8def\u7684\u8001\u9f20<\/a> &raquo; <a href=\"http:\/\/weitaoc.com\/?p=227\">windows+php+apache+tomcat\u5b8c\u7f8e\u96c6\u6210\u4e4btomcat\u548capache\u96c6\u6210<\/a><\/p>","protected":false},"excerpt":{"rendered":"<p>\u524d\u9762\u4e5f\u900f\u9732\u4e86\uff0ctomcat\u548capache\u7684\u96c6\u6210\u6ca1\u6709\u7528\u5230\u4f20\u7edf\u7684jk mod\u65b9\u5f0f\u53bb\u96c6\u6210\uff0c\u91c7\u7528\u7684\u662f\u7aef\u53e3\u4ee3\u7406\uff0c\u539f\u7406\u5c31\u662f\u5c06\u67d0\u4e2a\u7aef\u53e3\u7684\u8bf7\u6c42\u8f6c\u53d1\u5230\u6307\u5b9a\u7aef\u53e3\uff0c\u56e0\u4e3a\u6211\u7684vps\u9700\u8981\u652f\u6301php\u548ctomcat\u6240\u4ee5\u5c31\u4e0d\u80fd\u5c06\u8fd9\u4e2aIP\u4e0b80\u7aef\u53e3\u7684\u8bf7\u6c42\u5168\u90e8\u8f6c\u53d1\u52308080\u7aef\u53e3\uff0c\u8fd9\u662f\u6ca1 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[44],"class_list":["post-227","post","type-post","status-publish","format-standard","hentry","category-middleware","tag-44"],"views":3314,"_links":{"self":[{"href":"http:\/\/weitaoc.com\/index.php?rest_route=\/wp\/v2\/posts\/227","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/weitaoc.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/weitaoc.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/weitaoc.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/weitaoc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=227"}],"version-history":[{"count":0,"href":"http:\/\/weitaoc.com\/index.php?rest_route=\/wp\/v2\/posts\/227\/revisions"}],"wp:attachment":[{"href":"http:\/\/weitaoc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=227"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/weitaoc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=227"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/weitaoc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=227"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}