Installing Java 1.7 a Tomcat 6 on CentOS 6
Java 1.7
From the command line do:
# yum install jpackage-utils
# cd /root/setup
# rpm –ivh jdk-7u2-linux-i586.rpm
The JDK will be installed at /usr/java/jdk1.7.0_02
JAI
Download JAI 1.1.2 from Oracle website.
Tomcat 6
From the command line do:
# yum install yum-priorities
# rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
# rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.5.2-2.el5.rf.i386.rpm
# cd /etc/yum.repos.d/
# wget http://jpackage.org/jpackage50.repo
# yum install tomcat6 tomcat6-webapps tomcat6-admin-webapps
Tomcat directories will be as follows:
Configuration : /etc/tomcat6
Logs : /var/log/tomcat6
Webapps : /var/lib/tomcat6/webapps
Apache
Optionally, you can install Apache and forward HTTP request from it to Tomcat. For doing so from the command line do:
# yum install httpd
# echo "ProxyPass /hipergate/ ajp://localhost:8009/hipergate/" >> /etc/httpd/conf.d/proxy_ajp.conf
# service httpd restart
phpPgAdmin
Optionally, if you want to have phpPgAdmin on Apache do:
# yum install phpPgAdmin
# cp /etc/httpd/conf.d/phpPgAdmin.conf /etc/httpd/conf.d/phpPgAdmin.conf.DIST
# echo "Alias /admin/tools/phpPgAdmin /usr/share/phpPgAdmin" > /etc/httpd/conf.d/phpPgAdmin.conf
# service httpd restart
Edit file /etc/phpPgAdmin/config.inc.php
$conf['servers'][0]['host'] = 'localhost';
$conf['extra_login_security'] = false;
Enable HTTPS access
For using HTTPS you must install Apache mod_ssl module
# sudo yum install mod_ssl
Next create a self-signed certification authority
# openssl genrsa -out /tmp/ca.key 2048
Create a key for the web server
# openssl req -new -key /tmp/ca.key -out /tmp/ca.csr
# You are about to be asked to enter information that will be incorporated
# into your certificate request.
# What you are about to enter is what is called a Distinguished Name or a DN.
# There are quite a few fields but you can leave some blank
# For some fields there will be a default value,
# If you enter '.', the field will be left blank.
# -----
# Country Name (2 letter code) [GB]:
# State or Province Name (full name) [Berkshire]:
# Locality Name (eg, city) [Newbury]:
# Organization Name (eg, company) [My Company Ltd]:
# Organizational Unit Name (eg, section) []:
# Common Name (eg, your name or your server's hostname) []:
# Email Address []:
#
# Please enter the following 'extra' attributes
# to be sent with your certificate request
# A challenge password []:
# An optional company name []:
Sign the key with the certification authority previously generated
# openssl x509 -req -days 3650 -in /tmp/ca.csr -signkey /tmp/ca.key -out /tmp/ca.crt
Move the files to the default directories of CentOS
# cp /tmp/ca.crt /etc/pki/tls/certs
# cp /tmp/ca.key /etc/pki/tls/private/ca.key
# cp /tmp/ca.csr /etc/pki/tls/private/ca.csr
Re-start HTTPD
# sudo service httpd restart
More information at wiki.centos.org/HowTos/Https