{"id":6379,"date":"2018-09-19T23:44:39","date_gmt":"2018-09-19T15:44:39","guid":{"rendered":"http:\/\/4563.org\/?p=6379"},"modified":"2018-09-19T23:44:39","modified_gmt":"2018-09-19T15:44:39","slug":"%e5%b0%8f%e5%86%85%e5%ad%98vps%e5%ae%89%e8%a3%85caddyphp-7sqlite-3%e7%8e%af%e5%a2%83%ef%bc%8c%e5%b9%b6%e5%bf%ab%e9%80%9f%e6%90%ad%e5%bb%batypecho%e5%8d%9a%e5%ae%a2","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=6379","title":{"rendered":"\u5c0f\u5185\u5b58VPS\u5b89\u88c5Caddy+PHP 7+Sqlite 3\u73af\u5883\uff0c\u5e76\u5feb\u901f\u642d\u5efaTypecho\u535a\u5ba2"},"content":{"rendered":"<p>&nbsp;<\/p>\n<p>\u8bf4\u660e\uff1a\u6211\u4eec\u4e00\u822c\u642d\u5efa\u535a\u5ba2\u7684\u65b9\u6cd5\u5c31\u662f\u4f7f\u7528lnmp\u3001lamp\u7b49\u4e00\u952e\u5305\uff0c\u6216\u8005\u5b9d\u5854\u7b49\u9762\u677f\u6765\u642d\u5efaWeb\u73af\u5883\uff0c\u4e0d\u8fc7\u90fd\u53ea\u9002\u5408\u5927\u70b9\u5185\u5b58\u7684VPS\u670d\u52a1\u5668\uff0c\u5c0f\u70b9\u7684\u6bd4\u598296M\u3001128M\u670d\u52a1\u5668\u5c31\u4e0d\u884c\u4e86\uff0c\u8fd9\u65f6\u5019\u6211\u4eec\u5c31\u53ef\u4ee5\u901a\u8fc7\u5b89\u88c5\u5176\u5b83\u73af\u5883\u6765\u642d\u5efa\u7f51\u7ad9\u73af\u5883\u4e86\uff0c\u8fd9\u91cc\u535a\u4e3b\u5c31\u8bf4\u4e0bCaddy+PHP7+Sqlite3\u5b89\u88c5\u6559\u7a0b\uff0c3\u5206\u949f\u5c31\u53ef\u4ee5\u642d\u5efa\u4e00\u4e2aTypecho\u535a\u5ba2\uff0c\u5e76\u6210\u529f\u8fd0\u884c\u572896M\u7684VPS\u670d\u52a1\u5668\u4e0a\uff0c\u81f3\u4e8e96M\u4ee5\u4e0b\u7684\u670d\u52a1\u5668\u5c31\u4e0d\u6d4b\u8bd5\u4e86\uff0c\u6bd5\u7adf\u5f88\u5c11\u89c1\u4e86\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-6380\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2018\/09\/Screenshot_2018-09-19-Typecho-Official-Site.png\" alt=\"\" width=\"1583\" height=\"737\" \/><\/p>\n<p>\u5b89\u88c5<br \/>\n\u6559\u7a0b\u53ea\u5199Debian 8\u30019\uff0c\u5efa\u8bae\u9009\u62e9mini\u7248\u3002\u5982\u679c\u4f60\u662f96M\u6216\u8005128M\u7684KVM\u5efa\u8bae\u589e\u52a0\u70b9Swap\uff0c\u6559\u7a0b\u67e5\u770b\uff1aVPS\u6dfb\u52a0Swap\u865a\u62df\u5185\u5b58\u3002<\/p>\n<p>1\u3001\u5b89\u88c5PHP 7\u548cSqlite 3<\/p>\n<h1>Debian 8\u7cfb\u7edf<\/h1>\n<h1>\u6dfb\u52a0\u6e90<\/h1>\n<pre><code>echo \"deb http:\/\/packages.dotdeb.org jessie all\" | tee --append \/etc\/apt\/sources.list\r\necho \"deb-src http:\/\/packages.dotdeb.org jessie all\" | tee --append \/etc\/apt\/sources.list<\/code><\/pre>\n<h1>\u6dfb\u52a0key<\/h1>\n<pre><code>wget --no-check-certificate https:\/\/www.dotdeb.org\/dotdeb.gpg\r\napt-key add dotdeb.gpg<\/code><\/pre>\n<h1>\u66f4\u65b0\u7cfb\u7edf<\/h1>\n<pre><code>apt-get update -y<\/code><\/pre>\n<h1>\u5b89\u88c5PHP 7\u548cSqlite 3<\/h1>\n<pre><code>apt-get install php7.0-cgi php7.0-fpm php7.0-curl php7.0-gd php7.0-mbstring php7.0-xml php7.0-sqlite3 sqlite3 -y<\/code><\/pre>\n<h1>Debian 9\u7cfb\u7edf<\/h1>\n<h1>\u66f4\u65b0\u7cfb\u7edf<\/h1>\n<pre><code>apt-get update -y<\/code><\/pre>\n<h1>\u5b89\u88c5PHP 7\u548cSqlite 3<\/h1>\n<pre><code>apt-get install php7.0-cgi php7.0-fpm php7.0-curl php7.0-gd php7.0-mbstring php7.0-xml php7.0-sqlite3 sqlite3 -y<\/code><\/pre>\n<p>2\u3001\u5b89\u88c5Caddy<br \/>\n\u8fd9\u91cc\u76f4\u63a5\u4f7f\u7528\u9017\u6bd4\u7684\u4e00\u952e\u811a\u672c\u3002<\/p>\n<pre><code>wget -N --no-check-certificate https:\/\/raw.githubusercontent.com\/ToyoDAdoubi\/doubi\/master\/caddy_install.sh &amp;&amp; chmod +x caddy_install.sh &amp;&amp; bash caddy_install.sh install http.filemanager<\/code><\/pre>\n<h1>\u5907\u7528\u5730\u5740<\/h1>\n<pre><code>wget -N --no-check-certificate https:\/\/www.moerats.com\/usr\/shell\/Caddy\/caddy_install.sh &amp;&amp; chmod +x caddy_install.sh &amp;&amp; bash caddy_install.sh install http.filemanager<\/code><\/pre>\n<p>3\u3001\u4e0b\u8f7dTypecho<\/p>\n<pre><code>mkdir \/typecho &amp;&amp; cd \/typecho<\/code><\/pre>\n<h1>\u4ee5\u4e0b\u4e3a\u6700\u65b0\u7a33\u5b9a\u7248<\/h1>\n<pre><code>wget http:\/\/typecho.org\/downloads\/1.1-17.10.30-release.tar.gz\r\ntar zxvf 1.1*\r\nmv .\/build\/* .\/\r\nrm -rf 1.1* buil*\r\nchmod -R 755 .\/*\r\nchown www-data:www-data -R .\/*<\/code><\/pre>\n<p>4\u3001\u914d\u7f6eCaddy<\/p>\n<h1>\u4ee5\u4e0b\u5168\u90e8\u5185\u5bb9\u662f\u4e00\u4e2a\u6574\u4f53\uff0c\u662f\u4e00\u4e2a\u547d\u4ee4\uff0c\u4fee\u6539\u793a\u4f8b\u57df\u540d\u540e\u5168\u90e8\u590d\u5236\u7c98\u8d34\u5230SSH\u8f6f\u4ef6\u4e2d\u5e76\u4e00\u8d77\u6267\u884c<\/h1>\n<pre><code>echo \"http:\/\/moerats.com {\r\n    redir https:\/\/www.moerats.com{url}\r\n    }\r\n    https:\/\/www.moerats.com {\r\n    gzip\r\n    tls admin@moerats.com\r\n    root \/typecho\r\n    fastcgi \/ \/run\/php\/php7.0-fpm.sock php\r\n    rewrite {\r\n        if {path} not_match ^\\\/admin\r\n        to {path} {path}\/ \/index.php?{query}\r\n     }\r\n}\" &gt; \/usr\/local\/caddy\/Caddyfile<\/code><\/pre>\n<p>\u53c2\u6570\u8bf4\u660e\uff1a<\/p>\n<p>\u7b2c\u4e00\u4e2a{}\u53c2\u6570\u4e3a\u91cd\u5b9a\u5411\uff0c\u5c06http:\/\/moerats.com\u91cd\u5b9a\u5411\u5230\u4e86https:\/\/www.moerats.com\uff0c\u6839\u636e\u5b9e\u9645\u60c5\u51b5\u4fee\u6539<br \/>\ntls\u4e3a\u81ea\u52a8\u7b7e\u53d1Let&#8217;s\u8bc1\u4e66\uff0c\u90ae\u7bb1\u968f\u4fbf\u586b\uff0c\u4f7f\u7528\u81ea\u7b7e\u53d1\u8bc1\u4e66\u7684\u8bf7\u5148\u89e3\u6790\u597d\u57df\u540d\uff0c\u5982\u679c\u60f3\u4f7f\u7528\u81ea\u5df1\u7684\u8bc1\u4e66\uff0c\u5219\u5c06tls\u4e00\u884c\u6539\u6210tls<br \/>\n\/root\/xxx.crt \/root\/xxx.key\u5373\u53ef\uff0c\u540e\u9762\u4e3a\u8bc1\u4e66\u8def\u5f84\u3002<br \/>\n\u6700\u540e\u542f\u52a8Caddy<\/p>\n<p>\u5982\u679c\u542f\u52a8\u5931\u8d25\uff0c\u8bf7\u67e5\u770b\u4e0b\u7cfb\u7edf\u662f\u5426\u81ea\u5e26Apache2\uff0c\u7136\u540e\u8fd0\u884capt remove apache2\u5378\u8f7d\u6389<br \/>\n\/etc\/init.d\/caddy start<br \/>\n\u7136\u540e\u53ef\u4ee5\u8bbf\u95ee\u57df\u540d\u8fdb\u884c\u5b89\u88c5\u4e86\u3002<br \/>\n\u8bf7\u8f93\u5165\u56fe\u7247\u63cf\u8ff0<\/p>\n<p>\u6570\u636e\u5e93\u6587\u4ef6\u5728\/typecho\/usr\u6587\u4ef6\u5939\uff0c\u8bb0\u5f97\u968f\u65f6\u5907\u4efd\u3002<\/p>\n<p>Caddy\u8bf4\u660e<br \/>\n\u542f\u52a8\uff1a\/etc\/init.d\/caddy start<br \/>\n\u505c\u6b62\uff1a\/etc\/init.d\/caddy stop<br \/>\n\u91cd\u542f\uff1a\/etc\/init.d\/caddy restart<br \/>\n\u67e5\u770b\u72b6\u6001\uff1a\/etc\/init.d\/caddy status<br \/>\n\u67e5\u770bCaddy\u542f\u52a8\u65e5\u5fd7\uff1atail -f \/tmp\/caddy.log<br \/>\n\u5b89\u88c5\u76ee\u5f55\uff1a\/usr\/local\/caddy<br \/>\nCaddy\u914d\u7f6e\u6587\u4ef6\u4f4d\u7f6e\uff1a\/usr\/local\/caddy\/Caddyfile<br \/>\nCaddy\u81ea\u52a8\u7533\u8bf7SSL\u8bc1\u4e66\u4f4d\u7f6e\uff1a\/.caddy\/acme\/acme-v01.api.letsencrypt.org\/sites\/xxx.xxx(\u57df\u540d)\/<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; \u8bf4\u660e\uff1a\u6211\u4eec\u4e00\u822c\u642d\u5efa\u535a&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/6379"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6379"}],"version-history":[{"count":1,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/6379\/revisions"}],"predecessor-version":[{"id":6381,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/6379\/revisions\/6381"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6379"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6379"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6379"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}