tomcat9.0 mac终端启动成功,却无法访问http://localhost:8080/

初始访问端口默认为8080

cssdeMacBook-Pro:bin caisense$ ./startup.sh

Using CATALINA_BASE:   /Users/caisense/tools/tomcat9.0

Using CATALINA_HOME:   /Users/caisense/tools/tomcat9.0

Using CATALINA_TMPDIR: /Users/caisense/tools/tomcat9.0/temp

Using JRE_HOME:        /Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home

Using CLASSPATH:       /Users/caisense/tools/tomcat9.0/bin/bootstrap.jar:/Users/caisense/tools/tomcat9.0/bin/tomcat-juli.jar

Tomcat started.


在终端中启动tomcat,在chrome中缺无法访问http://localhost:8080/

试过多种方法,发现应该是系统权限不够,修改权限(在tomcat9.0/bin目录):

cssdeMacBook-Pro:bin caisense$ chmod 777 *.sh


关闭tomcat,然后再次启动:

cssdeMacBook-Pro:bin caisense$ ./shutdown.sh

Using CATALINA_BASE:   /Users/caisense/tools/tomcat9.0

Using CATALINA_HOME:   /Users/caisense/tools/tomcat9.0

Using CATALINA_TMPDIR: /Users/caisense/tools/tomcat9.0/temp

Using JRE_HOME:        /Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home

Using CLASSPATH:       /Users/caisense/tools/tomcat9.0/bin/bootstrap.jar:/Users/caisense/tools/tomcat9.0/bin/tomcat-juli.jar

cssdeMacBook-Pro:bin caisense$ ./startup.sh

Using CATALINA_BASE:   /Users/caisense/tools/tomcat9.0

Using CATALINA_HOME:   /Users/caisense/tools/tomcat9.0

Using CATALINA_TMPDIR: /Users/caisense/tools/tomcat9.0/temp

Using JRE_HOME:        /Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home

Using CLASSPATH:       /Users/caisense/tools/tomcat9.0/bin/bootstrap.jar:/Users/caisense/tools/tomcat9.0/bin/tomcat-juli.jar

Tomcat started.


此时能成功访问http://localhost:8080/


你可能感兴趣的:(j2ee)