如何为我自己的网页,而不是在谷歌计算引擎bitnami节点服务器上默认页 [英] how to serve my own pages and not the default page on bitnami node server on google compute engine

查看:174
本文介绍了如何为我自己的网页,而不是在谷歌计算引擎bitnami节点服务器上默认页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在谷歌计算引擎启动了bitnami节点服务器实例。我上传了我的应用程序文件到虚拟机使用FileZilla的。我的应用程序位于

I started a bitnami node server instance on the google compute engine. I uploaded my application files to the vm using filezilla. My application is located at

/home/bitnami/Rockstar22

我在那里有一个app.js文件,这是我的节点服务器上的文件。我用猫鼬连接到MongoDB实例(在另一个实例在同一项目)。当我ssh到我的实例,并cd进入这个目录,我执行以下命令,就像我会在本地

I have an app.js file in there, that's my node server file. I connect to a mongodb instance (in another instance in the same project) using mongoose. When I ssh into my instance and cd into this directory, I execute the following command, just as I would locally

node app.js

和它显示两个控制台日志(它的运行我的确认)

and it displays two console logs (for my confirmation that it's running)

connected to monog...
Listening on port 3000....

现在我已经买了GoDaddy的域名和我设置的A记录我的实例的外部IP,但它没有提供我想要的页面。相反,它提供的默认页面。

now I already bought a domain on goDaddy and I set the A record to the external IP of my instance but it's not serving the pages I want it to. Instead it's serving the default page.

在这里输入的形象描述

是否有与Apache,我需要执行,使之为我的应用程序页面的一些配置?但约10分钟后,开始显示此错误

Is there some configuration with apache that I need to perform to make it serve my application pages? After about 10 minutes though, it starts displaying this error

在这里输入的形象描述

推荐答案

Bitnami开发商在这里。

Bitnami developer here.

哪个IP是你访问你的应用程序的节点?你应该使用3000端口,除非你配置。
如果您要访问的80端口像Bitnami应用程序会,你可以按照Bitnami维基引导建立一个节点应用与永远和Apache:的 https://wiki.bitnami.com/Applications/Bitnami_Custom_Node.js_Application

Which IP are you accessing for your Node app? You should be using port 3000 unless you configure it. If you want to access port 80 like a Bitnami app would, you can follow the Bitnami wiki guide to set up a node application with Forever and Apache: https://wiki.bitnami.com/Applications/Bitnami_Custom_Node.js_Application

此外,看来你的应用程序使用的外部IP访问MongoDB的。我将其配置为使用127.0.0.1,因为MongoDB的Bitnami组件不默认允许远程连接。
如果你真的想允许远程连接,您可以更改 bind_ip 127.0.0.1 0.0.0.0 ,然后重新启动MongoDB的。你可以阅读更多关于它在这里:<一href=\"https://wiki.bitnami.com/Components/mongoDB#How_to_connect_to_the_MongoDB_database_from_a_different_machine.3f\" rel=\"nofollow\">https://wiki.bitnami.com/Components/mongoDB#How_to_connect_to_the_MongoDB_database_from_a_different_machine.3f

Also, it seems your application is using the external IP to access MongoDB. I would configure it to use 127.0.0.1 since the Bitnami MongoDB component doesn't allow remote connections by default. If you really want to allow remote connections, you can change the bind_ip from 127.0.0.1 to 0.0.0.0, and then restart MongoDB. You can read more about it here: https://wiki.bitnami.com/Components/mongoDB#How_to_connect_to_the_MongoDB_database_from_a_different_machine.3f

这篇关于如何为我自己的网页,而不是在谷歌计算引擎bitnami节点服务器上默认页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