更多文章项目在线预览项目github地址购买阿里云服务器,选择操作系统,我在云服务器管理控制台选择ubuntu选择实例->更多->>Key->resetinstancepassword(待会儿登录用)选择remoteconnection->VNC,会弹出一个密码,记住,以后远程连接用(ctrl+alt+f1~f6切换终端,比如ctrl+alt+f1是第一个terminal)输入后就是输入root(用户名)的命令行,密码就是你刚才重置的实例密码。登录成功,更新安装源sudoapt-getupdate&&sudoapt-getupgrade-y安装npmsudoapt-getinstallnpminstallnpm管理包sudonpminstall-gn安装node最新稳定版sudonstablectrl+dlog再次in查看版本node-vnpm-vinstallgitsudoapt-getinstallgitcloneprojectgitclonehttps://github.com/woai3c/node-blog.git安装图形界面(这里略过)安装mongodbsudoaptinstall-ymongodb,运行数据库sudomongod如果报错initAndListen:NonExistentPath:Datadirectory/data/dbnotfound.,终止,请执行命令mkdir/data/db/-p,然后重新-运行数据库sudomongod如果报错SocketException:AddressalreadyinuseMONGODB,输入sudokillallmongod关闭所有mongod进程,然后再次运行数据库sudomongod进入项目安装依赖npmipackageprojectnpmrunbuildrun项目npmrunserver监听IP必须为0.0.0.0,详见第19条部署Node.js项目注意事项
