Install Java 8, Apache http, Apache Tomcat 8.5 on CentOS 6

# Install tools and apache web server:
yum install wget nano httpd
chkconfig httpd on
service iptables stop
setenforce 0
service httpd start

# Install Java JDK 8 for server
yum install java-1.8.0-openjdk java-1.8.0-openjdk-devel
java -version

# downloadand unpackage apache tomcat
cd /home/
mkdir installers
cd installers
tar -zxvf apache-tomcat-8.5.5.tar.gz
mv apache-tomcat-8.5.5 tomcat85
mv tomcat85/ /opt/

# set tomcat opts
cd /opt/tomcat85/bin/
# put the line:
export CATALINA_OPTS="$CATALINA_OPTS -server -Dfile.encoding=UTF-8 -Xms128m -Xmx6248m -XX:PermSize=64m -XX:MaxPermSize=2000m"
# save and quit (ctrl+o, ctrl+X)
chmod +x

# start tomcat and test on browser:
# see welcome page in port 8080
# example:

# Configure Apache web server for proxypass an Web App via ajp (for this example /docs/)
nano /etc/httpd/conf/httpd.conf
# append the line to file bottom:
# see more docs in
ProxyPass "/docs" "ajp://"
# restart apache http
service httpd restart
# test via browser without port, example:

# firewall rule for 80, 8080 ports
nano /etc/sysconfig/iptables
# Then add this entry before -A INPUT -j REJECT line
-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 8080 -j ACCEPT
# restart firewall
service iptables restart
# verify open ports:
netstat -tulpn
# Make sure iptables is allowing ports
iptables -L -n
# Disable enforce
nano /etc/selinux/config
# change the SELINUX line to 


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s