wmluke / dokku-domains-plugin

Dokku plugin to create nginx vhost with multiple domains
MIT License
176 stars 21 forks source link

Two domains lead to same app #12

Closed kpennell closed 9 years ago

kpennell commented 10 years ago

Hello. I'm a newbie with a problem. I truly believe I followed the dokku and domains-plugin instructions right. I think I'm just missing something on assigning to domains. Perhaps with a port.

I deployed two sample Node apps and they seem to have launched fine.

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 9947b492c768 dokku/noderest:latest /bin/bash -c '/start 4 seconds ago Up 4 seconds 0.0.0.0:49154->5000/tcp sharp_ptolemy c466d368aa02 ac37d44feb0a /build/builder 30 seconds ago Exited (0) 6 seconds ago loving_mcclintock eb0753770011 progrium/buildstep:latest /bin/bash -c 'mkdir 30 seconds ago Exited (0) 30 seconds ago silly_bohr 12e3d5ee5efc dokku/nodesamp:latest /bin/bash -c '/start 3 minutes ago Up 3 minutes 0.0.0.0:49153->5000/tcp jolly_torvalds

When I go to myip:49153 or myip:49154, the apps are working there fine.

So then I followed the instructions for doing the domains:

` root@kyledokku:~# dokku domains:set nodesamp www.ahalearning.co -----> Creating /home/dokku/nodesamp/DOMAINS

`

And both those seemed to work fine.

So when I go docker ps -a , here's what I see:

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 9947b492c768 dokku/noderest:latest /bin/bash -c '/start 9 minutes ago Up 9 minutes 0.0.0.0:49154->5000/tcp sharp_ptolemy c466d368aa02 ac37d44feb0a /build/builder 10 minutes ago Exited (0) 10 minutes ago loving_mcclintock eb0753770011 progrium/buildstep:latest /bin/bash -c 'mkdir 10 minutes ago Exited (0) 10 minutes ago silly_bohr 12e3d5ee5efc dokku/nodesamp:latest /bin/bash -c '/start 13 minutes ago Up 13 minutes 0.0.0.0:49153->5000/tcp jolly_torvalds

When I go to either of those domains, they both go to the app that was deployed second. I'm seeing that >5000...does that mean they are both going to port 5000? Is that where I'm going wrong?

Any other ideas on where to look or what to try?

kpennell commented 10 years ago

Also, do my apps all need to be within /home/dokku ? for it to work?

kpennell commented 10 years ago

Do I make separate VHOST files for each app?

wmluke commented 10 years ago

Hi @kpennell,

Yes, this plugin assumes that all dokku apps reside within /home/dokku/$APP_NAME. Were are your apps?

kpennell commented 10 years ago

My bad, Luke. I missed that somehow in this tut and the main dokku page. I'll try again.

On Tue, May 20, 2014 at 7:27 PM, Luke Bunselmeyer notifications@github.comwrote:

Hi @kpennell https://github.com/kpennell,

Yes, this plugin assumes that all dokku apps reside within /home/dokku/$APP_NAME. Were are your apps?

— Reply to this email directly or view it on GitHubhttps://github.com/wmluke/dokku-domains-plugin/issues/12#issuecomment-43699836 .

kpennell commented 10 years ago

Hi @wmluke , I redid the VPS on a new droplet with the same apps. I'm still getting both pointing to one app. This is how my files look. nodesamp and noderest are each apps. They run fine when I go to myip:port for each of them. But the domains don't line up right. Anything obvious missing?

└── dokku ├── AUTHORS ├── bootstrap.sh ├── contrib │   └── dokku-installer.rb ├── docs │   ├── advanced-installation.md │   └── index.md ├── dokku ├── dokku.1 ├── HISTORY.md ├── LICENSE ├── Makefile ├── noderest │   ├── app.js │   ├── bin │   ├── package.json │   ├── public │   ├── README.md │   ├── routes │   └── views ├── nodesamp │   ├── app.json │   ├── index.js │   ├── package.json │   ├── public │   └── README.md ├── plugins │   ├── 00_dokku-standard │   ├── backup │   ├── config │   ├── git │   ├── nginx-vhosts │   └── WARNING ├── README.md ├── tests │   ├── apps │   ├── ci │   ├── run_ec2 │   ├── run_vagrant │   └── test_deploy └── Vagrantfile

kpennell commented 10 years ago

Do I need to put in VHOST files manually for each of them?

wmluke commented 10 years ago

Ahhh, I should have read your cmd logs more carefully...you need to set both domains in a single call...

domains:set nodesamp www.ahalearning.co www.kyleapennell.com

You were overwriting the first command with the second one.

Let me know how it goes.

kpennell commented 10 years ago

Perhaps I'm misunderstanding the instructions. I guess I thought it went something like this:

dokku domains:set app1 www.domain1.com

dokku domains:set app2 www.domain2.com

So should it actually be domains:set nodesamp noderest www.ahalearning.co www.kyleapennell.com 2 domains, 2 apps at once? Or am I missing something?

I was trying to set the app called noderest to one domain. And the app nodesamp to the other domain.

Sorry if I'm misunderstanding your suggestion.

kpennell commented 10 years ago

I double checked the domains and they seem to be set fine. Odd. Guessing I'm misunderstanding something elementary:

root@dokkutry:~# dokku domains nodesamp www.ahalearning.co root@dokkutry:~# dokku domains noderest www.vibesample.com

kpennell commented 10 years ago

Perhaps it's the 2nd part that is overwriting?

This is what I did

ssh dokku@domain1.com domains:set app1 www.domain1.com

ssh dokku@domain2.com domains:set app2 www.domain2.com

kpennell commented 10 years ago

Am I missing something?

kpennell commented 10 years ago

Well, thanks anyway. Seems like a great plugin. Just a bit above my abilities right now.

Antonhansel commented 9 years ago

Hello @kpennell , since v0.3.1 Dokku has its own domain management built-in plugin. The awesome plugin done by @wmluke actually breaks my apps since the new dokku versions.

To configure your domain with the built in plugin, read this http://progrium.viewdocs.io/dokku/nginx

Have a good day :)

kpennell commented 9 years ago

Thanks, Anton.

On Thu, Jan 29, 2015 at 5:52 AM, AntonHansel notifications@github.com wrote:

Hello @kpennell https://github.com/kpennell , since v0.3.1 Dokku has its own domain management built-in plugin. The awesome plugin done by @wmluke https://github.com/wmluke actually breaks my apps since the new dokku versions.

To configure your domain with the built in plugin, read this http://progrium.viewdocs.io/dokku/nginx

Have a good day :)

— Reply to this email directly or view it on GitHub https://github.com/wmluke/dokku-domains-plugin/issues/12#issuecomment-72018985 .

wmluke commented 9 years ago

Closing b/c #15