google / earthenterprise

Google Earth Enterprise - Open Source
Apache License 2.0
2.67k stars 889 forks source link

Configuring an IP address for Web Server #97

Closed CLEAOSBORNE closed 7 years ago

CLEAOSBORNE commented 7 years ago

Having issues setting an IP address for web server versus localhost:port

I have edited the remote.cfg file to no avail, as well as a few others. Is it possible to configure the web server to listen on a specific network interface? I want to access the web page using a public IP.

tst-ccamp commented 7 years ago

Hey @CLEAOSBORNE, take a look at the section in the documentation for configuring virtual hosts. http://www.opengee.org/geedocs/answer/6013604.html

That might be more along the lines of what you're looking for.

CLEAOSBORNE commented 7 years ago

Thanks Chris, however I'm using the Tornado http server installed using this repository. With that said, I'm using Apache.

tst-ppenev commented 7 years ago

If you're trying to configure the Portable Server, have a look at the remote.cfg file. You should see a line like this that you can try modifying:

portable_server __portable_server_ip__:9335
tst-ccamp commented 7 years ago

One other thing, you can also try adding these lines to your portable.cfg file:

accept_all_requests True
disable_broadcasting False
tst-ahernandez commented 7 years ago

Hi @CLEAOSBORNE , have you made any progress on this issue?

CLEAOSBORNE commented 7 years ago

@tst-ahernandez I'm still having having issues when executing the install earth server script (sudo ./install_server.sh). Keep getting an error indicating failed to setup and configure postgresdb.

bradh commented 7 years ago

So this is not about portable server, but might be better dealt with as a different ticket (including the full error log, ideally off a clean build).

tst-ccamp commented 7 years ago

@CLEAOSBORNE We were just dealing with this issue with another user. The problem comes from the fact that the fusion installer will remove the /tmp/fusion_os_install directory after it successfully runs. So, if you ran install_fusion.sh without the -nop flag, you'll need to repeat the steps specified in the Installation Guide before running install_server.sh.

tst-ccamp commented 7 years ago

It sounds like you figured out your issue based on your comment on #117. Feel free to open a new issue or drop by the Slack chat if you have any other problems.

CLEAOSBORNE commented 7 years ago

Still having an issue remotely accessing Portable Server URL. Below are screenshots of my portable.cfg and remote.cfg file. The CentOS 7 machine has no firewall enabled.

portable cfg file

remote cfg file

Is there an issue with my syntax?

tst-ppenev commented 7 years ago

@CLEAOSBORNE: I think the portable_server line in \<remote.cfg> needs to have a colon between the hostname and the IP address. Other than that, assuming the screenshots include the complete files, they seem OK to me.

The following configuration files work for serving on my local network for me.

portable.cfg:

port 9335
globes_directory ../data
search_services_directory search_services
ext_service_directory ext_service
database file
local_override True
fill_missing_map_tiles True
max_missing_map_tile_ancestor 24
globe_name tutorial_sf.glb
use_plugin True
accept_all_requests True
disable_broadcasting False

remote.cfg:

port 9335
portable_server __portable_server_ip__:9335
CLEAOSBORNE commented 7 years ago

@tst-ppenev I've tried all combinations I can think of in modifying the remote.cfg file. In your example above, what part of the second line is the hostname? my hostname is geeserver, so following your example I configured it: portable_server __geeserver_ip__:199.x.x.x:8080

Is this correct?

tst-ppenev commented 7 years ago

@CLEAOSBORNE: Actually, as @tst-ccamp was mentioning to me, the \<remote.cfg> file doesn't seem to be used for anything. It was copied over from the time before GEE was open sourced.

Do you get any errors when serving, or just a refused connection?

You can see what IP addresses Portable server is listening to by starting it, and running:

netstat -l -p | grep 8080 # If you set port to 8080

If you see something like:

tcp        0      0 *:8080                  *:*                     LISTEN      20416/python    
tcp6       0      0 [::]:8080               [::]:*                  LISTEN      20416/python 

the *, or [::] for IPv6, means that Portable Server is listening to all IP addresses.

CLEAOSBORNE commented 7 years ago

