Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Well, if you just ignore SSL for now (or want to figure out SSL for yourself later on), the below guide should work:</p> <h3>The basic idea</h3> <p>.. is to spawn multiple instances of the same application with different databases (mongo, the usual case) depending on the base URL. </p> <p>We are going to use the following settings for the virtual hosts:</p> <ul> <li><em>Site #1 : <code>www.example1.com</code></em> <ul> <li>Meteor port: <code>3000</code></li> <li>MongoDB endpoint/url: <code>mongodb://localhost:27017/example1</code></li> </ul></li> <li><em>Site #2 : <code>www.example2.com</code></em> <ul> <li>Meteor port: <code>3001</code></li> <li>MongoDB endpoint/url: <code>mongodb://localhost:27017/example2</code></li> </ul></li> </ul> <h3>Preparing the <code>meteor</code> instances</h3> <ol> <li><p>Install <code>foreman</code> via <code>rubygems</code>:</p></li> <li><p>Create a <code>foreman</code> <code>Procfile</code> file in your meteor project directory. Using the data above (don't include the bullets :D):</p> <ul> <li><code>web1: ROOT_URL=http://www.example1.com/ PORT=3000 MONGO_URL=mongodb://localhost:27017/example1 meteor</code></li> <li><code>web2: ROOT_URL=http://www.example.com/ PORT=3001 MONGO_URL=mongodb://localhost:27017/example2 meteor</code></li> </ul></li> <li><p>-OR- if you use the <code>meteor bundle</code> version:</p> <ul> <li><code>web1: ROOT_URL=http://www.example1.com/ PORT=3000 MONGO_URL=mongodb://localhost:27017/example1 node bundle/main.js</code></li> <li><code>web2: ROOT_URL=http://www.example2.com/ PORT=3001 MONGO_URL=mongodb://localhost:27017/example2 node bundle/main.js</code></li> </ul></li> <li><p>You can then run <code>foreman start</code> directly on the same directory (add a <code>&amp;</code> at the end to send to background). or you could install it as a service / upstart script via <code>foreman export</code> (this may vary for other linux distros, please refer to Foreman docs : <a href="http://ddollar.github.io/foreman/" rel="nofollow noreferrer">http://ddollar.github.io/foreman/</a>‎ ):</p> <ul> <li><code>sudo foreman export --app meteors --user &lt;meteor files owner&gt; upstart /etc/init</code></li> </ul></li> </ol> <h3>Preparing nginx</h3> <p>From here on out, the configuration for nginx should now be pretty straightforward:</p> <pre><code>server { listen 80; server_name www.example1.com example1.com; location / { proxy_pass http://localhost:3000; proxy_set_header X-Real-IP $remote_addr; } } server { listen 80; server_name www.example2.com example2.com; location / { proxy_pass http://localhost:3001; proxy_set_header X-Real-IP $remote_addr; } } </code></pre> <p>Let me know if this works for you, although you mentioned that you already used SilkJS instead, I'll just leave this here for anyone else that's interested on the solution.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload