Tomcat does not run on port 80 as non-root
It is not recommended to make tomcat listen in 80 port, since Tomcat would need to run as a privileged user.
It is suggested either you redirect the port traffic using iptables .
# /sbin/iptables -A FORWARD -p tcp --destination-port 80 -j ACCEPT # /sbin/iptables -t nat -A PREROUTING -j REDIRECT -p tcp --destination-port 80 -to-port 8080 # /sbin/iptables-save
Please remember that in this case clients connecting from server itself have to connect to 8080 port itself.
OR
Another option is to use Apache as a front end to all requests and use modules to redirect to tomcat.
java.net.SocketException: Too many open files
For System Wide settings
To see the settings for maximum open files for the OS level, use following command.
cat /proc/sys/fs/file-max
This should be a value from 36000 to 50000 or more. To increase the system wide maximum open files, as root edit the /etc/sysctl.conf and add the following to the end of the file.
Note: The following example will increase the maximum number of files to 49,500 on your currently running system and will persist after rebooting.
fs.file-max = 49500
Then issue the following command to activate this change to your live system.
sysctl -p
For user level setting
Also, you should update /etc/security/limits.conf for the user.
myuser hard nofile 2048
myuser soft nofile 2048
Type this to see what it’s set at:
ulimit -a
