{"id":230156,"date":"2023-12-25T15:50:22","date_gmt":"2023-12-25T07:50:22","guid":{"rendered":"https:\/\/www.idc.net\/help\/230156\/"},"modified":"2023-12-25T15:50:22","modified_gmt":"2023-12-25T07:50:22","slug":"apache%e6%96%b0%e6%89%8b%e6%95%99%e7%a8%8b%ef%bc%9a%e4%bd%bf%e7%94%a8mod_log_debug%e8%ae%be%e7%bd%aeapache","status":"publish","type":"post","link":"https:\/\/idc.net\/help\/230156\/","title":{"rendered":"Apache\u65b0\u624b\u6559\u7a0b\uff1a\u4f7f\u7528mod_log_debug\u8bbe\u7f6eApache"},"content":{"rendered":"<h1 id=\"apache%e6%96%b0%e6%89%8b%e6%95%99%e7%a8%8b%ef%bc%9a%e4%bd%bf%e7%94%a8mod_log_debug%e8%ae%be%e7%bd%aeapache-fpFhvBAkGD\">Apache\u65b0\u624b\u6559\u7a0b\uff1a\u4f7f\u7528mod_log_debug\u8bbe\u7f6eApache<\/h1>\n<p>Apache\u662f\u4e00\u79cd\u6d41\u884c\u7684\u5f00\u6e90Web\u670d\u52a1\u5668\u8f6f\u4ef6\uff0c\u88ab\u5e7f\u6cdb\u7528\u4e8e\u642d\u5efa\u548c\u7ba1\u7406\u7f51\u7ad9\u3002\u5728\u4f7f\u7528Apache\u65f6\uff0c\u4e86\u89e3\u5982\u4f55\u8bbe\u7f6e\u548c\u8c03\u8bd5\u670d\u52a1\u5668\u662f\u975e\u5e38\u91cd\u8981\u7684\u3002\u672c\u6559\u7a0b\u5c06\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528Apache\u7684mod_log_debug\u6a21\u5757\u6765\u8bbe\u7f6e\u548c\u8c03\u8bd5Apache\u670d\u52a1\u5668\u3002<\/p>\n<h2 id=\"%e4%bb%80%e4%b9%88%e6%98%afmod_log_debug%e6%a8%a1%e5%9d%97%ef%bc%9f-fpFhvBAkGD\">\u4ec0\u4e48\u662fmod_log_debug\u6a21\u5757\uff1f<\/h2>\n<p>mod_log_debug\u662fApache\u7684\u4e00\u4e2a\u6a21\u5757\uff0c\u5b83\u5141\u8bb8\u5f00\u53d1\u4eba\u5458\u5728\u670d\u52a1\u5668\u65e5\u5fd7\u4e2d\u8bb0\u5f55\u8c03\u8bd5\u4fe1\u606f\u3002\u901a\u8fc7\u542f\u7528mod_log_debug\u6a21\u5757\uff0c\u60a8\u53ef\u4ee5\u83b7\u5f97\u66f4\u8be6\u7ec6\u7684\u65e5\u5fd7\u8bb0\u5f55\uff0c\u4ee5\u4fbf\u66f4\u597d\u5730\u4e86\u89e3\u670d\u52a1\u5668\u7684\u8fd0\u884c\u60c5\u51b5\u3002<\/p>\n<h2 id=\"%e5%90%af%e7%94%a8mod_log_debug%e6%a8%a1%e5%9d%97-fpFhvBAkGD\">\u542f\u7528mod_log_debug\u6a21\u5757<\/h2>\n<p>\u8981\u542f\u7528mod_log_debug\u6a21\u5757\uff0c\u60a8\u9700\u8981\u7f16\u8f91Apache\u7684\u914d\u7f6e\u6587\u4ef6\u3002\u5728\u5927\u591a\u6570Linux\u7cfb\u7edf\u4e0a\uff0cApache\u7684\u914d\u7f6e\u6587\u4ef6\u4f4d\u4e8e\/etc\/httpd\/conf\/httpd.conf\u6216\/etc\/apache2\/apache2.conf\u3002<\/p>\n<p>\u6253\u5f00\u914d\u7f6e\u6587\u4ef6\u540e\uff0c\u627e\u5230\u4ee5\u4e0b\u884c\uff1a<\/p>\n<pre><code>#LoadModule log_debug_module modules\/mod_log_debug.so\n<\/code><\/pre>\n<p>\u5c06\u5176\u4fee\u6539\u4e3a\uff1a<\/p>\n<pre><code>LoadModule log_debug_module modules\/mod_log_debug.so\n<\/code><\/pre>\n<p>\u4fdd\u5b58\u6587\u4ef6\u5e76\u91cd\u65b0\u542f\u52a8Apache\u670d\u52a1\u5668\u3002<\/p>\n<h2 id=\"%e9%85%8d%e7%bd%aemod_log_debug%e6%a8%a1%e5%9d%97-fpFhvBAkGD\">\u914d\u7f6emod_log_debug\u6a21\u5757<\/h2>\n<p>\u4e00\u65e6\u542f\u7528\u4e86mod_log_debug\u6a21\u5757\uff0c\u60a8\u53ef\u4ee5\u5728Apache\u7684\u914d\u7f6e\u6587\u4ef6\u4e2d\u914d\u7f6e\u5b83\u7684\u884c\u4e3a\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u7528\u7684\u914d\u7f6e\u9009\u9879\uff1a<\/p>\n<ul>\n<li><code>LogLevel debug<\/code>\uff1a\u8bbe\u7f6e\u65e5\u5fd7\u8bb0\u5f55\u7ea7\u522b\u4e3a\u8c03\u8bd5\u6a21\u5f0f\u3002<\/li>\n<li><code>LogMessage \"Custom debug message\"<\/code>\uff1a\u8bb0\u5f55\u81ea\u5b9a\u4e49\u7684\u8c03\u8bd5\u4fe1\u606f\u3002<\/li>\n<li><code>LogFormat \"%h %l %u %t \"%r\" %&gt;s %b \"%{Referer}i\" \"%{User-Agent}i\"\" combined<\/code>\uff1a\u5b9a\u4e49\u65e5\u5fd7\u683c\u5f0f\u3002<\/li>\n<li><code>CustomLog logs\/debug.log combined<\/code>\uff1a\u5c06\u65e5\u5fd7\u8bb0\u5f55\u5230\u6307\u5b9a\u7684\u6587\u4ef6\u4e2d\u3002<\/li>\n<\/ul>\n<p>\u60a8\u53ef\u4ee5\u6839\u636e\u9700\u8981\u8fdb\u884c\u914d\u7f6e\uff0c\u5e76\u6839\u636e\u5b9e\u9645\u60c5\u51b5\u8c03\u6574\u65e5\u5fd7\u8bb0\u5f55\u7ea7\u522b\u548c\u683c\u5f0f\u3002<\/p>\n<h2 id=\"%e6%9f%a5%e7%9c%8b%e8%b0%83%e8%af%95%e6%97%a5%e5%bf%97-fpFhvBAkGD\">\u67e5\u770b\u8c03\u8bd5\u65e5\u5fd7<\/h2>\n<p>\u542f\u7528mod_log_debug\u6a21\u5757\u540e\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u67e5\u770bApache\u7684\u65e5\u5fd7\u6587\u4ef6\u6765\u67e5\u770b\u8c03\u8bd5\u4fe1\u606f\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cApache\u7684\u65e5\u5fd7\u6587\u4ef6\u4f4d\u4e8e\/var\/log\/httpd\/\u76ee\u5f55\u4e0b\u3002<\/p>\n<p>\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u53ef\u4ee5\u67e5\u770b\u65e5\u5fd7\u6587\u4ef6\u7684\u5185\u5bb9\uff1a<\/p>\n<pre><code>tail -f \/var\/log\/httpd\/debug.log\n<\/code><\/pre>\n<p>\u8fd9\u5c06\u5b9e\u65f6\u663e\u793a\u65e5\u5fd7\u6587\u4ef6\u7684\u6700\u65b0\u5185\u5bb9\u3002\u60a8\u53ef\u4ee5\u6839\u636e\u9700\u8981\u8fc7\u6ee4\u548c\u641c\u7d22\u7279\u5b9a\u7684\u8c03\u8bd5\u4fe1\u606f\u3002<\/p>\n<h2 id=\"%e6%80%bb%e7%bb%93-fpFhvBAkGD\">\u603b\u7ed3<\/h2>\n<p>\u901a\u8fc7\u4f7f\u7528Apache\u7684mod_log_debug\u6a21\u5757\uff0c\u60a8\u53ef\u4ee5\u66f4\u597d\u5730\u4e86\u89e3\u548c\u8c03\u8bd5Apache\u670d\u52a1\u5668\u3002\u542f\u7528\u548c\u914d\u7f6emod_log_debug\u6a21\u5757\u975e\u5e38\u7b80\u5355\uff0c\u53ea\u9700\u7f16\u8f91Apache\u7684\u914d\u7f6e\u6587\u4ef6\u5e76\u91cd\u65b0\u542f\u52a8\u670d\u52a1\u5668\u5373\u53ef\u3002\u4e00\u65e6\u542f\u7528\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u67e5\u770b\u65e5\u5fd7\u6587\u4ef6\u6765\u67e5\u770b\u8be6\u7ec6\u7684\u8c03\u8bd5\u4fe1\u606f\u3002<\/p>\n<p>\u9999\u6e2f\u670d\u52a1\u5668\u9996\u9009\u540e\u6d6a\u4e91\uff0c\u540e\u6d6a\u4e91\u63d0\u4f9b\u9ad8\u6027\u80fd\u7684\u9999\u6e2f\u670d\u52a1\u5668\uff0c\u9002\u7528\u4e8e\u5404\u79cd\u7f51\u7ad9\u548c\u5e94\u7528\u3002\u60a8\u53ef\u4ee5\u5728<a href=\"https:\/\/idc.net\">\u540e\u6d6a\u4e91\u5b98\u7f51<\/a>\u4e86\u89e3\u66f4\u591a\u5173\u4e8e\u9999\u6e2f\u670d\u52a1\u5668\u7684\u4fe1\u606f\u3002\u5982\u679c\u60a8\u6b63\u5728\u5bfb\u627e\u53ef\u9760\u7684\u9999\u6e2f\u670d\u52a1\u5668\uff0c\u540e\u6d6a\u4e91\u662f\u60a8\u7684\u9996\u9009\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Apache\u65b0\u624b\u6559\u7a0b\uff1a\u4f7f\u7528mod_log_debug\u8bbe\u7f6eApache Apache\u662f\u4e00\u79cd\u6d41\u884c\u7684\u5f00\u6e90Web\u670d\u52a1\u5668 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[41],"tags":[],"class_list":["post-230156","post","type-post","status-publish","format-standard","hentry","category-apache"],"_links":{"self":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/230156","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/comments?post=230156"}],"version-history":[{"count":0,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/230156\/revisions"}],"wp:attachment":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/media?parent=230156"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/categories?post=230156"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/tags?post=230156"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}