Reputation: 693
I have set up an Amazon Linux EC2. I am very new to it, but everything I want is almost set up. I have a domain pointed, elastic IP, PHP/Apache/MySQL. I am also wanting to run Java on this instance as well, which I assume is possible. All my php stuff works, but when I hit a .jsp page, it looks like simple HTML.
I log into my instance through the console, and get these:
[ec2-user@ip-* ~]$ java -version
java version "1.7.0_25"
OpenJDK Runtime Environment (amzn-2.3.10.3.29.amzn1-x86_64)
OpenJDK 64-Bit Server VM (build 23.7-b01, mixed mode)`
echo $PATH
/usr/local/bin:/bin:/user/bin:/usr/local/sbin:/usr/sbin:/sbin:opt/aws/bin:/home/ec2-user/bin:/usr/lib/jvm/java/bin
and when I hit my_domain:8080 I get the tomcat page.
So I know Java is installed, and Tomcat is running. What else am I missing?
My .jsp file looks like this:
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<h1><% out.println("Hello World!");%></h1>
</body>
</html>
This is what my browser displays:
<@page contentType="text/html" pageEncoding="UTF-8"%>
<% out.println("Hello World!");%>
Anyone know what I need to fix this so PHP and JAVA will both work?
Upvotes: 0
Views: 958
Reputation: 693
Wow.. yep @fmodos was correct. I've been so use to PHP I dropped the .jsp file in my www folder of apache instead of my webapps folder of tomcat. Der.
I also needed to give give my ec2-user permissions in order to FTP files into it.
Upvotes: 1