一、Tomcat详解
目录
http://localhost:8080/
测试tomcat启动是否正常
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
可以配置启动的端口号
- http: 80
- https:443
- mysql:3306
- redis:6379
- tomcat默认:8080
可以配置启动的主机名
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true">
二、用tomcat发布自己的网站
--webapps :Tomcat服务器的web目录
- ROOT
- bloghut : 网站的目录名
- WEB_INF
- classes : java程序
- lib : web 应用依赖的jar包
- web.xml : 网站的配置文件
- index.html 默认的首页
- static
-css
- style.css
-js
- huxufei.js
-img
在webapps下复制一份root文件,将其命名为huxufei,修改静态资源和xml配置文件,加入index.html。
在tomcat上运行自己的网站完成。