---
title: "Discussion on \"如何用Tomcat redirect port 80 to 8080\" | Hashnode"
description: "Discussion on \"如何用Tomcat redirect port 80 to 8080\". 最近剛好學校作業要求用Tomcat來部屬網站，需要把從port80得到的請求導向Tomcat預設的服務端口port8080，好讓使用者在網頁請求時不會看到醜醜的:8080。\n沒用過Tomcat也不會寫Java(?，但想想它終究是個HTTP web server，應該有個地方可以設定一下吧。果然在tomcat/conf/ 路徑下，有個叫做server.xml 的檔案，裡面可以找到有個<Service>開頭的區塊，其中的port只要改成80就好。\n於是我改了，但還是跑不動阿。查了Tomcat的Log..."
url: "https://hashnode.com/posts/tomcat-redirect-port-80-to-8080/65d8c4d0842e0cd5ad6b6ea4"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [如何用Tomcat redirect port 80 to 8080](https://ckscks038038.hashnode.dev/tomcat-redirect-port-80-to-8080?utm_source=hashnode&utm_medium=feed)

最近剛好學校作業要求用Tomcat來部屬網站，需要把從port80得到的請求導向Tomcat預設的服務端口port8080，好讓使用者在網頁請求時不會看到醜醜的:8080。 沒用過Tomcat也不會寫Java(?，但想想它終究是個HTTP web server，應該有個地方可以設定一下吧。果然在tomcat/conf/ 路徑下，有個叫做server.xml 的檔案，裡面可以找到有個<Service>開頭的區塊，其中的port只要改成80就好。 於是我改了，但還是跑不動阿。查了Tomcat的Log...

Feb 23, 2024 · 1 min read · ckscks038038.hashnode.dev  
Read the article

-   [#tomcat](https://hashnode.com/tag/tomcat)
-   [#port-forwarding](https://hashnode.com/tag/port-forwarding)

## Written by

[Bryan Huang](https://hashnode.com/@ckscks038038)

@ckscks038038

  
[View profile](https://hashnode.com/@ckscks038038)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
