I have to systems: one mac and one centos. Both running apache tomcat on 8080, listening ipv4.
Both nestat -an | grep 8080 shows: 127.0.0.1:8080 LISTEN No IPTABLES enabled No SeLinux enabled
Both server.xml look identical to me...
I deploy a rest server application. On mac CURL responds with 200 OK, and json data On centos CURL responds with 404 ...
Curl response for macos:
* About to connect() to localhost port 8080 (#0)
* Trying ::1...
* Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 8080 (#0)
> GET /core/rest/metadata/brand HTTP/1.1
> User-Agent: curl/7.30.0
> Host: localhost:8080
> Accept: */*
>
< HTTP/1.1 200 OK
< Content-Type: application/json
< Transfer-Encoding: chunked
Curl response for centos:
* About to connect() to localhost port 8080 (#0)
* Trying ::1... Connection refused
* Trying 127.0.0.1... connected
* Connected to localhost (127.0.0.1) port 8080 (#0)
> GET /core/rest/metadata/brand HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.0.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: localhost:8080
> Accept: */*
>
< HTTP/1.1 404 Not Found
(application is running in background since is computing some data from DB, and shows in catalina.out log the correct responses). All I need is my Rest interface which works on my dev machine (mac) and not on prod (centos)
Is is something that I miss in my investigation?
Silly me: found that I was using host name in server.xml with my product name, and had to replace with localhost.
Now all is fine.