第一步: 在 設定檔/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
詳情參見 以下連結:
點擊開啟連結
點擊開啟連結