今天我跟着视频学习tomcat时,视频中把一个网页放在 webapps 目录下,然后视频中启动tomcat
在浏览器上输入 localhost/hello/hello.html 可以显示内容。但是我照他这样做,显示网页访问不到。
通过网上寻找解决方法。我需要在浏览器上输入 localhost:8080/hello/hello.html 才能访问到。
今天发现,我无法使用 locathost/hello/hello.html 访问成功的原因是,我没有在 apache-tomcat-8.5.31\conf 目录下的 server 文件中修改端口号。只要把server 中的端口号 8080 修改为 80 就行了。