Tomcat always returns status code 400
Como o diretório webapps
está vazio:
# ls -l /usr/share/tomcat6/webapps/
total 0
Crie um contexto ROOT
fictício para obter um status 404:
# mkdir /usr/share/tomcat6/webapps/ROOT
# ls -l /usr/share/tomcat6/webapps/
total 4
drwxr-xr-x 2 root root 4096 Feb 22 07:47 ROOT
# service tomcat6 restart
Stopping tomcat6: [ OK ]
Starting tomcat6: [ OK ]
# curl -I localhost:8080
HTTP/1.1 404 Not Found
Server: Apache-Coyote/1.1
Content-Type: text/html;charset=utf-8
Content-Length: 955
Date: Fri, 22 Feb 2013 06:48:06 GMT
ou ... instale o pacote tomcat6-webapps
para obter um 200:
yum info tomcat6-webapps
Name : tomcat6-webapps
Arch : noarch
Version : 6.0.24
Release : 48.el6_3
Size : 609 k
Repo : updates
Summary : The ROOT and examples web applications for Apache Tomcat
URL : http://tomcat.apache.org/
License : ASL 2.0
Description : The ROOT and examples web applications for Apache Tomcat.
tree -L 2 /usr/share/tomcat6/webapps/
/usr/share/tomcat6/webapps/
├── examples
│ ├── index.html
│ ├── jsp
│ ├── servlets
│ └── WEB-INF
├── ROOT
│ ├── asf-logo-wide.gif
│ ├── build.xml
│ ├── favicon.ico
│ ├── index.html
│ ├── index.jsp
│ ├── RELEASE-NOTES.txt
│ ├── tomcat.gif
│ ├── tomcat-power.gif
│ ├── tomcat.svg
│ └── WEB-INF
└── sample
├── hello.jsp
├── images
├── index.html
├── META-INF
└── WEB-INF
10 directories, 12 files
curl -I localhost:8080
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Accept-Ranges: bytes
ETag: W/"7777-1357565143000"
Last-Modified: Mon, 07 Jan 2013 13:25:43 GMT
Content-Type: text/html
Content-Length: 7777
Date: Fri, 22 Feb 2013 06:52:04 GMT