{"id":111,"date":"2022-01-24T01:03:03","date_gmt":"2022-01-23T17:03:03","guid":{"rendered":"https:\/\/www.addgm.com\/?p=111"},"modified":"2022-01-24T01:05:13","modified_gmt":"2022-01-23T17:05:13","slug":"yourls-%e6%90%ad%e5%bb%ba","status":"publish","type":"post","link":"https:\/\/www.addgm.com\/index.php\/2022\/01\/24\/yourls-%e6%90%ad%e5%bb%ba\/","title":{"rendered":"Yourls \u642d\u5efa"},"content":{"rendered":"\n<p>\u5b98\u65b9\u6587\u6863\uff1a<a href=\"https:\/\/yourls.org\/\" target=\"_blank\" rel=\"noreferrer noopener\" rel=\"nofollow\" >https:\/\/yourls.org<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u4ec0\u4e48\u662fyourls\">\u4ec0\u4e48\u662f YOURLS\uff1f<\/h2>\n\n\n\n<p>YOURLS stands for Your Own URL Shortener. It is a small set of PHP scripts that will allow you to run your own URL shortening service (a la TinyURL or Bitly).<\/p>\n\n\n\n<p>Running your own URL shortener is fun, geeky and useful: you own your data and don\u2019t depend on third-party services. It\u2019s also a great way to add branding to your short URLs, instead of using the same public URL shortener everyone uses.<\/p>\n\n\n\n<p>YOURLS \u4ee3\u8868\u60a8\u81ea\u5df1\u7684 URL \u7f29\u77ed\u5668\u3002 \u5b83\u662f\u4e00\u5c0f\u7ec4 PHP \u811a\u672c\uff0c\u53ef\u8ba9\u60a8\u8fd0\u884c\u81ea\u5df1\u7684 URL \u7f29\u77ed\u670d\u52a1\uff08La TinyURL \u6216 Bitly\uff09\u3002<\/p>\n\n\n\n<p>\u8fd0\u884c\u60a8\u81ea\u5df1\u7684 URL \u7f29\u77ed\u5668\u65e2\u6709\u8da3\u53c8\u6709\u8da3\u4e14\u6709\u7528\uff1a\u60a8\u62e5\u6709\u81ea\u5df1\u7684\u6570\u636e\uff0c\u5e76\u4e14\u4e0d\u4f9d\u8d56\u7b2c\u4e09\u65b9\u670d\u52a1\u3002 \u8fd9\u4e5f\u662f\u4e3a\u60a8\u7684\u77ed URL \u6dfb\u52a0\u54c1\u724c\u7684\u597d\u65b9\u6cd5\uff0c\u800c\u4e0d\u662f\u4f7f\u7528\u6bcf\u4e2a\u4eba\u90fd\u4f7f\u7528\u7684\u76f8\u540c\u7684\u516c\u5171 URL \u7f29\u77ed\u5668\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u7279\u70b9\">\u7279\u70b9<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u514d\u8d39\u800c\u4e14\u5f00\u6e90<\/li>\n\n\n\n<li>\u4f7f\u7528\u5177\u6709\u4e24\u9762\u6027\uff1a\u79c1\u6709\u7684\uff08\u4ec5\u81ea\u5df1\u4f7f\u7528\uff09\u6216\u8005\u751f\u6210\u516c\u5171\u7684\uff08\u6bcf\u4e2a\u4eba\u90fd\u53ef\u4ee5\u521b\u5efa\u77ed\u94fe\u63a5\uff0c\u9002\u7528\u4e8e Intranet\uff09<\/li>\n\n\n\n<li>\u987a\u5e8f\u6392\u5217 (\u4ece 1 \u5230 n) \u6216\u81ea\u5b9a\u4e49 URL \u5173\u952e\u5b57<\/li>\n\n\n\n<li>\u5341\u5206\u65b9\u4fbf\u7684\u7c7b\u4e66\u7b7e\u6a21\u5f0f\u8bb0\u5f55\uff0c\u53ef\u8f7b\u677e\u7f29\u77ed\u548c\u5171\u4eab\u94fe\u63a5<\/li>\n\n\n\n<li>\u51fa\u8272\u7684\u7edf\u8ba1\u4fe1\u606f\uff1a\u5386\u53f2\u70b9\u51fb\u62a5\u544a\uff0c\u5f15\u8350\u6765\u6e90\u8ddf\u8e2a\uff0c\u8bbf\u95ee\u8005\u5730\u7406\u4f4d\u7f6e<\/li>\n\n\n\n<li>\u6574\u6d01\u7684 Ajaxed \u754c\u9762<\/li>\n\n\n\n<li>\u51fa\u8272\u7684\u63d2\u4ef6\u67b6\u6784\uff0c\u53ef\u8f7b\u677e\u5b9e\u73b0\u65b0\u529f\u80fd<\/li>\n\n\n\n<li>\u652f\u6301\u5f00\u53d1\u4eba\u5458 API<\/li>\n\n\n\n<li>\u5168\u9762\u7684 jsonp \u652f\u6301<\/li>\n\n\n\n<li>\u5b89\u88c5\u5341\u5206\u53cb\u597d<\/li>\n\n\n\n<li>\u793a\u4f8b\u6587\u4ef6\u53ef\u521b\u5efa\u60a8\u81ea\u5df1\u7684\u516c\u5171\u754c\u9762\u7b49<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u5b89\u88c5\u73af\u5883\">\u5b89\u88c5\u73af\u5883<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u7cfb\u7edf Centos7<\/li>\n\n\n\n<li>\u5b9d\u5854\u9762\u677f\uff08LNMP\uff09<\/li>\n\n\n\n<li>Nginx 1.18.0<\/li>\n\n\n\n<li>MySQL 5.5.62<\/li>\n\n\n\n<li>PHP 7.3<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u65b0\u5efa\u7ad9\u70b9\">\u65b0\u5efa\u7ad9\u70b9<\/h2>\n\n\n\n<p>\u6253\u5f00\u5b9d\u5854\u9762\u677f\uff0c\u6dfb\u52a0\u4e00\u4e2a\u5df2\u7ecf\u89e3\u6790\u597d\u7684\u7f51\u7ad9\u3002<\/p>\n\n\n\n<p>\u5b89\u88c5\u6570\u636e\u5e93\u3001 php\u3002<\/p>\n\n\n\n<p>\u57df\u540d\u7533\u8bf7\u4e00\u4e2a SSL \u8bc1\u4e66<\/p>\n\n\n\n<p>\u8bbe\u7f6e\u4f2a\u9759\u6001\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-\">location \/\n{\n\t try_files $uri $uri\/ \/yourls-loader.php$is_args$args;\n}<\/code><\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u4e0b\u8f7d\u6e90\u7801\">\u4e0b\u8f7d\u6e90\u7801<\/h2>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><a href=\"https:\/\/github.com\/YOURLS\/YOURLS\/releases\" target=\"_blank\"  rel=\"nofollow\" >https:\/\/github.com\/YOURLS\/YOURLS\/releases<\/a><\/p>\n<\/blockquote>\n\n\n\n<p>\u4e0a\u4f20\u6e90\u7801\u81f3\u7f51\u7ad9\u6839\u76ee\u5f55<\/p>\n\n\n\n<p>\u63a5\u4e0b\u6765\u6253\u5f00\u76ee\u5f55&nbsp;\/user\/, \u628a\u91cc\u9762\u7684&nbsp;config-sample.php&nbsp;\u6539\u6210&nbsp;config.php<\/p>\n\n\n\n<p>\u7f16\u8f91 config.php \u91cc\u9762\u7684\u5185\u5bb9<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-\">define( &#039;YOURLS_DB_USER&#039;, &#039;your db user name&#039; );    # \u6570\u636e\u5e93\u7528\u6237\u540d\ndefine( &#039;YOURLS_DB_USER&#039;, &#039;your db user name&#039; );    # \u6570\u636e\u5e93\u7528\u6237\u540d\ndefine( &#039;YOURLS_DB_PASS&#039;, &#039;your db password&#039; );    # \u6570\u636e\u5e93\u5bc6\u7801\ndefine( &#039;YOURLS_DB_NAME&#039;, &#039;yourls&#039; );    # \u6570\u636e\u5e93\u540d\u79f0\ndefine( &#039;YOURLS_DB_HOST&#039;, &#039;localhost&#039; );    # \u4e0d\u7528\u6539\ndefine( &#039;YOURLS_DB_PREFIX&#039;, &#039;yourls_&#039; );    # \u4e0d\u7528\u6539\ndefine( &#039;YOURLS_SITE&#039;, &#039;http:\/\/yourls.addgm.com&#039; );    # \u4f60\u81ea\u5df1\u7684\u57df\u540d \u8d8a\u77ed\u8d8a\u597d\uff0c\u6bd4\u5982\u6211\u7684 yourls.addgm.com \u77ed\u5730\u5740\u57fa\u4e8e\u8fd9\u4e2a\u751f\u6210\u3002\ndefine( &#039;YOURLS_HOURS_OFFSET&#039;, 0 );    # \u65f6\u533a\u504f\u79fb \u6539\u6210 8\ndefine( &#039;YOURLS_LANG&#039;, &#039;&#039; );    # \u8bed\u8a00\u8bbe\u7f6e\uff0c\u9ed8\u8ba4\u662f\u82f1\u6587\uff0c\u540e\u9762\u6211\u4eec\u6539\u6210\u4e2d\u6587\u7248\u672c\uff0c\u586b&#039;zh_CN&#039;\ndefine( &#039;YOURLS_UNIQUE_URLS&#039;, true );    # \u4e0d\u7528\u6539\uff0c\u77ed\u5730\u5740\u662f\u5426\u552f\u4e00\ndefine( &#039;YOURLS_PRIVATE&#039;, true );    # \u4e0d\u7528\u6539\uff0c\u662f\u5426\u79c1\u6709\uff0c\u5982\u679c\u79c1\u6709\u7684\uff0c\u5219\u8fdb\u884capi\u8c03\u7528\u751f\u6210\u77ed\u5730\u5740\u65f6\u9700\u8981\u4f20\u9012\u7528\u6237\u540d\u548c\u5bc6\u7801\ndefine( &#039;YOURLS_COOKIEKEY&#039;, &#039;modify this text with something random&#039; );    # \u70b9\u51fbhttp:\/\/yourls.org\/cookie \u590d\u5236\u91cc\u9762\u7684\u5bc6\u94a5,\u8fd9\u4e2a\u4e0d\u7528\u8bb0\u4f4f\u7684\u3002\n\n&#039;username&#039; =&gt; &#039;password&#039;,\u00a0 # \u7528\u6237\u540d=&gt;\u5bc6\u7801\u00a0 \u53ef\u586b\u591a\u4e2a\u767b\u5f55\u6210\u529f\u540e\u8fd9\u91cc\u7684\u660e\u6587\u5bc6\u7801\u4f1a\u88ab\u52a0\u5bc6\uff0c\u8fd9\u91cc\u9ed8\u8ba4\u662f\u6ca1\u6709\u7684\uff0c\u6211\u4eec\u4e3a\u4e86\u5b89\u5168\u52a0\u4e0a\u4e00\u4e2a\uff0c\u6bd4\u5982\u7528\u6237\u540d\u662f&#039;admin&#039;\uff0c\u5bc6\u7801\u662f&#039;123456&#039;\n\ndefine( &#039;YOURLS_DEBUG&#039;, false );    # \u4e0d\u7528\u6539,\u662f\u5426\u5f00\u542f\u8c03\u8bd5\ndefine( &#039;YOURLS_URL_CONVERT&#039;, 36 );    # \u81ea\u5df1\u8bbe\u7f6e\u4f7f\u752836\u8fdb\u5236 \u8fd8\u662f62\u8fdb\u5236\u00a0 \u8fd9\u4e2a\u6700\u597d\u4e00\u5f00\u59cb\u8bbe\u597d\u4e0d\u8981\u4fee\u6539\uff0c\u907f\u514d\u5730\u5740\u51b2\u7a81\uff0c\u5efa\u8bae62\u8fdb\u5236\n\n$yourls_reserved_URL = array(\u00a0 &#039;porn&#039;, &#039;faggot&#039;, &#039;sex&#039;, &#039;nigger&#039;, &#039;fuck&#039;, &#039;cunt&#039;, &#039;dick&#039;,);    # \u6392\u9664\u8fd9\u4e9b\u654f\u611f\u8bcd\u6c47\uff0c\u8fd9\u4e9b\u5730\u5740\u662f\u4e0d\u4f1a\u751f\u6210\u7684<\/code><\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\">\u6c49\u5316<\/h2>\n\n\n\n<p>\u8bed\u97f3\u5305\u5730\u5740\uff1a<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><a href=\"https:\/\/github.com\/ZvonimirSun\/YOURLS-zh_CN\" target=\"_blank\"  rel=\"nofollow\" >https:\/\/github.com\/ZvonimirSun\/YOURLS-zh_CN<\/a><\/p>\n<\/blockquote>\n\n\n\n<p>\u539f\u4f5c\u8005\u8c8c\u4f3c\u5df2\u7ecf\u505c\u6b62\u66f4\u65b0\u4e86\uff0c\u4e0d\u8fc7\u8fd8\u80fd\u4f7f\u7528<\/p>\n\n\n\n<p>\u89e3\u538b\uff0c\u7136\u540e\u628a YOURLS-zh_CN-1.7.3&nbsp;\u7684\u6587\u4ef6\u526a\u5207\u51fa\u6765<\/p>\n\n\n\n<p>\u7c98\u8d34\u81f3\u7f51\u7ad9\u7684 \/user\/languages\/<\/p>\n\n\n\n<p>\u6d4f\u89c8\u5668\u8f93\u5165<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><a href=\"https:\/\/yourls.addgm.com\" target=\"_blank\" rel=\"noreferrer noopener\" rel=\"nofollow\" >https:\/\/ \u57df\u540d \/admin<\/a><\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u8865\u5145\">\u8865\u5145<\/h2>\n\n\n\n<p>\u77ed\u94fe\u63a5\u540e\u9762\u4ece 1 \u5f00\u59cb\uff0c\u53ef\u4ee5\u7528\u65f6\u95f4\u6233\u6765\u751f\u6210<\/p>\n\n\n\n<p>\u53ea\u9700\u8981\u4fee\u6539 includes\/functions.php&nbsp; 272 \u884c\u5de6\u53f3<\/p>\n\n\n\n<p>\u5c06&nbsp;$id = yourls_get_next_decimal();&nbsp;\u6539\u4e3a&nbsp;$id = time();<\/p>\n\n\n\n<p>\u8fd9\u6837\u7684\u8bdd\uff0c\u540e\u9762\u94fe\u63a5\u4f1a\u53d8\u957f\uff0c\u800c\u4e14\u4e0d\u77e5\u9053\u662f bug \u8fd8\u662f\u4ec0\u4e48\u539f\u56e0\uff0c\u60f3\u6539\u56de\u6765\u6539\u4e0d\u56de\u6765\uff0c\u6709\u9700\u8981\u7684\u53ef\u4ee5\u5c1d\u8bd5\u4e00\u4e0b\u3002<\/p>\n\n\n\n<p>\u5b98\u65b9\u81ea\u5e26\u7684\u63d2\u4ef6\u5e93\uff1a<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><a href=\"https:\/\/github.com\/YOURLS\/awesome-yourls#plugins\" target=\"_blank\"  rel=\"nofollow\" >https:\/\/github.com\/YOURLS\/awesome-yourls#plugins<\/a><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>\u5b98\u65b9\u6587\u6863\uff1ahttps:\/\/yourls.org \u4ec0\u4e48\u662f YOURLS\uff1f YOURLS stands for Your Own UR &#8230;<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[3],"class_list":["post-111","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-3"],"_links":{"self":[{"href":"https:\/\/www.addgm.com\/index.php\/wp-json\/wp\/v2\/posts\/111","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.addgm.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.addgm.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.addgm.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.addgm.com\/index.php\/wp-json\/wp\/v2\/comments?post=111"}],"version-history":[{"count":2,"href":"https:\/\/www.addgm.com\/index.php\/wp-json\/wp\/v2\/posts\/111\/revisions"}],"predecessor-version":[{"id":113,"href":"https:\/\/www.addgm.com\/index.php\/wp-json\/wp\/v2\/posts\/111\/revisions\/113"}],"wp:attachment":[{"href":"https:\/\/www.addgm.com\/index.php\/wp-json\/wp\/v2\/media?parent=111"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.addgm.com\/index.php\/wp-json\/wp\/v2\/categories?post=111"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.addgm.com\/index.php\/wp-json\/wp\/v2\/tags?post=111"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}