简体   繁体   中英

Tomcat doesn't start my web app

I have installed Apache Tomcat 8.0.9, it is working fine and the startup page appears.

The problem that any webapp i tried to start from the tomcat failed and I got 404 instead, I am new to tomcat and have a jsp project to be lunched.

Any advice please

I have partially knew the issue, because I have installed the tomcat under netbeans, the netbeans installed it under program files and defined another webapps under romaing so I have copied the apps into roaming and now the tomcat examples and confingurations are working.

but still I need to run opina from there and i have copied it there but it is still giving 404

First: check the log of tomcat to see if there is a deployment error.

Second: check always in the log of tomcat the context of your application

Third: check if the resource you are looking for is present in your application (for example http://localhost:8080/MYAPP/index.jsp reply with a 404 if you haven't a jsp named index)

If you can see the startup page then tomcat is running. check whether the page it is loading is there or not. try calling the page with exact address including the extension

Try looking at logs if there are some exceptions. Or go to the tomcat root page and search for deployed applications and see if your application is well deployed. If it has been well deployed there will be a link to your application. NB you will have to add an admin tomcat user, see the documentation on tomcat

As I mentioned in my edit to my question the issue was the duplicate of the webapps folder, and I fixed that by moving the webapps to the other folder.

I think the remaining question is about installing opina is not related to this question and I will consider the issue solved.

Apache2 is usually used for PHP project. Tomcat is usually for a java project. There is some possibility why you can not run tomcat on the web browser. One of the reason is you have not to install tomcat8 properly. Even you have installed it, you should check it really work or not. If it works on the VM, maybe the problem when you set the port for tomcat in server.xml.

To check server.xml, try : sudo nano /etc/tomcat8/server.xml (if your are using linux/MacOS), and find <Connector port="8080" protocol="HTTP/1.1 ... line.

And try to change the port 8080 to another port eg: 8081. Why? to prevent tomcat8 server running with the same port with another server such as apache2.

After that try the step on this link: https://askubuntu.com/a/434085/856656 it should work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM