Can't change default worldserver port in dockers build - docker

I installed AzerothCore successfuly on Windows 10 Pro using Docker, and it works fine locally. I was trying to make the server public so friends can connect from the internet for testing.
Since port 8085 for worldserver can't be forwarded on my router (probably ISP or router firmware reserving it, other ports can just fine), I tried everything to change it in conf files, literally changed it everywhere and added the overrides in the 2 conf.dist. Changed it in the realmlist field in authserver DB too. Recompiled everything: it stays 8085 no matter what (I can see it using netstats).
In more detail: I changed the port to 8086 in \azerothcore-wotlk\docker\worldserver\etc\worldserver.conf.dist
added the line "WorldServerPort = 8086" in worldserver.conf and worldserver.conf.dockerdist in the same directory.
Even changed the port in .env.dist in main installation directory.
Also changed the relative field in the realmlist entry in authserver database.
I rebuilt all the containers from scratch after the config modifications and recomposed them: worldserver port stays 8085.

I managed to solve the problem with the help of Francesco Borzi: turned out dockers containers have their own ports exposed so I needed to change those too accordingly.
I edited the docker-compose.yml file in main directory, where ports for the world server container are listed, along with the usual editings of worldserver confs and authserver database entries as usual, and recomposed from scratch.
Thanks for help.

Remember you're using docker, you only change the port redirection in docker-compose.

Related

Azeroth-Core/Docker - LAN Setup

I am looking to setup AzerothCore for LAN only use.
I am using an ESXi install with an Ubuntu 20.4.3 instance with latest Docker and Portainer for management. I am able to walk through the install process and it works great.
I switched the realmlist in the database to the LAN IP via HeidiSQL, setting both address and localaddress to LAN IP. I have tried just address and localaddress, leaving the other at 127.0.0.1.
I am using a fresh client install and set realmlist there too. I have tried both the dns and the IP, currently set to LAN IP.
I have not touched the compose file or modified authserver or worldserver config files. I am not certain where to look or what to change.
I am able to login with the ID I created all the way to see the Realm, which I select and hit enter. After a short pause the client screen returns to the realm selection screen. Not knowing the backend, I am not sure what is missing now.

Cant connect to External IP

I'm trying to connect to my public IP http://34.125.119.106:8080/, where I have a Jenkins service running but I can't and don't know why.
I've create firewall rule to allow tcp traffic on port 8080, which is the port exposed to Jenkins, but I still cannot connect. I looked into the /etc/default/jenkins file, to see if everything inside was configured correctly. I tried to line in this file like 'HTTP_HOST=127.0.0.1', like some people advise to do ,but it doesn't work for my case. Does anyone know how to solve this?
Sorry for my bad English.
enter image description here
i made a test and it successfully connected,but i still cant connect to my external Ip
Use the default settings, because HTTP_HOST=127.0.0.1 locks you out:
HTTP_HOST=0.0.0.0
HTTP_PORT=8080
HTTPS_HOST=0.0.0.0
HTTPS_PORT=443
Listing to all interfaces with 0.0.0.0 is fine, but HTTP_PORT should be -1.
As a first step my recommendation is to check if your service is exposed and through what port number. For this you can use command sudo netstat -plntu. You should be looking for an output similar to:
tcp6 0 0 :::8080 :::* LISTEN 17917/java
If its not, change your /etc/default/jenkins file to port 8080
After that from inside your GCP project, you can run a connectivity test having as source one of the IP addresses you are using to reach your Server and as destination your Servers VM instance IP address. This test will simulate traffic and tell you where it's getting stuck whether if it's stuck on the way to your Server or if your server is not correctly configured. You can get a good reference in this document.
If you have already configured your ingress firewall rule, just make sure its applied to your VM, it sometimes happens that you have a network tag on your VM instance and another tag on your firewall rule.

Is it possible to run ssl offline?

I have a web-app deployed on cloud with ssl (using freeencrypt with nginx)
The app is dockerized.
Is it possible for me to run it on localhost just by copying it and run docker-compose up?
Is it possible for me to run it on localhost just by copying it and run docker-compose up?
Sure, that's entirely possible. There's nothing particularly different about running it locally vs running it remotely: in both cases, you're still interacting with your web app with a browser over a network connection.
The only tricky bit may be in ensuring that you can continue to use the appropriate hostname so that your SSL certificate will validate correctly. The easiest way to do this is probably to modify your /etc/hosts file to map the hostname to the ip address of your webapp container. This will override DNS. Just remove to remove the modification when you're done testing, otherwise you won't be able to reach the remote site!

