{"id":40405,"date":"2020-02-27T11:53:14","date_gmt":"2020-02-27T03:53:14","guid":{"rendered":"http:\/\/4563.org\/?p=40405"},"modified":"2020-02-27T11:53:14","modified_gmt":"2020-02-27T03:53:14","slug":"%e5%8e%9f%e5%88%9b-%e8%ae%a9trojan%e5%92%8c-lnmp-oneinstack%e5%85%b1%e5%ad%98%e7%9a%84%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=40405","title":{"rendered":"[\u539f\u521b] \u8ba9Trojan\u548c LNMP\/oneinstack\u5171\u5b58\u7684\u65b9\u6cd5"},"content":{"rendered":"\n<p>  \t\t\t\t\t<strong>nic2013<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3>[\u539f\u521b] \u8ba9Trojan\u548c LNMP\/oneinstack\u5171\u5b58\u7684\u65b9\u6cd5<\/h3>\n<p>  \t\t \u672c\u5e16\u6700\u540e\u7531 nic2013 \u4e8e 2020-2-27 11:27 \u7f16\u8f91 <\/p>\n<p> \u6838\u5fc3\u5185\u5bb9\uff1a\u8ba9 Trojan\u76d1\u542c\u975e443\u7aef\u53e3\u3002<\/p>\n<p>  \u65b0\u5efa\u4e00\u4e2a vhost \u8ba9 LNMP\/oneinstack \u81ea\u52a8\u7533\u8bf7\u597d Let&#8217;s Encrypt \u8bc1\u4e66\u3002<\/p>\n<p>  \u4fee\u6539 vhost \u9ed8\u8ba4\u914d\u7f6e\u6587\u4ef6\u3002<\/p>\n<p>  server<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;{<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;listen 80;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;server_name www.hostloc.com hostloc.com;<\/p>\n<p>  &nbsp; &nbsp; root \/data\/wwwroot\/default;<br \/>  &nbsp; &nbsp; index index.html index.htm index.php;<br \/>  }<\/p>\n<p>  \u5728 \/usr\/local\/nginx\/conf\/nginx.conf\u7684 http \u5b57\u6bb5\u6dfb\u52a0\u5982\u4e0b\u4ee3\u7801<\/p>\n<p>  &nbsp; &nbsp; log_formatmain&#8217;$remote_addr &#8211; $remote_user [$time_local] &quot;$request&quot; &#8216;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &#8216;$status $body_bytes_sent &quot;$http_referer&quot; &#8216;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &#8216;&quot;$http_user_agent&quot; &quot;$http_x_forwarded_for&quot;&#8217;;<\/p>\n<p>  \/usr\/local\/nginx\/sbin\/nginx -t \u6d4b\u8bd5\u4e00\u4e0b\uff0c\u65e0\u8bef\u540e service nginx restart<\/p>\n<p>  \u8ba9 Trojan\u76d1\u542c\u975e443\u7aef\u53e3\uff0c\u6bd4\u5982\u76d1\u542c90\u7aef\u53e3\u3002<\/p>\n<p>  cd \/usr\/src \u76ee\u5f55\uff0c\u4e0b\u8f7d Trojan \u670d\u52a1\u7aef https:\/\/github.com\/trojan-\u9ad8\u5899\/trojan\/releases\/download\/v1.14.1\/trojan-1.14.1-linux-amd64.tar.xz<\/p>\n<p>  \u89e3\u538b tar xf trojan-1.14.1-linux-amd64.tar.xz<\/p>\n<p>  \u5728 \/usr\/src\/trojan \u76ee\u5f55\u65b0\u5efa\u4e00\u4e2a server.conf \u914d\u7f6e\u6587\u4ef6<\/p>\n<p>  {<br \/>  &nbsp; &nbsp; &quot;run_type&quot;: &quot;server&quot;,<br \/>  &nbsp; &nbsp; &quot;local_addr&quot;: &quot;0.0.0.0&quot;,<br \/>  &nbsp; &nbsp; &quot;local_port&quot;: 90,<br \/>  &nbsp; &nbsp; &quot;remote_addr&quot;: &quot;127.0.0.1&quot;,<br \/>  &nbsp; &nbsp; &quot;remote_port&quot;: 80,<br \/>  &nbsp; &nbsp; &quot;password&quot;: [<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&quot;password1&quot;<br \/>  &nbsp; &nbsp; ],<br \/>  &nbsp; &nbsp; &quot;log_level&quot;: 1,<br \/>  &nbsp; &nbsp; &quot;ssl&quot;: {<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&quot;cert&quot;: &quot;\/usr\/local\/nginx\/conf\/ssl\/\u8bc1\u4e66\u5b9e\u9645\u8def\u5f84.crt&quot;,<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&quot;key&quot;: &quot;\/usr\/local\/nginx\/conf\/ssl\/\u8bc1\u4e66\u5b9e\u9645\u8def\u5f84.key&quot;,<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&quot;key_password&quot;: &quot;&quot;,<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&quot;cipher_tls13&quot;:&quot;TLS_AES_128_GCM_SHA256:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_256_GCM_SHA384&quot;,<br \/>  &quot;prefer_server_cipher&quot;: true,<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&quot;alpn&quot;: [<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&quot;http\/1.1&quot;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;],<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&quot;reuse_session&quot;: true,<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&quot;session_ticket&quot;: false,<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&quot;session_timeout&quot;: 600,<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&quot;plain_http_response&quot;: &quot;&quot;,<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&quot;curves&quot;: &quot;&quot;,<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&quot;dhparam&quot;: &quot;&quot;<br \/>  &nbsp; &nbsp; },<br \/>  &nbsp; &nbsp; &quot;tcp&quot;: {<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&quot;no_delay&quot;: true,<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&quot;keep_alive&quot;: true,<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&quot;fast_open&quot;: false,<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&quot;fast_open_qlen&quot;: 20<br \/>  &nbsp; &nbsp; },<br \/>  &nbsp; &nbsp; &quot;mysql&quot;: {<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&quot;enabled&quot;: false,<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&quot;server_addr&quot;: &quot;127.0.0.1&quot;,<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&quot;server_port&quot;: 3306,<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&quot;database&quot;: &quot;trojan&quot;,<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&quot;username&quot;: &quot;trojan&quot;,<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&quot;password&quot;: &quot;&quot;<br \/>  &nbsp; &nbsp; }<br \/>  }<\/p>\n<p>  \u521b\u5efa Trojan \u81ea\u542f\u670d\u52a1<\/p>\n<p>  Debian9 \u7cfb\u7edf\u627e\u5230\/lib\/systemd\/system\/\u76ee\u5f55\uff0c\u5e76\u521b\u5efatrojan.service\u6587\u4ef6<\/p>\n<p>  CentOS7 \u7cfb\u7edf\u627e\u5230\/usr\/lib\/systemd\/system\/\u76ee\u5f55\uff0c\u5e76\u521b\u5efatrojan.service\u6587\u4ef6<\/p>\n<p>  \u6253\u5f00trojan.service\u6587\u4ef6\uff0c\u5e76\u5199\u5165\u4ee5\u4e0b\u4ee3\u7801<\/p>\n<p>  Description=trojan<br \/>  After=network.target<br \/>  &nbsp; &nbsp;<\/p>\n<p>  Type=simple<br \/>  PIDFile=\/usr\/src\/trojan\/trojan\/trojan.pid<br \/>  ExecStart=\/usr\/src\/trojan\/trojan -c &quot;\/usr\/src\/trojan\/server.conf&quot;<br \/>  ExecReload=<br \/>  ExecStop=\/usr\/src\/trojan\/trojan<br \/>  PrivateTmp=true<br \/>  &nbsp; &nbsp;<\/p>\n<p>  WantedBy=multi-user.target<\/p>\n<p>  \u8bbe\u7f6e\u542f\u52a8 Trojan \u670d\u52a1<\/p>\n<p>  systemctl start trojan.service#\u542f\u52a8 Trojan<\/p>\n<p>  systemctl enable trojan.service#\u8bbe\u7f6e Trojan \u670d\u52a1\u5f00\u673a\u81ea\u542f<\/p>\n<p>  systemctl stop trojan.service#\u505c\u6b62 Trojan<\/p>\n<p>  \u4e0b\u8f7d Trojan \u5ba2\u6237\u7aef\u8f6f\u4ef6<\/p>\n<p>  https:\/\/github.com\/trojan-\u9ad8\u5899\/trojan\/releases\/download\/v1.14.1\/trojan-1.14.1-win.zip<\/p>\n<p>  \u628a\u670d\u52a1\u5668\u4e0a\u7684 fullchain.crt \u8bc1\u4e66\u653e\u5230\u672c\u5730 Trojan \u5ba2\u6237\u7aef\u6587\u4ef6\u5939\uff0c\u91cd\u547d\u540d\u4e3afullchain.cer\u3002<\/p>\n<p>  \u4fee\u6539 Trojan \u6587\u4ef6\u5939\u91cc\u9762\u7684config.json\u6587\u4ef6<\/p>\n<p>  {<br \/>  &nbsp; &nbsp; &quot;run_type&quot;: &quot;client&quot;,<br \/>  &nbsp; &nbsp; &quot;local_addr&quot;: &quot;127.0.0.1&quot;,<br \/>  &nbsp; &nbsp; &quot;local_port&quot;: 1080,<br \/>  &nbsp; &nbsp; &quot;remote_addr&quot;: &quot;www.hostloc.com&quot;,<br \/>  &nbsp; &nbsp; &quot;remote_port&quot;: 90, #\u4e0evps\u670d\u52a1\u7aef\u7aef\u53e3\u4e00\u81f4<br \/>  &nbsp; &nbsp; &quot;password&quot;: [<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&quot;password1&quot;<br \/>  &nbsp; &nbsp; ],<br \/>  &nbsp; &nbsp; &quot;log_level&quot;: 1,<br \/>  &nbsp; &nbsp; &quot;ssl&quot;: {<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&quot;verify&quot;: true,<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&quot;verify_hostname&quot;: true,<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&quot;cert&quot;: &quot;fullchain.cer&quot;,<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&quot;cipher_tls13&quot;:&quot;TLS_AES_128_GCM_SHA256:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_256_GCM_SHA384&quot;,<br \/>  &quot;sni&quot;: &quot;&quot;,<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&quot;alpn&quot;: [<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&quot;h2&quot;,<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&quot;http\/1.1&quot;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;],<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&quot;reuse_session&quot;: true,<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&quot;session_ticket&quot;: false,<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&quot;curves&quot;: &quot;&quot;<br \/>  &nbsp; &nbsp; },<br \/>  &nbsp; &nbsp; &quot;tcp&quot;: {<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&quot;no_delay&quot;: true,<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&quot;keep_alive&quot;: true,<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&quot;fast_open&quot;: false,<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&quot;fast_open_qlen&quot;: 20<br \/>  &nbsp; &nbsp; }<br \/>  }<\/p>\n<p>  \t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>hong2351<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u5927\u4f6c \uff01\uff01\u8d77\u6765\u9876\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>hehekotete<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u76d1\u542c\u522b\u7684\u7aef\u53e3\u548css\u6709\u5565\u533a\u522b\uff1f\uff1f\u975e443\u7684ssl\u770b\u8d77\u6765\u5c31\u4e0d\u9760\u8c31\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>nic2013<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\thehekotete \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-2-27 11:24<br \/>  \u76d1\u542c\u522b\u7684\u7aef\u53e3\u548css\u6709\u5565\u533a\u522b\uff1f\uff1f\u975e443\u7684ssl\u770b\u8d77\u6765\u5c31\u4e0d\u9760\u8c31<\/p>\n<p> \u8bf4\u7684\u4e5f\u5bf9\u3002\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>SFA<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u5e94\u8be5\u7528nginx\u518d\u505a\u4e00\u6b21\u53cd\u4ee3\uff0c\u8ba9Trojan\u8d70443\u51fa\u53bb\t\t\t  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>nic2013 \u5927\u4f6c\u6709\u8bdd\u8bf4 : [&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\/40405"}],"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=40405"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/40405\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=40405"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=40405"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=40405"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}