I have many servers, which run Java Web applications. For development, I like Jetty, but for production, I prefer Tomcat7 now.
In ubuntu, you need root permission to use ports under 1024.
When you Google this topic, you will find a lot of solutions around the Internet, but many of them are not so useful, even some try to trap you.
So I just record what I do for this issue in Ubuntu:
- Open
/var/lib/tomcat7/conf/server.xmlor/etc/tomcat7/server.xml(they are the same), modify code as below
1 | <!-- more code here --> |
- Open
/etc/default/tomcat:
1 | # If you run Tomcat on port numbers that are all higher than 1023, then you |
- In very rare case, you need to change
TOMCAT7_USER=tomcat7toTOMCAT7_USER=root. [This is not recommended]