I am new to Meteor. I am trying to deploy the Meteor Server to OpenShift, but am struggling to understand what I need to do. Any help will be appreciated.
I think I have deployed it, but not sure how to access the server, or to get a mobile app to access the server.
At a minimum you’ll need to know the ip address (or domain if you have registered one) of your server on OpenShift. You can then set your mobile app to access it.
What’s your mobile app? Is it the same meteor project and you added android or ios with meteor add-platform ios etc?
The domain is nodejs-easyjobs.rhcloud.com (54.208.77.250) on the OpenShift server, I can ping this successfully.
I am using Ionic 2 to build the mobile app. I am currently just running on Android, but plan to add iOS and Windows.
I am following this tutorial, and it runs on localhost. However, I am not sure where this is configured. I guess localhost is default, and you need to change it to a different host if needs be.
If I check my OpenShift server (nodejs-easyjobs.rhcloud.com) via ssh, I can see that the contents of the Meteorbundle directory is on the server. So Git is pushing the code.
The part I don’t understand is:
Do I need to configure Meteor differently for being on the OpenShift Server? Or do I just leave it as is?
Where do I configure the client (Ionic 2) to point to the OpenShift server?
There’s a -server argument to meteor build. Which also should work with meteor run in case you are using the android or iOS build targets. I haven’t used it in a year and I’d scripted it but I can see if I can dig it out if you can’t work it out.
Try meteor help build to see if it gives you the arguments. I’m on my phone but will have a look later.
Edit: also I haven’t done anything with ionic but if it’s just a front end library and it’s all just the one meteor app (server and phone build) then I think the above is the way to do it.
Can you just confirm whether that’s just a package or script you add to the same meteor project that has your server code or a completely separate project?
The contents of the.../ionic-apps/nodejs is cloned on the OpenShift server with Git.
I followed this tutorial to deploy the Meteor bundle to OpenShift. `
So I used the following to build my Meteor app:
> cd .../ionic-aps/myIonicApp/
> meteor build .../ionic-apps/nodejs --directory --server-only
As far as I can see, I may be wrong, but the Meteor Server is all correct and running on OpenShift. I need to know how I can get my Ionic2 app to access it.
Step1: Find the access point to the Meteor server using the OpenShift IP nodejs-easyjobs.rhcloud.com (54.208.77.250).
Yeah okay, sorry ionic is outside of my experience.
I don’t think the server build part is the issue though. You need to point your mobile app to the server which was why I was asking if the mobile app is also a meteor project and the same meteor project. If it isn’t then that -server flag isn’t going to be relevant.
I really know nothing about the OpenShift but typically no. A traditional web app will use something like nginx to route any requests for the domain to the appropriate port that meteor is running on. Only port 80 or 443 (ssl) need to be open to the world.
I’m assuming OpenShift start meteor for you. That’s pretty much the impression I’m left with from reading the guide you linked - ie it should specify if you have to start meteor and usually that would involve configuring some sort of start up script and not manually from a command line.
I know you said that it won’t be accessible on port 3000, but the Ionic App I have is trying to access it on http://mynodeapp-easyjobs.rhcloud.com:3000. (I changed it from the default http://localhost:3000 which works).
Question
However, I am not sure how to test if Meteor is running. How do I check if it is running?
I’m using this which shows success (on port 80) when I connect to a couple of different meteor servers that I’ve got running.
It needs to be run with Chrome in insecure mode due to the Cross-Origin requests (on my linux machine I start it with google-chrome --args --disable-web-security --user-data-dir)
I can’t get it to connect to your server no matter what port I try. However I can now get to your server via the url in the browser. It has a link to this page which says the DDP url is http://mynodeapp-easyjobs.rhcloud.com:8000.
It’s 2am here and I’ve got a big day with work in the morning so I’ll probably be offline for the next 36 hours.