1. 程式人生 > >Ubuntu將tomcat7 端口改為81

Ubuntu將tomcat7 端口改為81

tomcat

Ubuntu將tomcat7 端口改為81:

apt-get install authbind

vi /etc/default/tomcat7

AUTHBIND=yes (默認為#AUTHBIND=no)
:wq

vi /var/lib/tomcat7/conf/server.xml (默認為8080)

<Connector port="81" protocol="HTTP/1.1"
connectionTimeout="20000"
URIEncoding="UTF-8"
redirectPort="8443" />
:wq

touch /etc/authbind/byport/81

chown tomcat7:tomcat7 /etc/authbind/byport/81

chmod 0755 /etc/authbind/byport/81

service tomcat7 restart

netstat –ntpl | grep 81

Ubuntu將tomcat7 端口改為81