{"id":3887,"date":"2023-02-21T14:50:33","date_gmt":"2023-02-21T06:50:33","guid":{"rendered":"https:\/\/km94.com\/?p=3887"},"modified":"2023-02-21T14:50:33","modified_gmt":"2023-02-21T06:50:33","slug":"hostwinds-vps%e5%ae%89%e8%a3%85%e9%85%8d%e7%bd%aemean-stack%e6%95%99%e7%a8%8b","status":"publish","type":"post","link":"https:\/\/dy208.cn\/index.php\/2023\/02\/21\/hostwinds-vps%e5%ae%89%e8%a3%85%e9%85%8d%e7%bd%aemean-stack%e6%95%99%e7%a8%8b\/","title":{"rendered":"Hostwinds VPS\u5b89\u88c5\u914d\u7f6eMEAN Stack\u6559\u7a0b"},"content":{"rendered":"<p>MEAN Stack\u662f\u4e00\u7ec4\u57fa\u4e8eJavaScript\u6280\u672f\u7684\u4f4e\u6210\u672c\u3001\u5f00\u6e90\u6846\u67b6\uff0c\u5b83\u5141\u8bb8\u521b\u5efa\u548c\u90e8\u7f72\u52a8\u6001Web\u5e94\u7528\u7a0b\u5e8f\uff0c\u8fd9\u91cc\u7684MEAN\u662fMongoDB\u3001Express\u3001Angular.js\u548cNode.js\u7684\u9996\u5b57\u6bcd\u7f29\u5199\u8bcd\u3002\u672c\u6587\u5c06\u4ecb\u7ecd\u4e0b\u5982\u4f55\u5728Hostwinds VPS\u4e0a\u5b89\u88c5\u914d\u7f6eMEAN\u5806\u6808\u3002<\/p>\n<p>MEAN\u5806\u6808\u53ef\u4ee5\u8fd0\u884c\u5728\u57fa\u4e8eWindows\u6216Linux\u7cfb\u7edf\u7684\u56fd\u5185\u670d\u52a1\u5668\u6216\u56fd\u5916\u670d\u52a1\u5668\u4e0a\uff0c\u8fd9\u91cc\u4ee5Hostwinds\u7f8e\u56fdVPS\uff08Linux\uff09\u4e3a\u4f8b\uff0c\u4e0b\u9762\u6765\u770b\u4e0b\u5b89\u88c5MEAN\u5806\u6808\u7684\u64cd\u4f5c\u6b65\u9aa4\u4ecb\u7ecd\u3002<\/p>\n<p>\u9996\u5148\u4f7f\u7528PuTTY\u3001Xshell\u7b49SSH\u5de5\u5177\u767b\u5f55\u5230Hostwinds\u7f8e\u56fdVPS\u4e0a\uff0c\u7136\u540e\u5728\u547d\u4ee4\u884c\u7a97\u53e3\u4f9d\u6b21\u8fd0\u884c\u4e0b\u9762\u547d\u4ee4\uff0c\u5f00\u59cb\u5b89\u88c5MEAN\u5806\u6808\u3002<\/p>\n<p><strong>\u4e00\u3001\u5b89\u88c5Git<\/strong><\/p>\n<pre class=\"wp-block-code\"><code class=\"hljs text\"><span class=\"hljs-selector-tag\">dnf install gcc make git -y<\/code><\/pre>\n<p><strong>\u4e8c\u3001\u5b89\u88c5MongoDB<\/strong><\/p>\n<p>\u521b\u5efaMongoDB repo\u6587\u4ef6<\/p>\n<pre class=\"wp-block-code\"><code class=\"hljs text\"><span class=\"hljs-selector-tag\">nano \/etc\/yum.repos.d\/mongodb-org-4.4.repo<\/code><\/pre>\n<p>\u5c06\u4e0b\u9762\u5185\u5bb9\u6dfb\u52a0\u5230\u6587\u4ef6\u4e2d\u5e76\u4fdd\u5b58<\/p>\n<pre class=\"wp-block-code\"><code class=\"hljs text\"><span class=\"hljs-selector-tag\">[mongodb-org-4.4]<br>\nname=MongoDB Repository<br>\nbaseurl=https:\/\/repo.mongodb.org\/yum\/redhat\/$releasever\/mongodb-org\/4.4\/x86_64\/<br>\ngpgcheck=1<br>\nenabled=1<br>\ngpgkey=https:\/\/www.mongodb.org\/static\/pgp\/server-4.4.asc<\/code><\/pre>\n<p>\u68c0\u67e5\u6587\u4ef6\u662f\u5426\u521b\u5efa\u65e0\u8bef<\/p>\n<pre class=\"wp-block-code\"><code class=\"hljs text\"><span class=\"hljs-selector-tag\">cat \/etc\/yum.repos.d\/mongodb-org-4.4.repo<\/code><\/pre>\n<p>\u5b89\u88c5MongoDB<\/p>\n<pre class=\"wp-block-code\"><code class=\"hljs text\"><span class=\"hljs-selector-tag\">dnf install -y mongodb-org-4.4.6 mongodb-org-server-4.4.6 mongodb-org-shell-4.4.6 mongodb-org-mongos-4.4.6 mongodb-org-tools-4.4.6<\/code><\/pre>\n<p>\u542f\u52a8MongoDB\u5b88\u62a4\u8fdb\u7a0b<\/p>\n<pre class=\"wp-block-code\"><code class=\"hljs text\"><span class=\"hljs-selector-tag\">systemctl start mongod<\/code><\/pre>\n<p>\u663e\u793aMongoDB\u5b88\u62a4\u8fdb\u7a0b\u72b6\u6001<\/p>\n<pre class=\"wp-block-code\"><code class=\"hljs text\"><span class=\"hljs-selector-tag\">systemctl status mongod<\/code><\/pre>\n<p>\u7cfb\u7edf\u542f\u52a8\u65f6\u542f\u7528MongoDB\u670d\u52a1<\/p>\n<pre class=\"wp-block-code\"><code class=\"hljs text\"><span class=\"hljs-selector-tag\">systemctl status mongod<\/code><\/pre>\n<p><strong>\u4e09\u3001\u5b89\u88c5Node.js<\/strong><\/p>\n<p>\u68c0\u67e5\u53ef\u7528\u7684Node.js\u6a21\u5757<\/p>\n<pre class=\"wp-block-code\"><code class=\"hljs text\"><span class=\"hljs-selector-tag\">dnf module list nodejs<\/code><\/pre>\n<p>\u5f00\u59cb\u5b89\u88c5Node.js<\/p>\n<pre class=\"wp-block-code\"><code class=\"hljs text\"><span class=\"hljs-selector-tag\">dnf module install nodejs:14 -y<\/code><\/pre>\n<p>\u68c0\u67e5\u5b89\u88c5\u7684Node.js\u7248\u672c<\/p>\n<pre class=\"wp-block-code\"><code class=\"hljs text\"><span class=\"hljs-selector-tag\">node -v<\/code><\/pre>\n<p>\u68c0\u67e5\u5b89\u88c5\u7684npm\u7248\u672c<\/p>\n<pre class=\"wp-block-code\"><code class=\"hljs text\"><span class=\"hljs-selector-tag\">npm -v<\/code><\/pre>\n<p><strong>\u56db\u3001\u5b89\u88c5Angular CLI<\/strong><\/p>\n<pre class=\"wp-block-code\"><code class=\"hljs text\"><span class=\"hljs-selector-tag\">npm install -g @angular\/cli<\/code><\/pre>\n<p><strong>\u4e94\u3001\u5b89\u88c5Mean Stack<\/strong><\/p>\n<p>\u514b\u9686Mean Stack\u6838\u5fc3<\/p>\n<pre class=\"wp-block-code\"><code class=\"hljs text\"><span class=\"hljs-selector-tag\">git clone https:\/\/github.com\/mrdav30\/MEANcore.git meancore<br>\ncd meancore<br>\nnpm install<\/code><\/pre>\n<p>\u521b\u5efa\u6587\u4ef6<\/p>\n<pre class=\"wp-block-code\"><code class=\"hljs text\"><span class=\"hljs-selector-tag\">nano .env<\/code><\/pre>\n<p>\u5e76\u5c06\u4e0b\u9762\u5185\u5bb9\u6dfb\u52a0\u5230\u6587\u4ef6\u4e2d<\/p>\n<pre class=\"wp-block-code\"><code class=\"hljs text\"><span class=\"hljs-selector-tag\">NODE_ENV=&#8217;development&#8217;<br>\nPRODUCTION=false<br>\nDOMAIN=<br>\nDOMAIN_PATTERN=<br>\nHOST_SECURE=<br>\nPROXY=<br>\nAPP_NAME=&#8217;meancore&#8217;<br>\nAPP_BASE_URL=&#8217;\/&#8217;<br>\nAPI_BASE_URL=&#8217;api&#8217;<br>\nAPP_DEFAULT_ROUTE=&#8217;home&#8217;<br>\nIMAGE_UPLOAD_URL=&#8217;\/admin\/upload&#8217;<br>\nTWITTER_HANDLE=<br>\nSESSION_SECRET=&#8217;MEANCORE&#8217;<br>\nSESSION_KEY=&#8217;meancore-key&#8217;<br>\nSESSION_COLLECTION=&#8217;meancore-sessions&#8217;<br>\nGOOGLE_ANALYTICS_ID=&#8221;<br>\nGOOGLE_CLIENT_EMAIL=&#8221;<br>\nGOOGLE_PRIVATE_KEY=&#8221;&#8221;<br>\nGOOGLE_VIEW_ID=<br>\nRECAPTCHA_SECRET_KEY=&#8221;<br>\nRECAPTCHA_SITE_KEY=&#8221;<br>\nMAILER_FROM=&#8217;support@meancore.com&#8217;<br>\nMAILER_SERVICE_PROVIDER=<br>\nMAILER_HOST=&#8217;smtp.ethereal.email&#8217;<br>\nMAILER_PORT=587<br>\nMAILER_USER=&#8221;username&#8221;<br>\nMAILER_SECRET=&#8221;pass&#8221;<br>\nMAILER_TEST=true<\/code><\/pre>\n<p>\u8fd0\u884c\u5e94\u7528\u7a0b\u5e8f<\/p>\n<pre class=\"wp-block-code\"><code class=\"hljs text\"><span class=\"hljs-selector-tag\">npm run start:dev<\/code><\/pre>\n<p>\u6700\u540e\uff0c\u901a\u8fc7\u6d4f\u89c8\u5668\u8bbf\u95ee\uff1a{yourip}:3000\uff0c\u4ee5\u68c0\u67e5\u8be5\u7a0b\u5e8f\u662f\u5426\u6b63\u786e\u5b89\u88c5\uff0c\u8fd9\u91cc\u7684IP\u586b\u5199\u7684\u662fHostwinds\u7f8e\u56fdVPS\u5b9e\u9645IP\u5730\u5740\u3002<\/p>\n<p>\n\t<figure class=\"wp-block-image size-full\"><img decoding=\"async\" class=\"wp-image-3889\" alt=\"Hostwinds VPS\u5b89\u88c5\u914d\u7f6eMEAN Stack\u6559\u7a0b\" src=\"https:\/\/km94.com\/wp-content\/uploads\/2023\/02\/mean.jpg\"><\/figure>\n\t<\/p>\n\n<div>\n<div>\n\n\n\n<\/div>\n<div>\n\n\n\n<\/div>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>MEAN Stack\u662f\u4e00\u7ec4\u57fa\u4e8eJavaScript\u6280\u672f\u7684\u4f4e\u6210\u672c\u3001\u5f00\u6e90\u6846\u67b6\uff0c\u5b83\u5141\u8bb8\u521b\u5efa\u548c\u90e8\u7f72\u52a8\u6001Web\u5e94\u7528\u7a0b\u5e8f\uff0c&hellip;<\/p>\n","protected":false},"author":1,"featured_media":3888,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[29,2],"tags":[],"class_list":["post-3887","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-zjjc","category-jc","entry"],"_links":{"self":[{"href":"https:\/\/dy208.cn\/index.php\/wp-json\/wp\/v2\/posts\/3887","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dy208.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dy208.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dy208.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dy208.cn\/index.php\/wp-json\/wp\/v2\/comments?post=3887"}],"version-history":[{"count":0,"href":"https:\/\/dy208.cn\/index.php\/wp-json\/wp\/v2\/posts\/3887\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dy208.cn\/index.php\/wp-json\/"}],"wp:attachment":[{"href":"https:\/\/dy208.cn\/index.php\/wp-json\/wp\/v2\/media?parent=3887"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dy208.cn\/index.php\/wp-json\/wp\/v2\/categories?post=3887"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dy208.cn\/index.php\/wp-json\/wp\/v2\/tags?post=3887"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}