> For the complete documentation index, see [llms.txt](https://jack80342.gitbook.io/spring-boot/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jack80342.gitbook.io/spring-boot/iv.-spring-boot-features/27.-developing-web-applications/27.4-embedded-servlet-container-support.md).

# 27.4 内嵌servlet容器支持

Spring Boot支持内嵌的Tomcat、Jetty和Undertow服务器。多数开发者使用合适的"Starter"来获取一个完全配置好的实例即可。内嵌服务器默认监听8080端口的HTTP请求。

**警告⚠️** 如果你在CentOS上使用Tomcat，需要注意：默认情况下，一个临时的目录会被用于存储编译完成的JSPs和上传的文件等。当你的应用运行时出错，这个目录可能会被`tmpwatch`删除。为了避免这种情况，你需要自定义`tmpwatch`。这样`tomcat.*`目录才不会被删除。或者，配置`server.tomcat.basedir`。这样内嵌的Tomcat会使用一个不同的位置。
