{"id":476,"date":"2010-03-17T15:49:24","date_gmt":"2010-03-17T07:49:24","guid":{"rendered":"http:\/\/juan.tw\/?p=476"},"modified":"2015-06-08T21:43:36","modified_gmt":"2015-06-08T13:43:36","slug":"web-server-%e5%8a%a0%e9%80%9f","status":"publish","type":"post","link":"https:\/\/juan.tw\/?p=476","title":{"rendered":"Web Server \u52a0\u901f"},"content":{"rendered":"<p>\u6700\u8fd1\u5728\u6e2c WordPress, \u767c\u73fe\u7db2\u9801\u6253\u958b\u901f\u5ea6\u771f\u7684\u5f88\u6162<br \/>\n\u4e00\u958b\u59cb\u662f\u4ee5\u70ba\u662f\u7db2\u9801\u7684\u5716\u6a94\u592a\u591a, \u5f8c\u4f86\u7528\u4e86\u5e7e\u500b\u7db2\u7ad9Check\u624d\u767c\u73fe\u4e0d\u662f<\/p>\n<p>\u627e\u4e86\u4e00\u4e0b, \u5927\u6982\u6709\u4e09\u500b\u5730\u65b9\u662f\u61c9\u8a72\u8abf\u6574,<br \/>\n\u81f3\u5c11\u662f\u88dd\u597d freeBSD \u5f8c, \u5982\u679c\u4f60\u7684\u8edf\u9ad4\u662f\u7528 port \u5b89\u88dd\u7684, \u5927\u6982\u90fd\u4e0d\u6703\u6709\u7684:<\/p>\n<p><strong>\u7b2c\u4e00\u500b\u662f php \u7684\u90e8\u4efd:<\/strong><\/p>\n<p style=\"padding-left: 30px;\">php \u53ef\u4ee5\u52a0\u639b <a href=\"http:\/\/eaccelerator.net\/\">eAccelerator<\/a> &#8211; \u9019\u662f\u4e00\u5957 php \u7684\u52a0\u901f\u8edf\u9ad4, \u5b89\u88dd\u65b9\u5f0f\u7c21\u55ae\u8aaa\u660e\u5982\u4e0b:<\/p>\n<p><!--more--><\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #0000ff;\"># cd \/usr\/ports\/www\/eaccelerator<br \/>\n# make install<\/span><\/p>\n<p style=\"padding-left: 30px;\">\u5b89\u88dd\u5b8c\u6210\u524d\u61c9\u8a72\u6703\u770b\u5230\u4e00\u6bb5\u8a72\u6b7b\u7684\u6307\u793a:<br \/>\n<span style=\"color: #0000ff;\">You have installed the eaccelerator package.<\/span><\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #0000ff;\">Edit \/usr\/local\/etc\/php.ini and add:<\/span><\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #0000ff;\">zend_extension=\u201d\/usr\/local\/lib\/php\/20050922\/eaccelerator.so\u201d<\/span><\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #0000ff;\">Then create the cache directory:<\/span><\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #0000ff;\">mkdir \/tmp\/eaccelerator<br \/>\nchown www \/tmp\/eaccelerator<br \/>\nchmod 0700 \/tmp\/eaccelerator<\/span><\/p>\n<p style=\"padding-left: 30px;\">\u4f60\u5982\u679c\u7167\u4f5c\u5927\u6982\u5c31\u6703\u6253\u958b\u4e0d\u4e86\u7db2\u9801, as usual google \u4e00\u4e0b, \u77e5\u9053\u8981\u4fee\u6539\u5169\u500b\u5730\u65b9:<\/p>\n<p style=\"padding-left: 30px;\">1, \u6253\u958b \/usr\/local\/etc\/php\/extension.ini , \u5728\u6a94\u6848\u7684\u6700\u5f8c\u9762\u52a0\u4e0a\uff1a<br \/>\n<span style=\"color: #0000ff;\">extension=eaccelerator.so<\/span><\/p>\n<p style=\"padding-left: 30px;\">2, \u518d\u6253\u958b \/usr\/local\/etc\/php.ini , \u5728\u6a94\u6848\u7684\u6700\u5f8c\u9762\u52a0\u4e0a\u9019\u4e9b\u8a2d\u5b9a\uff1a<\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #0000ff;\">eaccelerator.shm_size=\u201d16\u2033<br \/>\neaccelerator.cache_dir=\u201d\/tmp\/eaccelerator\u201d<br \/>\neaccelerator.enable=\u201d1\u2033<br \/>\neaccelerator.optimizer=\u201d1\u2033<br \/>\neaccelerator.check_mtime=\u201d1\u2033<br \/>\neaccelerator.debug=\u201d0\u2033<br \/>\neaccelerator.filter=\u201d&#8221;<br \/>\naccelerator.shm_max=\u201d0\u2033<br \/>\neaccelerator.shm_ttl=\u201d0\u2033<br \/>\neaccelerator.shm_prune_period=\u201d0\u2033<br \/>\neaccelerator.shm_only=\u201d0\u2033<br \/>\neaccelerator.compress=\u201d1\u2033<br \/>\neaccelerator.compress_level=\u201d9<\/span>\u2033<\/p>\n<p style=\"padding-left: 30px;\">\u6aa2\u67e5 eAccelerator \u662f\u5426\u8f09\u5165\u7684\u65b9\u6cd5\u5982\u4e0b:<\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #0000ff;\"># \/usr\/local\/bin\/php -v<br \/>\nPHP 5.2.12 with Suhosin-Patch 0.9.7 (cli) (built: Jan 26 2010 14:33:59)<br \/>\nCopyright (c) 1997-2009 The PHP Group<br \/>\nZend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies<br \/>\nwith <strong>eAccelerator v0.9.5.3<\/strong>, Copyright (c) 2004-2006 eAccelerator, by eAccelerato<\/span>r<strong><\/strong><\/p>\n<p><strong>\u7b2c\u4e8c\u500b\u662f apache \u7684\u90e8\u4efd:<\/strong><\/p>\n<p style=\"padding-left: 30px;\">\u5982\u679c\u4f60\u662f\u7528 port \u4f86\u5b89\u88dd apache, \u5927\u6982\u90fd\u4e0d\u6703\u555f\u7528 HTTP Compression. \u9019\u500b\u90e8\u4efd\u5982\u679c\u4e0d\u78ba\u5b9a, \u53ef\u4ee5\u9023\u5230 <a href=\"http:\/\/www.seoconsultants.com\/tools\/compression\">Check HTTP Compression<\/a> \u6aa2\u67e5\u4e00\u4e0b, \u5982\u679c\u51fa\u73fe\u9019\u500b\u756b\u9762<br \/>\n<a href=\"http:\/\/juan.tw\/wp-content\/uploads\/2010\/03\/httpdco.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-477\" title=\"httpdco\" src=\"http:\/\/juan.tw\/wp-content\/uploads\/2010\/03\/httpdco.jpg\" alt=\"\" width=\"844\" height=\"574\" srcset=\"https:\/\/juan.tw\/wp-content\/uploads\/2010\/03\/httpdco.jpg 844w, https:\/\/juan.tw\/wp-content\/uploads\/2010\/03\/httpdco-300x204.jpg 300w, https:\/\/juan.tw\/wp-content\/uploads\/2010\/03\/httpdco-150x102.jpg 150w, https:\/\/juan.tw\/wp-content\/uploads\/2010\/03\/httpdco-400x272.jpg 400w\" sizes=\"auto, (max-width: 844px) 100vw, 844px\" \/><\/a><\/p>\n<p style=\"padding-left: 30px;\">\u5c31\u77e5\u9053 HTTP Compression \u6c92\u6709\u555f\u52d5. \u89e3\u6c7a\u65b9\u6cd5\u5c31\u662f\u628a apache \u4e0a\u7684 mod_deflate \u555f\u7528.<\/p>\n<p style=\"padding-left: 30px;\">1, \u9996\u5148 check \/usr\/local\/etc\/apache22\/httpd.conf \u6a94\u6848\u88e1\u6709\u6c92\u6709\u9019\u4e00\u884c:<br \/>\n<span style=\"color: #0000ff;\">LoadModule deflate_module libexec\/apache22\/mod_deflate.so<\/span><\/p>\n<p style=\"padding-left: 30px;\">2, \u5982\u679c\u6c92\u6709, \u8acb\u5230 \/usr\/ports\/www\/apache22 \u88e1\u9762\u53bb\u57f7\u884c<\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #0000ff;\"> # make config<\/span><\/p>\n<p style=\"padding-left: 30px;\">\u628a Enable mod_deflate \u6253 V<br \/>\n<a href=\"http:\/\/juan.tw\/wp-content\/uploads\/2010\/03\/apaches.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-478\" title=\"apaches\" src=\"http:\/\/juan.tw\/wp-content\/uploads\/2010\/03\/apaches.jpg\" alt=\"\" width=\"600\" height=\"397\" srcset=\"https:\/\/juan.tw\/wp-content\/uploads\/2010\/03\/apaches.jpg 666w, https:\/\/juan.tw\/wp-content\/uploads\/2010\/03\/apaches-300x198.jpg 300w, https:\/\/juan.tw\/wp-content\/uploads\/2010\/03\/apaches-150x99.jpg 150w, https:\/\/juan.tw\/wp-content\/uploads\/2010\/03\/apaches-400x264.jpg 400w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p style=\"padding-left: 30px;\">\u7136\u5f8c\u91cd\u65b0 compile apache \u4e26\u5b89\u88dd, \u518d\u53bb\u4fee\u6539 \/usr\/local\/etc\/apache22\/httpd.conf , \u52a0\u5165\u5982\u4e0b\u8a2d\u5b9a:<\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #0000ff;\">&lt; IfModule mod_deflate.c&gt;<br \/>\nDeflateCompressionLevel 9<br \/>\nAddOutputFilterByType DEFLATE text\/html text\/plain text\/xml application\/x-httpd-php<br \/>\nAddOutputFilter DEFLATE js css<br \/>\n&lt; IfModule mod_deflate.c&gt; <\/span><\/p>\n<p style=\"padding-left: 30px;\">\u7136\u5f8c\u91cd\u65b0\u555f\u52d5 apache, \u518d\u9023\u5230 <a href=\"http:\/\/www.seoconsultants.com\/tools\/compression\">Check HTTP Compression<\/a> \u6aa2\u67e5\u4e00\u6b21, \u7d50\u679c\u6703\u8b8a\u6210:<br \/>\n<a href=\"http:\/\/juan.tw\/wp-content\/uploads\/2010\/03\/httpdco2.jpg\"><img decoding=\"async\" class=\"alignnone size-full wp-image-479\" title=\"httpdco2\" src=\"http:\/\/juan.tw\/wp-content\/uploads\/2010\/03\/httpdco2.jpg\" alt=\"\" width=\"800\" srcset=\"https:\/\/juan.tw\/wp-content\/uploads\/2010\/03\/httpdco2.jpg 767w, https:\/\/juan.tw\/wp-content\/uploads\/2010\/03\/httpdco2-300x226.jpg 300w, https:\/\/juan.tw\/wp-content\/uploads\/2010\/03\/httpdco2-150x113.jpg 150w, https:\/\/juan.tw\/wp-content\/uploads\/2010\/03\/httpdco2-400x301.jpg 400w\" sizes=\"(max-width: 767px) 100vw, 767px\" \/><\/a><\/p>\n<p style=\"padding-left: 30px;\">\u5c31\u5927\u529f\u544a\u6210\u4e86<\/p>\n<p><strong>\u7b2c\u4e09\u500b\u662f\u8abf\u6574 MySQL, \u555f\u7528\u5feb\u53d6<\/strong><\/p>\n<p style=\"padding-left: 30px;\">\u9019\u500b\u90e8\u4efd\u53ea\u8981\u4fee\u6539 \/etc\/my.cnf \u6a94\u6848, \u52a0\u5165\u4e0b\u5217\u4e09\u884c:<br \/>\n<span style=\"color: #0000ff;\">query_cache_limit = 4M<br \/>\nquery_cache_size = 128M<br \/>\nquery_cache_type = 1<\/span><\/p>\n<p style=\"padding-left: 30px;\">\u518d\u91cd\u65b0\u555f\u52d5 MySQL \u5c31\u53ef\u4ee5\u4e86.<\/p>\n<p>\u4e09\u500b\u90fd\u4fee\u6539\u5f8c, \u611f\u89ba\u6574\u500b WordPress \u7684\u7db2\u7ad9\u958b\u555f\u901f\u5ea6\u9806\u66a2\u5f88\u591a<\/p>\n<p class=\"facebook\"><a href=\"http:\/\/www.facebook.com\/share.php?u=https:\/\/juan.tw\/?p=476\" target=\"_blank\"><img decoding=\"async\" src=\"https:\/\/juan.tw\/wp-content\/plugins\/add-to-facebook-plugin\/facebook_share_icon.gif\" alt=\"Share on Facebook\" title=\"Share on Facebook\" \/><\/a><a href=\"http:\/\/www.facebook.com\/share.php?u=https:\/\/juan.tw\/?p=476\" target=\"_blank\" title=\"Share on Facebook\">Share on Facebook<\/a><\/p>","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1\u5728\u6e2c WordPress, \u767c\u73fe\u7db2\u9801\u6253\u958b\u901f\u5ea6\u771f\u7684\u5f88\u6162 \u4e00\u958b\u59cb\u662f\u4ee5\u70ba\u662f\u7db2\u9801\u7684\u5716\u6a94\u592a\u591a, \u5f8c\u4f86\u7528\u4e86\u5e7e\u500b\u7db2\u7ad9Check\u624d\u767c\u73fe\u4e0d\u662f<\/p>\n<p>\u627e\u4e86\u4e00\u4e0b, \u5927\u6982\u6709\u4e09\u500b\u5730\u65b9\u662f\u61c9\u8a72\u8abf\u6574, \u81f3\u5c11\u662f\u88dd\u597d freeBSD \u5f8c, \u5982\u679c\u4f60\u7684\u8edf\u9ad4\u662f\u7528 port \u5b89\u88dd\u7684, \u5927\u6982\u90fd\u4e0d\u6703\u6709\u7684:<\/p>\n<p>\u7b2c\u4e00\u500b\u662f php \u7684\u90e8\u4efd:<\/p>\n<p style=\"padding-left: 30px;\">php \u53ef\u4ee5\u52a0\u639b eAccelerator &#8211; \u9019\u662f\u4e00\u5957 php \u7684\u52a0\u901f\u8edf\u9ad4, \u5b89\u88dd\u65b9\u5f0f\u7c21\u55ae\u8aaa\u660e\u5982\u4e0b:<\/p>\n<p class=\"facebook\">Share on [&#8230;]<\/p>\n<p class=\"facebook\"><a href=\"http:\/\/www.facebook.com\/share.php?u=https:\/\/juan.tw\/?p=476\" target=\"_blank\"><img decoding=\"async\" src=\"https:\/\/juan.tw\/wp-content\/plugins\/add-to-facebook-plugin\/facebook_share_icon.gif\" alt=\"Share on Facebook\" title=\"Share on Facebook\" \/><\/a><a href=\"http:\/\/www.facebook.com\/share.php?u=https:\/\/juan.tw\/?p=476\" target=\"_blank\" title=\"Share on Facebook\">Share on Facebook<\/a><\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[278,279,277],"class_list":["post-476","post","type-post","status-publish","format-standard","hentry","category-computer-networking","tag-eaccelerator","tag-http-compression","tag-wordpress","odd"],"psp_head":"<title>Web Server \u52a0\u901f \u2013 absolute Juan<\/title>\r\n<meta name=\"description\" content=\"\u6700\u8fd1\u5728\u6e2c Wordpress, \u767c\u73fe\u7db2\u9801\u6253\u958b\u901f\u5ea6\u771f\u7684\u5f88\u6162 \u4e00\u958b\u59cb\u662f\u4ee5\u70ba\u662f\u7db2\u9801\u7684\u5716\u6a94\u592a\u591a, \u5f8c\u4f86\u7528\u4e86\u5e7e\u500b\u7db2\u7ad9Check\u624d\u767c\u73fe\u4e0d\u662f \u627e\u4e86\u4e00\u4e0b, \u5927\u6982\u6709\u4e09\u500b\u5730\u65b9\u662f\u61c9\u8a72\u8abf\u6574, \u81f3\u5c11\u662f\u88dd\u597d freeBSD \u5f8c, \u5982\u679c\u4f60\u7684\u8edf\u9ad4\u662f\u7528 port \u5b89\u88dd\u7684, \u5927\u6982\u90fd\u4e0d\u6703\u6709\u7684: \u7b2c\u4e00\u500b\u662f php \u7684\u90e8\u4efd: php \u53ef\u4ee5\u52a0\u639b eAccelerator - \u9019\u662f\u4e00\u5957 php \u7684\u52a0\u901f\u8edf\u9ad4, \u5b89\u88dd\u65b9\u5f0f\u7c21\u55ae\u8aaa\u660e\u5982\u4e0b: # cd \/usr\/ports\/www\/eaccelerator # make install \u5b89\u88dd\u5b8c\u6210\u524d\u61c9\u8a72\u6703\u770b\u5230\u4e00\u6bb5\u8a72\u6b7b\u7684\u6307\u793a: You have installed the eaccelerator package.\" \/>\r\n<meta name=\"robots\" content=\"index,follow\" \/>\r\n<link rel=\"canonical\" href=\"https:\/\/juan.tw\/?p=476\" \/>\r\n","views":818,"_links":{"self":[{"href":"https:\/\/juan.tw\/index.php?rest_route=\/wp\/v2\/posts\/476","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/juan.tw\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/juan.tw\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/juan.tw\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/juan.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=476"}],"version-history":[{"count":13,"href":"https:\/\/juan.tw\/index.php?rest_route=\/wp\/v2\/posts\/476\/revisions"}],"predecessor-version":[{"id":2574,"href":"https:\/\/juan.tw\/index.php?rest_route=\/wp\/v2\/posts\/476\/revisions\/2574"}],"wp:attachment":[{"href":"https:\/\/juan.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=476"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/juan.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=476"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/juan.tw\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=476"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}