Instalación de Java 1.7 y Tomcat 6 sobre CentOS 6
Java 1.7
Desde la línea de comandos ejecutar:
# yum install jpackage-utils
# cd /root/setup
# rpm –ivh jdk-7u2-linux-i586.rpm
La JDK quedará instalada en /usr/java/jdk1.7.0_02
JAI
Descargar JAI 1.1.2 desde el sitio web de Oracle.
Tomcat 6
Desde la línea de comandos ejecutar:
# 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
Los directorios de Tomcat quedarán ubicados de la siguiente manera:
Configuración : /etc/tomcat6
Logs : /var/log/tomcat6
Webapps: /var/lib/tomcat6/webapps
Apache
Opcionalmente, se puede instalar el servidor web Apache y ponerlo por delante de Tomcat para atender peticiones HTTP. Para ello desde la línea de comandos hacer:
# yum install httpd
# echo "ProxyPass /hipergate/ ajp://localhost:8009/hipergate/" >> /etc/httpd/conf.d/proxy_ajp.conf
# service httpd restart
phpPgAdmin
Opcionalmente, si se desea instalar phpPgAdmin sobre Apache hacer:
# 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
Editar el archivo /etc/phpPgAdmin/config.inc.php
$conf['servers'][0]['host'] = 'localhost';
$conf['extra_login_security'] = false;
Habilitación del acceso por HTTPS
Para que hipergate funcione por HTTPS hay que instalar el mod_ssl de Apache
# sudo yum install mod_ssl
A continuación generar una autoridad certificadora self-signed
# openssl genrsa -out /tmp/ca.key 2048
Crear una solicitud para el servidor web
# 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 []:
Firmar la solicitud con la autoridad certificadora generada
# openssl x509 -req -days 3650 -in /tmp/ca.csr -signkey /tmp/ca.key -out /tmp/ca.crt
Mover los ficheros a los directorios por defecto de 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
Reiniciar HTTPD
# sudo service httpd restart
Más información en wiki.centos.org/HowTos/Https