{"id":266879,"date":"2023-03-11T14:15:56","date_gmt":"2023-03-11T06:15:56","guid":{"rendered":"https:\/\/lrxjmw.cn\/wbbdmazhsym.html"},"modified":"2023-03-11T14:15:56","modified_gmt":"2023-03-11T06:15:56","slug":"wbbdmazhsym","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/wbbdmazhsym.html","title":{"rendered":"Windows\u7248\u672c\u7684Mongoose\u5b89\u88c5\u548c\u4f7f\u7528\u2014\u2014Mongoose"},"content":{"rendered":"

\u672c\u6587\u4e3b\u8981\u5185\u5bb9\u5982\u4e0b\uff1a<\/p>\n

1\u3001Mongoose\u4ecb\u7ecd<\/p>\n

Mongoose\u5f00\u6e90\u9879\u76ee\u7684\u4e3b\u9875\u662f\u3002Mongoose\u662f\u4e00\u4e2aweb\u670d\u52a1\u5668\uff0c\u901a\u8fc7\u63d0\u4f9b\u4e00\u4e2aweb\u63d2\u53e3\u7ed9\u5b83\uff0c\u5b83\u53ef\u4ee5\u5d4c\u5165\u5230\u73b0\u6709\u7684\u5e94\u7528\u7a0b\u5e8f\u4e2d\u53bb\u3002Mongooseweb\u670d\u52a1\u5668\u7684\u6267\u884c\u662f\u81ea\u6ee1\u8db3\u7684\uff0c\u5b83\u4e0d\u4f9d\u8d56\u4e8e\u4efb\u4f55\u5176\u4ed6\u670d\u52a1\u3002\u5047\u5982\u4f60\u5c06\u5b83\u590d\u5236\u5230\u4efb\u4f55\u76ee\u5f55\u5e76\u6267\u884c\uff0c\u5b83\u5c06\u5c06\u542f\u52a8web\u670d\u52a1\u5e76\u5c06\u5f53\u524d\u76ee\u5f55\u4f5c\u4e3a\u4e3b\u76ee\u5f55\u3001\u7aef\u6807\u8bed\u662f8080\u3002\u5176\u5b9e\u8fd9\u79cd\u914d\u7f6e\u9009\u9879\u90fd\u53ef\u4ee5\u901a\u8fc7\u914d\u7f6e\u6587\u4ef6mongoose.conf\u8bbe\u7f6e\u3002<\/p>\n

Mongoose\u5b83\u7684\u524d\u8eab\u662fshttpd\uff0c\u5b83\u5b8c\u5168\u5f00\u6e90\u548c\u81ea\u7531\u4f7f\u7528\u3002\u5b83\u8fd8\u5177\u6709\u5982\u4e0b\u7279\u70b9\uff1a<\/p>\n

2\u3001Mongoose\u7684\u7f16\u8bd1\u548c\u4f7f\u7528<\/p>\n

\u5173\u4e8eMongoose\u91cc\u9762\u5e94\u5f53\u65e9\u5df2\u4ecb\u7ecd\u4e86\u5b83\u7684\u4e3b\u8981\u7279\u70b9\u3002\u6240\u8c13\u8033\u542c\u4e3a\u865a\u5728linux\u4e0b\u7531o\u6587\u4ef6\u7f16\u8bd1\u751f\u6210cgi\u6587\u4ef6<\/strong>\uff0c\u773c\u89c1\u4e3a\u5b9e\uff0c\u4e0d\u8fc7\u5982\u4eca\u8fd9\u4e2a\u65f6\u4ee3\u773c\u89c1\u4e5f\u672a\u5fc5\u4e3a\u5b9e\uff0c\u6b63\u6240\u8c13\u5b9e\u8df5\u89c1\u771f\u77e5\uff0c\u4e0b\u8fb9\u8fd8\u662f\u6765\u4eb2\u8eab\u4f53\u9a8c\u4e0b\u3002Windows\u7248\u672c\u7684Mongoose\u5b89\u88c5\u548c\u4f7f\u7528\uff0c\u6211\u5c31\u4e0d\u4ecb\u7ecd\u4e86\uff0c\u4f17\u6240\u5468\u77e5Windows\u4e0b\u8fb9\u7684\u8f6f\u4ef6\u7684\u5b89\u88c5\u57fa\u672c\u90fd\u662f\u50bb\u86cb\u5f0f\u7684\u3002\u4e0b\u8fb9\u6211\u4ecb\u7ecd\u7684\u662flinux\u4e0bmongoose\u7684\u7f16\u8bd1\u548c\u4f7f\u7528\uff08\u6211\u4f7f\u7528\u7684linux\u662fUbuntu10.04\uff09\u3002<\/p>\n

\u9996\u5148\u53bb\u4e3b\u9875\u91cc\u9762\u4e0b\u8f7dMongoose\u7684\u6e90\u7801\uff08mongoose-2.8.tgz\uff09\u3002\u5c06\u5176\u89e3\u538b\u53ef\u4ee5\u89c1\u5230\u5982\u4e0b\u7684\u6587\u4ef6\u5217\u8868\uff1a<\/p>\n

\u56fe1\u3001mongoose\u6e90\u7801\u7684\u6587\u4ef6\u5217\u8868<\/p>\n

linux cgi\u6587\u4ef6_linux \u7f16\u8bd1\u751f\u6210so\u6587\u4ef6_\u5728linux\u4e0b\u7531o\u6587\u4ef6\u7f16\u8bd1\u751f\u6210cgi\u6587\u4ef6<\/p>\n

\u867d\u7136\u6211\u4eec\u4e3b\u8981\u7528\u5230\u7684\u5c31\u662fmongoose.h\/c\u6587\u4ef6\uff0c\u50cfmain.c\u6587\u4ef6\u53ea\u662f\u62ff\u6765\u6d4b\u8bd5\u7528\u7684\u3002\u5047\u5982\u4f60\u60f3\u5c06mongoose\u5d4c\u5165\u5230\u4f60\u7684\u9879\u76ee\u4e2d\uff0c\u4e3b\u987b\u8981\u7528\u5230mongoose.h\/c\u5c31ok\u4e86\uff01\u5e76\u4e14\u4e4b\u540e\u4e3b\u8981\u7684\u5206\u6790\u5de5\u4f5c\u5c31\u662f\u7f6e\u4e8emongoose.h\/c\u4e0a\u3002\u5176\u4e2d\u7684Makefile\u6587\u4ef6\u662f\u7528\u4e8e\u7f16\u8bd1\uff0c\u751f\u6210\u53ef\u6267\u884c\u6587\u4ef6\u548c\u5e93\u6587\u4ef6\u7b49\u3002<\/p>\n

\u7528makelinux\u547d\u4ee4<\/a>\u5c31\u53ef\u4ee5\u5c06\u6e90\u7801\u7f16\u8bd1\u4e3alinux\u7248\u672c\u7684mongoose\u7ea2\u65d7linux\u64cd\u4f5c\u7cfb\u7edf\uff0c\u5982\u53f3\u56fe\u6240\u793a\uff1a<\/p>\n

\u56fe2\u3001linux\u4e0b\u8fb9Mongoose\u7684\u7f16\u8bd1\u548c\u6267\u884c<\/p>\n

\u5982\u4e0a\u56fe\uff0c\u5f53\u6211\u4eec\u8f93\u5165make\u547d\u4ee4\u7684\u65f6\u4faf\uff0c\u4f1a\u63d0\u793a\u4f60\u5e26\u76f8\u5e94\u73af\u5883\u7684\u53c2\u6570make(linux|bsd|solaris|mac|windows|mingw)\u5728linux\u4e0b\u7531o\u6587\u4ef6\u7f16\u8bd1\u751f\u6210cgi\u6587\u4ef6<\/strong>\uff0c\u8fd9\u513f\u6211\u4eec\u9009\u62e9linux\u3002\u7f16\u8bd1\u5b8c\u4ee5\u540e\uff0c\u751f\u6210\u4e86\u4e24\u4e2a\u6587\u4ef6\uff1a\u4e00\u4e2a\u53ef\u6267\u884c\u6587\u4ef6mongoose\u3001\u4e00\u4e2a\u5e93\u6587\u4ef6_mongoose.so\u3002\u4f60\u53ef\u4ee5\u76f4\u63a5\u5c06_mongoose.so\u5e93\u6587\u4ef6\u9886\u5230\u4f60\u7684\u9879\u76ee\u4e2d\u53bb\u4f7f\u7528\uff08\u5176\u5b9e\u662f\u57fa\u4e8elinux\u73af\u5883\u7684\u9879\u76ee\uff0c\u5047\u5982\u5728Windows\u73af\u5883\u4e0b\u662f\u7f16\u8bd1\u51fa\u76f8\u5e94\u7684dll\u6587\u4ef6\uff0c\u53bb\u76f4\u63a5\u4f7f\u7528\uff09\u3002<\/p>\n

\u4ece\u4e0a\u56fe\u53ef\u4ee5\u770b\u51fa\uff0c\u7f16\u8bd1\u5b8c\u4ee5\u540e\u6211\u4eec\u8fd0\u884c\u4e86\uff08.\/mongoose\uff09\uff0c\u89c1\u5230Mongoose2.8startedonport(s)[8080],servingdirectory[\/home\/netsky\/Downloads\/mongoose]\u3002\u5373\u5982\u4eca\u5c31\u542f\u52a8\u4e86webserver\uff0c\u5f53\u524d\u5de5\u4f5c\u76ee\u5f55\u662f\/home\/netsky\/Downsloads\/mongoose\u7ea2\u65d7linux\u684c\u9762\u7248\uff0c\u7aef\u6807\u8bed\u662f8080\u3002\u6211\u4eec\u53ef\u4ee5\u5728\u6d4f\u89c8\u5668\u4e2d\u8f93\u5165\u6765\u8bbf\u95eeweb\u670d\u52a1\u5668\uff08\u6216\u5219\u5047\u5982\u4f60\u8ddf\u6211\u4e00\u6837\u662f\u5728Ubuntu\u662f\u8fd0\u884c\u5728\u865a\u62df\u673a\u4e2d\uff0c\u4f60\u53ef\u4ee5\u5728\u5916\u8fb9\u7684Windows\u7cfb\u7edf<\/a>\u4e2d\u7528\u6d4f\u89c8\u901a\u8fc7\u7684ip:8080\/\u6765\u8bbf\u95ee\uff09\uff0c\u5982\u53f3\u56fe\u6240\u793a\uff1a<\/p>\n

\u5728linux\u4e0b\u7531o\u6587\u4ef6\u7f16\u8bd1\u751f\u6210cgi\u6587\u4ef6_linux \u7f16\u8bd1\u751f\u6210so\u6587\u4ef6_linux cgi\u6587\u4ef6<\/p>\n

\u56fe3\u3001\u8bbf\u95eemongoose\u5f00\u542f\u7684web\u670d\u52a1<\/p>\n

\u6211\u4eec\u67e5\u770bmongoose\u6253\u4e0b\u6765\u7684log\uff0c\u5982\u53f3\u56fe\uff1a<\/p>\n

\u56fe4\u3001mongoose\u590d\u5370\u7684log<\/p>\n

\u4ecelog\u53ef\u4ee5\u770b\u51fa\u6709\u4e24\u4e2aclient\uff0c\u4e00\u4e2a\u662f\u6211\u521a\u521a\u5728linux\u4e0a\u9762\u901a\u8fc7\u6d4f\u89c8\u5668\u6253\u5f00web\u670d\u52a1\u7684\u6839\u76ee\u5f55\uff1b\u53e6\u4e00\u4e2a\u662f\u6211\u5728Windows\u4e0b\u8fb9\u901a\u8fc7\u6d4f\u89c8\u5668\u6253\u5f00web\u670d\u52a1\u7684\u6839\u76ee\u5f55\u3002<\/p>\n

3\u3001Makefile\u7684\u7b80\u5355\u5256\u6790<\/p>\n

\u4e0b\u8fb9\u6211\u4eec\u7b80\u5355\u5256\u6790\u4e00\u4e0bMakefile\u6587\u4ef6\uff0c\u770b\u6211\u4eec\u6267\u884cmakelinux\u7684\u65f6\u4faf\uff0c\u7f16\u8bd1\u4e86\u54ea\u4e9b\u6e90\u6587\u4ef6\uff0c\u53ca\u7f16\u8bd1\u7684\u4e00\u4e9b\u9009\u9879\u3002<\/p>\n

\u4ecePROG=mongoose\u548cLIB=_$(PROG).so\u53ef\u4ee5\u6653\u5f97\u7f16\u8bd1\u751f\u6210\u7684\u6267\u884c\u6587\u4ef6\u540d\u548c\u5e93\u7684\u540d\u5b50\uff1b<\/p>\n

\u4ecelinux:<\/p>\n

$(CC)$(LINFLAGS)mongoose.c-shared-fPIC-fpic-s-o$(LIB)<\/p>\n

$(CC)$(LINFLAGS)mongoose.cmain.c-s-o$(PROG)<\/p>\n

\u6211\u4eec\u6653\u5f97\uff0c\u5728linux\u4e0b\u8fb9\u7f16\u8bd1\u7528\u5230\u4e86\u4ec0\u4e48\u6e90\u6587\u4ef6\uff1a\u7f16\u8bd1\u5e93\u6587\u4ef6_mongoose.so\u65f6\u4ec5\u7528\u5230\u4e86mongoose.c\u6587\u4ef6\uff0c\u7f16\u8bd1\u53ef\u6267\u884c\u6587\u4ef6\u65f6\u4e0d\u4ec5mongoose.c\u6587\u4ef6\u8fd8\u7528\u5230\u4e86main.c\u3002\u6ce8\u610f\u91cc\u9762\u7684\u53d8\u91cf$(LINFLAGS)\uff0c\u5373\u7f16\u8bd1\u65f6\u7684\u9009\u9879\u4e3a\uff1a<\/p>\n

\u5176\u4e2d$(COPT)\u9009\u9879\u662f\u6211\u4eecmake\u7684\u65f6\u4faf\u8ddf\u7684\u4e00\u4e9b\u9009\u9879\uff0c\u4e0b\u8fb9\u5217\u4e3e\u90a3\u4e9b\u9009\u9879\u53ca\u5176\u610f\u4e49\uff1a<\/p>\n

all:<\/p>\n

@echo\"make(linux|bsd|solaris|mac|windows|mingw)\"<\/p>\n

#PossibleCOPTvalues:(inbracketsareroughnumbersfor'gcc-O2'oni386)<\/p>\n

#-DHAVE_MD5-usesystemmd5library(-2kb)<\/p>\n

#-DNDEBUG-stripoffalldebugcode(-5kb)<\/p>\n

#-DDEBUG-builddebugversion(verynoisy)(+7kb)<\/p>\n

#-DNO_CGI-disableCGIsupport(-5kb)<\/p>\n

linux cgi\u6587\u4ef6_linux \u7f16\u8bd1\u751f\u6210so\u6587\u4ef6_\u5728linux\u4e0b\u7531o\u6587\u4ef6\u7f16\u8bd1\u751f\u6210cgi\u6587\u4ef6<\/p>\n

#-DNO_SSL-disableSSLfunctionality(-2kb)<\/p>\n

#-DCONFIG_FILE=\"file\"-use`file'asthedefaultconfigfile<\/p>\n

#-DNO_SSI-disableSSIsupport(-4kb)<\/p>\n

#-DHAVE_STRTOUI64-usesystemstrtoui64()functionforstrtoull()<\/p>\n

Makefile\u5c31\u7b80\u5355\u7684\u5256\u6790\u5230\u8fd9\u4e86\uff0c\u5982\u4eca\u5e94\u5f53\u6bd4\u8f83\u6e05\u695a\u53ef\u6267\u884c\u6587\u4ef6\u53ca\u5e93\u662f\u5982\u4f55\u751f\u6210\u7684\u4e86\u3002\uff08\u63d0\u793a\uff1aWindows\u4e0b\u8fb9\u7684\u7f16\u8bd1\uff0cMakefile\u6587\u4ef6\u4e2d\u4e5f\u65e9\u5df2\u7ed9\u51fa\u4e86\uff0c\u8bf7\u67e5\u770bMakefile\u6587\u7684\u540e\u534a\u90e8\u4efd\u3002\uff09<\/p>\n

4\u3001\u5982\u4f55\u5c06Mongoose\u5d4c\u5165\u5230\u5e94\u7528\u7a0b\u5e8f\u4e2d<\/p>\n

\u76ee\u524dMongoose\u53ef\u4ee5\u652f\u6301\u5d4c\u5165\u5230C\/C++\u3001Python\u3001C#\uff0c\u5e76\u4e14\u5728\u4e0b\u4e00\u4e2a\u7248\u672c\uff082.9\uff09\u5c06\u652f\u6301Ruby\u3001Lua\u3002\u4f46\u5728\u8fd9\u513f\u6211\u53ea\u4ecb\u7ecd\u5982\u4f55\u6837\u5c06Mongoose\u5d4c\u5165\u5230C\/C++\u4e2d\u3002\u4f3c\u4e4e\u5c06Mongoose\u5d4c\u5165\u5230C\/C++\u5e94\u7528\u7a0b\u5e8f\u4e2d\u5f88\u7b80\u5355\uff0c\u7531\u4e8eMongoose\u539f\u672c\u5c31\u662f\u7528C\u7f16\u64b0\u7684\uff0c\u56e0\u800c\u53ef\u4ee5\u5341\u5206\u7b80\u5355\u7684\u5c06\u5b83\u5d4c\u5165\u5230\u4f60\u7684\u5e94\u7528\u7a0b\u5e8f\u4e2d\u3002<\/p>\n

\u5173\u4e8e\u600e\u4e48\u7f16\u64b0\u7c7b\u4f3cmain.c\u4ee3\u7801\u8c03\u7528mongoose\u63d0\u4f9b\u7684\u63d2\u53e3\uff0c\u8fd9\u4e2a\u5de5\u4f5c\u5728\u672c\u7cfb\u5217\u65c1\u8fb9\u7684\u6587\u7ae0\u4e2d\u4ecb\u7ecd\u3002<\/p>\n

\u81f3\u6b64\uff0c\u5c06Mongoose\u5d4c\u5165\u5230\u4f60\u7684C\/C++\u5e94\u7528\u7a0b\u5e8f\u4e2d\u7684\u5de5\u4f5c\u65e9\u5df2\u5b8c\u6210\uff0c\u5982\u4eca\u4f60\u6267\u884c.\/test\u5373\u53ef\u4ee5\u5e94\u7528\u4f60\u7684\u5e94\u7528\u7a0b\u5e8f\uff0c\u5b83\u8c03\u7528\u5230\u4e86mongoose\u63d0\u4f9b\u7684\u4e00\u4e9b\u63d2\u53e3\u3002<\/p>\n

\u4e00\u822c\u524d\u9762\u7684\u4ecb\u7ecd\uff0c\u662f\u4e0d\u662f\u8ba4\u4e3a\u5728\u5e94\u7528\u7a0b\u5e8f\u5d4c\u5165Mongoose\u5f88\u7b80\u5355\u5462\uff01\u662f\u7684\u5c31\u662f\u5982\u6b64\u7b80\u5355\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u5176\u4e2d\u7684Makefile\u6587\u4ef6\u662f\u7528\u4e8e\u7f16\u8bd1\uff0c\u751f\u6210\u53ef\u6267\u884c\u6587\u4ef6\u548c\u5e93\u6587\u4ef6\u7b49\u3002\u56fe2\u3001linux\u4e0b\u9762Mongoose\u7684\u7f16\u8bd1\u548c\u6267\u884cso\u5e93\u6587\u4ef6\u62ff\u5230\u4f60\u7684\u9879\u76ee\u4e2d\u53bb\u4f7f\u7528\uff08\u5f53\u7136\u662f\u57fa\u4e8elinux\u73af\u5883\u7684\u9879\u76ee\uff0c\u5982\u679c\u5728Windows\u73af\u5883\u4e0b\u662f\u7f16\u8bd1\u51fa\u76f8\u5e94\u7684dll\u6587\u4ef6\uff0c\u53bb\u76f4\u63a5\u4f7f\u7528\uff09\u3002linux\u7684\u65f6\u5019\uff0c\u7f16\u8bd1\u4e86\u4ec0\u4e48\u6e90\u6587\u4ef6\uff0c\u53ca\u7f16\u8bd1\u7684\u4e00\u4e9b\u9009\u9879\u3002\u6211\u4eec\u77e5\u9053\uff0c\u5728linux\u4e0b\u9762\u7f16\u8bd1\u7528\u5230\u4e86\u54ea\u4e9b\u6e90\u6587\u4ef6\uff1a\u7f16\u8bd1\u5e93\u6587\u4ef6_mongoose.<\/p>\n","protected":false},"author":1,"featured_media":266880,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[988],"tags":[999],"class_list":["post-266879","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tougao","tag-999"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/266879","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=266879"}],"version-history":[{"count":0,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/266879\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/266880"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=266879"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=266879"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=266879"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}