@tst-ppenev I checked netstat before, but I don't get the python service with process id. Here is my result:

netstat geeserver

Looks like the portable_server.py script needs modifying

tst-ppenev commented 7 years ago

@CLEAOSBORNE: Looks like you may have something else listening on port 8080. You can try the -p switch to netstat to see the PID and name of the listening process.

CLEAOSBORNE commented 7 years ago

@tst-ppenev Oops....I do get the python process and ID...sorry:

netstat 2

This is the portable server process......7736

tst-ppenev commented 7 years ago

Then, you don't need to configure the IP address to listen on. There must be some other problem.

Are you able to access your Portable globes from localhost?

CLEAOSBORNE commented 7 years ago

@tst-ppenev yes, localhost:8080 will render the San Francisco portable server globe

capture100

tst-ppenev commented 7 years ago

@CLEAOSBORNE: What happens on the machine that can't access a globe?

CLEAOSBORNE commented 7 years ago

@tst-ppenev This Site Can't Be Reach error......ERR_CONNECTION_TIMED_OUT

I think I may just have a classical networking issue.....going thru the network settings again.

CLEAOSBORNE commented 7 years ago

@tst-ppenev Doesn't seem to be a networking issue....

tst-ppenev commented 7 years ago

Do you see packets from your client machine reaching your server?

(One way to test is with netcat, another is to look at the packets with Wireshark.)

tst-ppenev commented 7 years ago

@CLEAOSBORNE: I think you wouldn't normally get a 'connection timed out' error on simply a misconfigured Portable Server. You'd usually get a connection refused. A connection time out is more likely with something like a firewall, or a bad browser proxy configuration, that is blocking packets.

Can you show the command you're using to open a connection from the client machine to the server? If it's a browser, what URL are you using? (You may also need to look at browser settings.) If it's something on the command line, like telnet, curl, or wget, what's the command?

CLEAOSBORNE commented 7 years ago

@tst-ppenev I'm just using the IP:8080

CLEAOSBORNE commented 7 years ago

@tst-ppenev I also published the globe in GEE server as well and use : IP/testglobe

and same error persists

tst-ppenev commented 7 years ago

@CLEAOSBORNE: Can you show a command with the IP you're using?

For example,

curl 127.0.0.1:8080

should show you the HTML of the Portable Server front page, or an error.

Or,

telnet 127.0.0.1 8080

should connect, and show you prompt (where you could issue an HTTP GET request), or fail with an error.

Does your server respond to ICMP ping requests? Do you get a response when you ping?

How did you ensure your network connection between the two hosts is working?

CLEAOSBORNE commented 7 years ago

@tst-ppenev curl 199.123.89.52:8080

I can ping the server with success, from the server I can ping all public webpages and etc and traceroute to any local network IP addresses.

tst-ppenev commented 7 years ago

curl gives you a network timeout?

If so, it seems likely a firewall problem.

I think the most obvious way to test is to run Wireshark on your server, and see if you're receiving requests on your port, and sending responses.

Otherwise, a simple way to test the connection on a given port from client to server is:

On the server, stop server processes listening on the port you want to test, then run:

netcat -l 8080 # If you want to listen on port 8080.

On the client, run:

netcat 199.123.89.52 8080

Then type some string, e.g.:

muser@client-host:/tmp$ netcat 199.123.89.52 8080
Hi, network host.

(You can press Ctrl-D to terminate.)

You should see the same string on the server host, if your connection between the two is working. Otherwise, you should have some errors to trouble shoot.

CLEAOSBORNE commented 7 years ago

@tst-ppenev Good news......after playing with the firewall (which was not configured as a service) or started according to the runlevel, I flushed it out and everything works now. Seems like there is a static firewall setting with rules configured in the baseline....smh.

Sorry for eating up your time on this......appreciate the help in trouble-shooting this.

tst-ppenev commented 7 years ago

@CLEAOSBORNE: Great! You can send a bottle of fruit juice, and close this ticket, if you're happy.

CLEAOSBORNE commented 7 years ago

@tst-ppenev LOL! Sounds good.....its a wrap, I have portable, fusion and gee server installed on centos 7.

Thanks for all your help! Juice on the way