Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

will this work in linux #2

Open
fringd opened this issue Oct 18, 2012 · 6 comments
Open

will this work in linux #2

fringd opened this issue Oct 18, 2012 · 6 comments

Comments

@fringd
Copy link

fringd commented Oct 18, 2012

if so how? pow.cx only works for mac, and there's something called 'hoof' that does not work for me :/

@coreyti
Copy link
Owner

coreyti commented Oct 18, 2012

@fringd, great question! i suspect not, at this time. at its core, meltdown is backed by rubydns, which i believe to be cross-platform. however, meltdown registers a "resolver" at /etc/resolver/dev, which may be specific to OS X.

if you try it out, please do let me know how things go. note that the installation & execution is a bit picky at the moment. be sure you are using "system" ruby (e.g., if using rvm first run rvm use system) when installing and starting/stopping meltdown.

@ioquatix, any thoughts?

@fringd
Copy link
Author

fringd commented Oct 18, 2012

okay i can't really tell if it is working, there isn't actually any usage, which makes it hard to test :)

that said, i think the thing to do in linux is edit /etc/nsswitch.conf which is what the hoof gem is trying to do...

so i'm guessing it doesn't work with linux now...

@coreyti
Copy link
Owner

coreyti commented Oct 18, 2012

@fringd right... regarding the "how": meltdown for now simply resolves *.dev domains to localhost. it does not provide an http server, etc., like pow. so, in order to get things running under meltdown, you need something like apache or nginx to handling serving of your various *.dev domains.

for example, i use nginx (ssl-enabled, another reason why i had to give up on pow) to proxy to my rails applications running with foreman and unicorn. i configure unicorn to listen on a unix socket and nginx to proxy to that. then i start up foreman using foreman start -p 0. with the -p 0 option, foreman picks a random port, so i can have multiple apps running at once without worrying about port collision.

i've added an issue to update the docs with usage. will also take a look at linux usage when i can. thanks for asking!

@ioquatix
Copy link
Contributor

Most operating systems provide methods to register DNS resolvers.

On linux its /dev/resolv.conf - and you'd need super user privileges to edit it.

$ cat resolv.conf
search sitehost.co.nz
nameserver 120.138.18.100
nameserver 120.138.22.100

You can simply add "nameserver 127.0.0.1" to that file and you will get a similar behaviour.

@coreyti
Copy link
Owner

coreyti commented Oct 18, 2012

@ioquatix great, thanks!

@fringd
Copy link
Author

fringd commented Oct 23, 2012

ubuntu already has dnsmasq running at 127.0.0.1, so that's problematic, there is some voodoo to do with /etc/resolver, but it seemed too dense for my simple and stupid needs...

in the end i just edited /etc/hosts with 127.0.0.1 myapp.dev myotherapp.dev etc
and run pound which is a light http proxy redirecting localhost:80 to localhost:3000, (or whatever) with this cfg:

/etc/pound/pound.cfg

ListenHTTP
        Address 127.0.0.1
        Port    80

        ## allow PUT and DELETE also (by default only GET, POST and HEAD)?:
        xHTTP           0

        Service
                BackEnd
                        Address 127.0.0.1
                        Port    3000
                End
        End
End

if this gem ever functions as a simple http proxy and can wrangle the voodoo with /etc/resolvconf/resolv.conf.d/tail on ubuntu, it would be awesome... manually adding to /etc/hosts and pound.cfg as I add more apps is not the best

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants