问题描述
我安装流星(框架)在我的AWS EC2(微)实例和遵循的指示和创建一个测试项目,我追着流星
在该目录给我预期
[[[[[在/ var / www / html等/ meteortest]]]]]
运行在:HTTP://本地主机:3000 /
但我不能浏览到我的服务器的本地主机在我的浏览器看到的Hello World示例项目。有没有一种方法,我可以做出像流星工作:
http://mydomain.com/meteortest/
或
http://mydomain.com/meteortest:3000
这流星设置的根URL的方式是使用所谓的ROOT_URL环境变量:
http://docs.meteor.com/#meteor_absoluteurl
所以,你可以运行你的流星比如像这样:ROOT_URL =http://mydomain.com/流星--port 80
不过,如果你想有一个文件夹中担任流星实例(如 http://mydomain.com/meteortest )你将不得不使用nginx的转发端口(见酪氨酸的例子),但替换该行:
位置/ {
与
位置/ meteortest {
和适当地改变你的ROOT_URL。如果仍然无法从外部访问你的域名,你可能还没有设置安全组正确的EC2。你必须打开的端口上如何做到这一点可以在这里80的更多信息:http://docs.amazonwebservices.com/AWSEC2/latest/UserGuide/using-network-security.html
I'm installing Meteor (framework) on my AWS EC2 (micro) instance and followed the instructions and after creating a test project I ran meteor
on that directory giving me the expected
[[[[[ /var/www/html/meteortest ]]]]]
Running on: http://localhost:3000/
But I can't navigate to my server's localhost in my browser to see the hello world example project. Is there a way I can make meteor work on something like :
http://mydomain.com/meteortest/
or
http://mydomain.com/meteortest:3000
The way that Meteor sets the ROOT URL is by using an environment variable called ROOT_URL:
http://docs.meteor.com/#meteor_absoluteurl
So you could run your Meteor instance like so: ROOT_URL="http://mydomain.com/" meteor --port 80
However, if you want to have the meteor instance served from a folder (like http://mydomain.com/meteortest), you will have to use nginx to forward ports (see Tyr's example) but replace the line:
location / {
with:
location /meteortest {
and change your ROOT_URL appropriately. If you still can't access your domain from outside, you may have not set your security groups properly for EC2. You have to open up port 80. More information on how to do this can be here: http://docs.amazonwebservices.com/AWSEC2/latest/UserGuide/using-network-security.html
这篇关于如何控制流星运行的地方的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!