hagsteel / swampdragon

swampdragon
Other
557 stars 73 forks source link

Deploying SwampDragon on Apache? #135

Open juanecabellob opened 9 years ago

juanecabellob commented 9 years ago

I can't get swampdragon to run under Apache, I get always a timed out connection. Are there any kind of support for that? Settings: DRAGON_HOST = '127.0.0.1' DRAGON_URL = 'http://17.54.32.33:9999'

I'm getting always timed out connection and I don't know why.. I think I've tried all the possible combinations between my public and my private ip and I can't make it work. My redis-server it's working so it's not because of it..any ideas?

juanecabellob commented 9 years ago

I can't get it work, I really need some help here. I've been stucked with this for 4 days now and I really don't know why.. Maybe I'm overseeing something. If you need more details, please let me know. As I said I want to deploy this with Apache version 2.4.2 for Linux Fedora. I keep getting Connection timed out for the settings.py.

hagsteel commented 9 years ago

I don't use Apache my self so I can't tell you how to configure it, but in NGINX you need to upgrade the connection so I suspect you might need to do something like that.

juanecabellob commented 9 years ago

What do you mean with upgrade the connection? Does the swampdragon server has to be always running or are there any ways to make it run without that? If it does which are the settings I should give?

hagsteel commented 9 years ago

SwampDragon server has to be running or your clients won't be able to connect to it, just like you do with Django.

Whatever you use for Django you can use for SwampDragon (like supervisord etc.) But this is more a question about websockets and Apache than SwampDragon

juanecabellob commented 9 years ago

I don't use the development server from Django anymore as I've got it running under my Apache server. I know I've asked alot about WebSockets but I can get any info that helps me any further regarding the whole thing, that's why I posted this here and it will be useful for anyone that wants to get this running under Apache. For starters what are the settings that are required in production? Could you give me an example? About the rest how I configure the Apache server I'll do some more research and I'll post it here for all when I found out (Maybe useful as well for documentation?)

juanecabellob commented 9 years ago

This is my scenario: The server is running under the ip= 53.54.1.150 (that's the public IP) The server listens to the ip = http://17.54.32.33:80 (that's the private IP)

hagsteel commented 9 years ago

Are you asking what settings to specifically set for SwampDragon then the answer is the same as you would for development (different IP of course).

When you say

The server is running under the ip= 53.54.1.150 (that's the public IP)

I am not sure which server you are referring to. SwampDragon? Apache?

juanecabellob commented 9 years ago

The ip are from my Apache server

hagsteel commented 9 years ago

Okay so if your public IP is 53.54.1.150, and you are running SwampDragon on 17.54.32.33:80 you need to tell Apache to direct traffic from 53.54.1.150 to 17.54.32.33:80. However you are most likely running on port 80 so you need either a sub domain or use a different port for SwampDragon

juanecabellob commented 9 years ago

so I found out what was the problem all along. SWAMP_DRAGON_HOST and SWAMP_DRAGON_PORT are not being overwritten from the settings and the standard runsd doesn't accept any other parameters. That means the server has been always running under 'localhost' and not under the private IP. Apache, apparently, doesn't need any upgrade in the connection. So my configuration for the server is the same as it is described in the Django documentation, and I needed to overwrite the runsd with another server script as you did in the chat_example.

libofmath commented 9 years ago

Were you able to overwrite runsd with another script? I've been trying to deploy SwampDragon on Apache? Or is there a easy way to transfer from Apache into NGNIX? Any help will be appreciated :)

ghost commented 9 years ago

Once we've got the Apache config settled, we should probably add it to the docs. I don't use Apache either, for the most part, but you never know when you'll run into it. Post v2.4.6 it's supposed to handle the websocket upgrade correctly. Anyone used mod_proxy_wstunnel to get it working?

juanecabellob commented 9 years ago

@libofmath I write it just as it is in the chat_example and just put it into my root folder and from there I run it like you would run any other python script. If you need any help regarding this, I'd happy to help. @hamotoJohn I didn't need to yet, but maybe I will. If you do it with mod_proxy_wstunnel please let me know how!

a1Gupta commented 8 years ago

I am using Apache with mod_wsgi to run django server , how to deploy SwampDragon on Apache ? @juanecabellob can't I do it without putting server.py in root folder ? Can you please describe how you did it ? @jonashagstedt Did you try deploying on Apache ?