Please help setting up Tomcat. Very frustrating.
I've decided to give JSP a shot. I have some experience with Java, but usually do web development with PHP.
Unfortunatley I'm having nightmares getting Tomcat setup. It's extremely frustrating. :mad:
I'm using Tomcat 6 on Ubuntu 10.
I've gone through about four tutorials I found on the web, none of which seem to work properly, or contain stuff in all different directories. In the end, I basically just installed it all from the package manager.
I got to the point where I can get the manager thingy running using http://127.0.0.1:8080/manager/html, and I can login using a username and password I set in some users.xml file.
I then tried to edit the server.xml file to get tomcat to use port 80 and to load pages from a specific directory by default. (Like DocumentRoot in PHP). But I just can't get this to work. In fact, I managed to break everything and have to re-install the whole thing from scratch.
So, going from the various tutorials floating around the web, the two things I changed were:
So that port = "80" instead of "8080"
<Connector port="8080" protocol="HTTP/1.1"
... and ...
so that appBase = "/media/Shared/websites/MySite/web"
<Host name="localhost" appBase="webapps"
BTW, web is just a directory that NetBeans put there. I assume that's where it should be pointing to, as NetBeans also made a Hello World jsp file in that directory.
If I then go to 127.0.0.1, I just get a page not found error. If I just change the appBase attribute and not the port, and go to 127.0.0.1:8080, I get blank page with no source code in it - and I get that page no matter what path I put, eg. 127.0.0.1:8080/blahblah/ even if blahblah does not exist.
... setting up NetBeans was another nightmare. God knows why they can't just make it easy. You'd think it would work smoothly with Tomcat, but apparently not. The trouble was that it was looking for the server.xml file in some place where it didn't exist by default. I had to make a symollic link to server.xml in the /usr/shared/tomcat6 directory to get it to work! (original file was found in /etc/tomcat6)...
Anyway, NetBeans beside the point as I got that working in the end. Now I just want to get my site to work.
Please someone help. I'm losing my hair over this. Past midnight now so I'm going to hit the sack and hopefully some nice person will have sorted this out for me in the morning. Tell me to do a search and I'll come over an open a can of whoop ass.
Thanks in advance!