Can't get a .jsp file to run on Tomcat 7 ubuntu server
apache, java, jsp, tomcat, ubuntu
Solution
The correct directory for Tomcat 7 using `apt-get` on Ubuntu server is `/var/lib/tomcat7/webapps/ROOT/`.
Problem
I installed Tomcat 7 on my Ubuntu 12.04 server using `apt-get`. As I understand it I just need to upload the project directory containing the `.jsp` file and `WEB-INF` directory containing the `web.xml` file. The base path: `/usr/share/tomcat7-root/default-root/test/` index.jsp: `/usr/share/tomcat7-root/default-root/test/index.jsp` web.xml: `/usr/share/tomcat7-root/default-root/test/WEB-INF/web.xml` The index.jsp file contents: ``` <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> </head> <body> <% out.println("this is a test"); %> </body> ``` The web.xml contents: ``` <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0"> <display-name>test</display-name> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> </web-app> ``` When I go to mydomain:8080/test/index.jsp I get the following error: HTTP Status 404 - /test/index.jsp type Status report message /test/index.jsp description The requested resource (/test/index.jsp) is not available. Apache Tomcat/7.0.26 Have I navigated to the correct directory? The Tomcat landing page loads the `its fine!` page with no errors so I'm assuming Tomcat is running properly. Am I doing something wrong with the web.xml attributes or the file structure? edit - typo