[bug] There is no error when starting tomcat under CenterOS/Linux, but the tomcat page browsing error: HTTP ERROR 404Problem accessing /. Reason: NOT_FOUND

Error prompt interface:

HTTP ERROR 404

Problem accessing /. Reason:

NOT_FOUND

Powered by Jetty://

Problem environment:

    Use the vm virtual machine to install CenterOS6, open tomcat normally, no error is reported during the startup process, but the initial interface of tomcat cannot be opened after opening: localhost:8080, the error is as shown above.

Reason: The port number is blocked by the firewall/not opened.

Solution:

Modify the port number, the firewall opens the corresponding port number, the problem is solved

Modify the port number:

Suppose the directory where tomcat is located is /usr/local/apache-tomcat/

1. Open the tomcat configuration file
#vi /usr/local/apache-tomcat/conf/server.xml

2. After opening the Tomcat configuration file, press /8080  to quickly retrieve

3. Modify the port, press i , and change 8080 to 80

4. Press :wq to save and exit

5. Restart tomcat _ 

# / var / apache-tomcat / bin / shutdown.sh

# / var / apache-tomcat / bin / startup.sh

 

Open port number:

Check the status:
iptables -L -n
Add a method to open a specific port below:
Use iptables to open the following port
/sbin/iptables -I INPUT -p tcp --dport 8000 -j ACCEPT
save
/etc/rc.d/init.d /iptables save
restart the service
service iptables restart
to see if the ports that need to be opened take effect
/etc/init.d/iptables status

Over

 

 

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324776607&siteId=291194637