Change Apache server port dynamically (not manually, through programmatically)

I have installed Apache 2.4 in windows successfully, It is working.
Now I want to change the listening port dynamically (Not manually. meant to say, open a file and edit the port), might be place any properties file and read port from this or passing port as parameter to hhtpd.exe while starting server. Ultimately I have to configure port externally.
not possible. Use a script that changes it and gracefully restarts the server, or you won't be able to do it otherwise.

How do I make my ruby on rails app respond to external requests (visible to the public on the internet)?

Problem:
My rails app (on my local machine) only responds to requests sent from the same machine to localhost, 127.0.0.1, or my internal ip address. When I try to hit it using my internet ip or from any other machine, inside or outside of my network, it just times out. I'm on Mac OS 10.9.1, ruby 1.9.3, rails 4.0.0.
I've done a lot of searching but all I can find is problems where people didn't forward their ports or bind the right ip.
Here are the areas I've investigated:
Ports -
I've tried several different ports. I configured my router to forward every port I tried but got the same result. I thought maybe there was a problem with the router so I built a simple server in Java and bound all the same ports I was binding with my rails app. Sure enough, when I hit the Java app using my internet ip it worked just fine so the router/firewall/port forwarding isn't the problem. Also, I run an apache server on port 80 and that has never had any problems. I turned apache off and tried port 80 for my rails app but that didn't fix the problem.
Rails Server -
I started with WEBrick and I thought that perhaps there was some setting inside that blocked external requests. I searched google extensively and found nothing on that matter. Just to be safe I installed Thin and got the exact same result I did with WEBrick. One interesting thing is that when the rails server is started, the external request takes a long time to time-out, but the server console displays no output at all. However if I try to send the same request w/out starting the server at all it fails immediately.
User Permissions -
I started the server with root (i'm starting to just shoot in the dark here) and it had no effect.
Environment -
I was starting in development environment originally because I'm developing but just for fun I tried starting in production and it also made no difference.
PLEASE HELP ME SMART PEOPLE
Update:
I installed the app on my Ubuntu machine and it doesn't have this problem! So that suggests the problem may have something to do with Mac OS.
SOLVED:
It turns out that in the System Preferences -> Security & Privacy -> Firewall in Mac OS, it was somehow set to block incoming connections to Ruby 1.9.3. I must have accidentally set that some time ago.
The problem is you are probably trying to request the page from your local machine (or any computer on your local network, behind your firewall) to your public IP expecting a result... not unless you setup routes through your firewall for this (and not usually available on a consumer level router... linksys, dlink, etc)
So forward port 80 if you are using something like pow, or 3000 for web bricks default port to your local machine
Then have someone outside your local lan request your external (public) IP
This may be related: Rails 3.1 on Ubuntu 11.10 under VirtualBox very slow
Your mention of slowness combined with the use of webrick makes me think you've got some reverse-DNS lookup awfulness going on. A quick first step is hacking /etc/hosts to bypass this lookup.
The situation I dealt with on Ubuntu was solved in the short-term by hacking /etc/hosts. You could do this quick hack in order to see if it is indeed just webrick's reverse-DNS lookup. Edit /etc/hosts and add a line for the external user's IP address, something like this:
156.123.48.55 TestPerson
Replace the IP address with the tester's IP address. Since you said you can get the external request to hit an Apache server on port 80, you can grab their IP address from the Apache access logs if necessary, otherwise just ask the person testing.
You could also try a different web server, such as unicorn, which may help out. Add "gem unicorn-rails" to your Gemfile, run bundle install, and then (according to their docs), rails server will just use unicorn directly.
With any local server, you'll need to correctly configure port forwarding on your firewall. Like said by CaptChrisD, tests must be done by an external IP/browser (if you own a server, ssh on it, then w3m to test).
I already had same symptom (server started => timeout, server stopped => fail) and the origin was an issue with firewall configuration. I think it is your problem.
With MacOS, Pow is really awesome: installation is easy, no configuration required (no /etc/hosts…). Moreover, they give you a hook for external access to your virtualhosts (but you still need port forwarding on your firewall).
Otherwise, there is other solutions like Forward to do it without firewall configuration (30-days free trial).
Hope this helps!

Resources