首先你要有一台自己的服务器
一,配置jdk,jre环境具体可参见以下教程
https://jingyan.baidu.com/article/6dad5075d1dc40a123e36ea3.html
二,下载安装tomcat
三,上传自己的网站代码,
四,修改tomcat默认主页—关键
1,默认的项目都在目录:apache-tomcat-9.0.0.M22\webapps\ROOT下
2、该目录下有一个index.jsp是tomcat的默认主页,一只小老虎
3,修改这个默认主页,改成自己的主页
(1)修改配置文件server.xml(在conf目录下),找到如下代码:<Host name="172.18.0.5" appBase="webapps" unpackWARs="true" autoDeploy="true"> <Context path="" docBase="C:\apache-tomcat-9.0.0.M22\webapps\ROOT"/>
修改第三行为<Context path="" docBase="C:\apache-tomcat-9.0.0.M22\webapps\ROOT\1" debug="0"/>
其中C:\apache-tomcat-9.0.0.M22\webapps\ROOT\1就是你想设置的网站根目录,我这里的根目录就是1
(2)修改配置文件web.xml,找到如下代码:
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
在第一行添加上指定文件,如work_detail.html,注意:work_detail.html是目录1下的文件
<welcome-file-list>
<welcome-file>work_detail.html</welcome-file>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list
还可以配置端口号,默认是8080,我这里改的是3000
D:\Tomcat 9.0\conf\server.xml