{"id":4391,"date":"2026-01-23T02:37:09","date_gmt":"2026-01-22T18:37:09","guid":{"rendered":"https:\/\/10ccc.cc\/?page_id=4391"},"modified":"2026-02-04T21:08:12","modified_gmt":"2026-02-04T13:08:12","slug":"mypaper-server-side-tutorial","status":"publish","type":"page","link":"https:\/\/10ccc.cc\/?page_id=4391","title":{"rendered":"MyPaper Server SIDE TUTORIAL"},"content":{"rendered":"<div class=\"markdown-heading\" dir=\"auto\">\n<h1 dir=\"auto\" tabindex=\"-1\">\u9879\u76ee\u5730\u5740\uff1a<a href=\"https:\/\/github.com\/craii\/MyPaper\/tree\/main\/server\" target=\"_blank\"  rel=\"nofollow\" >MyPaper<\/a><\/h1>\n<h1 class=\"heading-element\" dir=\"auto\" tabindex=\"-1\">SERVER SIDE TUTORIAL<\/h1>\n<p>&nbsp;<\/p>\n<\/div>\n<div class=\"markdown-heading\" dir=\"auto\">\n<h2 class=\"heading-element\" dir=\"auto\" tabindex=\"-1\">\u6982\u51b5<\/h2>\n<p>&nbsp;<\/p>\n<\/div>\n<p dir=\"auto\">server \u7aef\u547d\u4ee4\u884c\u5de5\u5177\uff0c\u7528\u4e8e\u5411 MyPaper \u63d0\u4f9b\uff1a<\/p>\n<ol dir=\"auto\">\n<li>\u7f29\u7565\u5f04\u58c1\u7eb8\u5217\u8868\uff0c\u7528\u4e8e\u5217\u8868\u5c55\u793a\uff1b<\/li>\n<li>\u5168\u5c3a\u5bf8\u58c1\u7eb8\u5217\u8868\uff0c\u7528\u4e8e\u5b9e\u9645\u7684\u58c1\u7eb8\u8bbe\u7f6e\uff1b<\/li>\n<li>\u4e3a\u5b9e\u73b0\u4e0a\u8ff0\u76ee\u7684\u5fc5\u5907\u7684\u4e00\u4e9b\u9644\u5c5e\u529f\u80fd\uff1b \u4ee5\u53ca \u4e3a\u81ea\u5df1\u5b66\u4e60\u4e86\u89e3 cpp \u63d0\u4f9b\u60c5\u7eea\u4ef7\u503c\u3002<\/li>\n<\/ol>\n<div class=\"markdown-heading\" dir=\"auto\">\n<h2 class=\"heading-element\" dir=\"auto\" tabindex=\"-1\">\u540e\u7eed\u76ee\u6807<\/h2>\n<p>&nbsp;<\/p>\n<\/div>\n<ol dir=\"auto\">\n<li>\u5305\u88c5\u6210wordpress\u63d2\u4ef6\uff0c\u65b9\u4fbf\u7ef4\u62a4\u64cd\u4f5c\uff1b<\/li>\n<li>\u5176\u4ed6\u3002<\/li>\n<\/ol>\n<div class=\"markdown-heading\" dir=\"auto\">\n<h2 class=\"heading-element\" dir=\"auto\" tabindex=\"-1\">\u7f16\u8bd1PaperServer<\/h2>\n<p>&nbsp;<\/p>\n<\/div>\n<div class=\"markdown-heading\" dir=\"auto\">\n<h3 class=\"heading-element\" dir=\"auto\" tabindex=\"-1\">\u7f16\u8bd1POCO<\/h3>\n<p>&nbsp;<\/p>\n<\/div>\n<p dir=\"auto\">\u62c9\u53d6\u00a0<a href=\"https:\/\/github.com\/pocoproject\/poco\" target=\"_blank\"  rel=\"nofollow\" >POCO\u4ed3\u5e93<\/a>\u5230\u670d\u52a1\u5668\uff0c\u4ee5\u4fbf\u540e\u7eed\u7f16\u8bd1\uff1b<\/p>\n<p dir=\"auto\"><code>git clone https:\/\/github.com\/pocoproject\/poco.git &amp;&amp; cd poco<\/code><\/p>\n<p dir=\"auto\">\u5b89\u88c5ssl\u5e93\uff0c\u5982\u679c\u4f60\u4f7f\u7528\u7684\u662f\u963f\u91cc\u4e91\uff0c \u8bf7\u6539\u7528<code>dnf<\/code>\u547d\u4ee4\u5b89\u88c5\uff1a\u00a0<code>apt-get install openssl libssl-dev<\/code><\/p>\n<p dir=\"auto\"><strong>\u5b89\u88c5\u5176\u5b83\u5fc5\u8981\u7684\u4f9d\u8d56\uff1a<\/strong><\/p>\n<p dir=\"auto\"><code>sudo apt-get -y update &amp;&amp; sudo apt-get -y install git g++ make cmake libssl-dev libmysqlclient-dev libpq-dev<\/code><\/p>\n<p dir=\"auto\">\u963f\u91cc\u4e91\u6539\u7528\uff1a<\/p>\n<p dir=\"auto\"><code>sudo yum install -y git gcc-c++ make cmake3 openssl-devel mysql-devel postgresql-devel <\/code><\/p>\n<p dir=\"auto\"><strong>Buid with Cmake\uff1a<\/strong><\/p>\n<p dir=\"auto\"><code>mkdir cmake-build cd cmake-build<\/code><\/p>\n<p dir=\"auto\">\u6ce8\u610f\u8981\u9759\u6001\u7f16\u8bd1(-DBUILD_SHARED_LIBS=OFF\uff0c\u5982\u679c\u8fd9\u91cc\u662fON\uff0c\u8bf7\u81ea\u884c\u4fee\u6539 CMakeLists )\uff0c\u4ee5\u53ca\u628aSQLITE\u4e5f\u4e00\u5e76build\uff1b(\u56e0\u4e3a\u5f53\u65f6\u8bd5\u56fe\u7f16\u8bd1\u6210\u5355\u4f53\u7a0b\u5e8f\uff0c\u4f46opencv\u5728\u963f\u91cc\u4e91\u4e0d\u77e5\u9053\u4e3a\u4ec0\u4e48\u5c31\u662f\u4e0d\u80fd\u9759\u6001\u7f16\u8bd1\u6210\u529f\uff0c\u56e0\u6b64\u5c31\u653e\u5f03\u4e86\u3002)<\/p>\n<p dir=\"auto\"><code>cmake .. \\ -DCMAKE_BUILD_TYPE=Release \\ -DBUILD_SHARED_LIBS=OFF \\ -DENABLE_NETSSL=ON \\ -DENABLE_CRYPTO=ON \\ -DENABLE_MONGODB=OFF \\ -DENABLE_REDIS=OFF \\ -DENABLE_PDF=OFF \\ -DENABLE_ZIP=OFF \\ -DENABLE_PAGECOMPILER=OFF \\ -DENABLE_PAGECOMPILER_FILE2PAGE=OFF \\ -DENABLE_DATA=ON   \\ -DENABLE_DATA_SQLITE=ON \\ -DCMAKE_INSTALL_PREFIX=\/usr\/local<\/code><\/p>\n<p dir=\"auto\"><strong>\u5b89\u88c5\u5934\u6587\u4ef6\u548c.a \u6587\u4ef6\uff1a<\/strong><\/p>\n<p dir=\"auto\"><code>sudo cmake --build . --target install<\/code><\/p>\n<p dir=\"auto\">\u5b89\u88c5\u5b8c\u6210\u540e\u4f60\u53ef\u4ee5\u5728\u00a0<code>\/usr\/local\/lib<\/code>\u4ee5\u53ca<code>\/usr\/local\/include<\/code>\u00a0\u4e2d\u627e\u5230 .a \u4ee5\u53ca .h \u6587\u4ef6\uff0c\u5982\u679c\u9700\u8981\u4fee\u6539\u5b89\u88c5\u4f4d\u7f6e\uff0c\u53ef\u5728\u00a0<code>CMakeLists<\/code>\u00a0\u4e2d\u4fee\u6539\u3002<\/p>\n<div class=\"markdown-heading\" dir=\"auto\">\n<h3 class=\"heading-element\" dir=\"auto\" tabindex=\"-1\">\u5b89\u88c5 OpenCV<\/h3>\n<p>&nbsp;<\/p>\n<\/div>\n<p dir=\"auto\">\u5982\u679c\u4f60\u7684\u670d\u52a1\u5668\u662fubuntu\uff0c\u8bf7\u6539\u7528apt-get<\/p>\n<p dir=\"auto\"><code>sudo dnf install opencv opencv-devel<\/code><\/p>\n<div class=\"markdown-heading\" dir=\"auto\">\n<h3 class=\"heading-element\" dir=\"auto\" tabindex=\"-1\">\u7f16\u8bd1PaperServer<\/h3>\n<p>&nbsp;<\/p>\n<\/div>\n<p dir=\"auto\"><strong>\u62c9\u53d6\u4ed3\u5e93\uff1a<\/strong><\/p>\n<p dir=\"auto\"><code>cd \/home &amp;&amp; git clone https:\/\/github.com\/craii\/MyPaper &amp;&amp; cd MyPaper\/server<\/code><\/p>\n<p dir=\"auto\"><strong>Build PaperServer:<\/strong><\/p>\n<p dir=\"auto\"><code>mkdir build &amp;&amp; cd build<\/code><\/p>\n<p dir=\"auto\"><code>cmake .. -DCMAKE_BUILD_TYPE=Release <\/code><\/p>\n<p dir=\"auto\"><code>make -j&amp;(nproc)<\/code><\/p>\n<p dir=\"auto\">\u7f16\u8bd1\u5b8c\u6210\u540e\uff0c\u4f60\u53ef\u4ee5\u5728\u00a0<code>\/home\/MyPaper\/server\/build<\/code>\u00a0\u4e2d \u627e\u5230\u00a0<code>PaperServer<\/code>\u00a0\u53ef\u6267\u884c\u7a0b\u5e8f\u3002<\/p>\n<div class=\"markdown-heading\" dir=\"auto\">\n<h2 class=\"heading-element\" dir=\"auto\" tabindex=\"-1\">\u6b63\u5f0f\u4f7f\u7528\u524d\u7684\u51c6\u5907\u5de5\u4f5c<\/h2>\n<p>&nbsp;<\/p>\n<\/div>\n<p dir=\"auto\">\u5f00\u653e\u7aef\u53e3\u7ed9<code>PaperServer<\/code>\u00a0\u4f7f\u7528\uff0c\u8fd9\u91cc\u4ee5 10001 \u4e3a\u4f8b\uff1a<\/p>\n<p dir=\"auto\"><code>sudo firewall-cmd --permanent --add-port=10001\/tcp<\/code><\/p>\n<p dir=\"auto\">\u5237\u65b0\u9632\u706b\u5899\u4f7f\u5176\u751f\u6548\uff1a<\/p>\n<p dir=\"auto\"><code>sudo firewall-cmd --reload<\/code><\/p>\n<p dir=\"auto\">\u6839\u636e\u5b9e\u9645\u60c5\u51b5\u4fee\u6539\u4f60\u7684 nginx \u914d\u7f6e\u6587\u4ef6\uff1a<\/p>\n<div class=\"snippet-clipboard-content notranslate position-relative overflow-auto\">\n<pre class=\"notranslate\" lang=\"server\"><code>{\r\n    listen 80;\r\n    listen 443 ssl;\r\n    listen 443 quic;   \r\n    .............. \r\n    #\u539f\u6709\u5176\u4ed6\u914d\u7f6e\r\n     #poco \u670d\u52a1\r\n    # --- Poco \u670d\u52a1\u53cd\u5411\u4ee3\u7406\u914d\u7f6e\u5f00\u59cb ---\r\n    location ^~ \/wallpaper {\r\n        proxy_pass http:\/\/127.0.0.1:10001 ;  # \u8f6c\u53d1\u5230\u4f60\u7684 Poco \u7a0b\u5e8f\u7aef\u53e3\r\n        proxy_http_version 1.1;\r\n        proxy_set_header Host $host;\r\n        proxy_set_header X-Real-IP $remote_addr;\r\n        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\r\n        proxy_set_header X-Forwarded-Proto $scheme;\r\n    }\r\n \r\n    location ^~ \/images {\r\n        proxy_pass http:\/\/127.0.0.1:10001 ;  # \u8f6c\u53d1\u5230\u4f60\u7684 Poco \u7a0b\u5e8f\u7aef\u53e3\r\n        proxy_http_version 1.1;\r\n        proxy_set_header Host $host;\r\n        proxy_set_header X-Real-IP $remote_addr;\r\n        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\r\n        proxy_set_header X-Forwarded-Proto $scheme;\r\n \r\n    location ^~ \/refresh{ \r\n        proxy_pass http:\/\/127.0.0.1:10001 ; # \u8f6c\u53d1\u5230\u4f60\u7684 Poco \u7a0b\u5e8f\u7aef\u53e3 \r\n        proxy_http_version 1.1; \r\n        proxy_set_header Host $host; \r\n        proxy_set_header X-Real-IP $remote_addr; \r\n        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; \r\n        proxy_set_header X-Forwarded-Proto $scheme;\r\n    }\r\n    # --- Poco \u670d\u52a1\u53cd\u5411\u4ee3\u7406\u914d\u7f6e\u7ed3\u675f ---\r\n#\u539f\u6709\u5176\u4ed6\u914d\u7f6e\r\n..........\r\n}\r\n<\/code><\/pre>\n<p dir=\"auto\">\u6d4b\u8bd5\u8bed\u6cd5\u662f\u5426\u6b63\u786e\u00a0<code>sudo nginx -t<\/code><\/p>\n<p dir=\"auto\">\u5982\u679c OK\uff0c\u91cd\u8f7d\u914d\u7f6e\uff08\u4e0d\u4e2d\u65ad\u670d\u52a1\uff09\u00a0<code>sudo systemctl reload nginx<\/code><\/p>\n<div class=\"zeroclipboard-container\"><\/div>\n<\/div>\n<div class=\"markdown-heading\" dir=\"auto\">\n<h2 class=\"heading-element\" dir=\"auto\" tabindex=\"-1\">\u4f7f\u7528PaperServer<\/h2>\n<p>&nbsp;<\/p>\n<\/div>\n<p dir=\"auto\">\u6b64\u65f6\uff0c\u53ef\u4ee5\u5c06\u5168\u5c3a\u5bf8\u58c1\u7eb8\u4e0a\u4f20\u5230\u00a0<code>full_size_images<\/code>,\u9700\u8981\u6ce8\u610f\uff0c\u4e3a\u4e86\u6700\u597d\u7684\u663e\u793a\u6548\u679c\uff0c\u58c1\u7eb8\u7684\u5bbd\u9ad8\u6bd4\u6700\u597d\u662f\uff08375, 220\uff09\u3002<\/p>\n<p dir=\"auto\"><strong>\u542f\u52a8\u7a0b\u5e8f<\/strong>\u00a0<code>nohup .\/PaperServer 10001 \"YourTokens\" \"YourSite.com\"<\/code><\/p>\n<p dir=\"auto\"><strong>\u751f\u6210\u538b\u7f29\u56fe\u7247\uff0c\u4ee5\u4fbf\u5217\u8868\u52a0\u8f7d\uff1a<\/strong>\u00a0\u4f7f\u7528\u6d4f\u89c8\u5668\u8bbf\u95ee\uff1a\u00a0<code>https:\/\/YourSite.com\/refresh?token=YourTokens<\/code><\/p>\n<p dir=\"auto\"><strong>\u4fee\u6539 MyPaper \u8bbe\u7f6e<\/strong>\u00a0\u6b64\u65f6\uff0c\u4f60\u7684\u4f60\u53ef\u4ee5\u5728 MyPaper app\u7684\u8bbe\u7f6e\u9875\u9762\u4e2d\u4fee\u6539\uff1a<\/p>\n<p dir=\"auto\">\u670d\u52a1\u5668\u5730\u5740\u4e3a\uff1a<code>https:\/\/YourSite.com<\/code><\/p>\n<p dir=\"auto\">\u8bbf\u95ee\u4ee4\u724c\u4e3a\uff1a<code>YourTokens<\/code><\/p>\n<p dir=\"auto\">\u81f3\u6b64\u4eab\u7528 MyPaper \u5427\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u9879\u76ee\u5730\u5740\uff1aMyPaper SERVER SIDE TUTORIAL &nbsp; \u6982\u51b5 &nbsp; server \u7aef\u547d\u4ee4\u884c\u5de5\u5177\uff0c &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"page-archive.php","meta":{"emotion":"","emotion_color":"","title_style":"","license":"","footnotes":""},"class_list":["post-4391","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/10ccc.cc\/index.php?rest_route=\/wp\/v2\/pages\/4391","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/10ccc.cc\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/10ccc.cc\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/10ccc.cc\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/10ccc.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4391"}],"version-history":[{"count":8,"href":"https:\/\/10ccc.cc\/index.php?rest_route=\/wp\/v2\/pages\/4391\/revisions"}],"predecessor-version":[{"id":4836,"href":"https:\/\/10ccc.cc\/index.php?rest_route=\/wp\/v2\/pages\/4391\/revisions\/4836"}],"wp:attachment":[{"href":"https:\/\/10ccc.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4391"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}