tomcat7監聽連接埠 改為 80 linux Debian__linux

來源:互聯網
上載者:User

 第一步: 在 設定檔/etc/tomcat7/server.xml 中將 port =8080 改為 port =80

重啟 tomcat7,仍然無法在瀏覽器中訪問 localhost

   開啟 記錄檔  /var/log/tomcat7/catalina.out  ,會看到如下錯誤:

SEVERE: Failed to initialize connector [Connector[HTTP/1.1-80]]org.apache.catalina.LifecycleException: Failed to initialize component [Connector[HTTP/1.1-80]]Caused by: java.net.BindException: Permission denied
  第二步: 以上錯誤是因為Linux Debian 安裝的 tomcat7 預設的監聽連接埠號碼 要大於1023

 開啟檔案 /etc/defaults/tomcat7 ,將

#AUTHBIND=no

   改為:

AUTHBIND=yes
     重啟 tomcat7 ,仍無法在瀏覽器中訪問 localhost
開啟記錄檔  /var/log/tomcat7/catalina.out  ,會看到如下錯誤:   

SEVERE: Failed to initialize end point associated with ProtocolHandler ["http-bio-80"] 

java.net.SocketException: No such file or directory

  第三步:  運行以下命令,但是authbind 只能支援IPv4 ,不支援IPv6 
sudo  apt-get install authbind
sudo touch /etc/authbind/byport/80   
sudo chmod 500 /etc/authbind/byport/80sudo chown tomcat7 /etc/authbind/byport/80
 

詳情參見 以下連結:

點擊開啟連結

點擊開啟連結

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.