Agregamos el usuario, grupo, el home y el shell:
# adduser --home /home/glassfish --system --shell /bin/bash glassfish
# groupadd glassfishadm
# usermod -a -G glassfishadm root
Instalamos los requerimientos:
# apt-get install python-software-properties
Agregamos los repositorios:
# vim /etc/apt/sources.list
deb http://ftp.ch.debian.org/debian/ squeeze main non-free
# apt-get update
# apt-get install sun-java6-jdk sun-java6-jre
Damos OK:
Aceptamos la licencia:
# apt-get install unzip
# su glassfish
$ cd /home/glassfish
$ mkdir downloads
$ cd downloads
$ wget http://download.java.net/glassfish/3.0.1/release/glassfish-3.0.1.zip
$ unzip glassfish-3.0.1.zip
# mkdir -p /usr/local/apps/SDK/glassfish
# mv /home/glassfish/downloads/glassfishv3/* /usr/local/apps/SDK/glassfish/
# chgrp -R glassfishadm /usr/local/apps/SDK/glassfish/
# chown -R glassfish /usr/local/apps/SDK/glassfish/
# chmod -R +x /usr/local/apps/SDK/glassfish/bin/
# chmod -R +x /usr/local/apps/SDK/glassfish/glassfish/bin/
# su glassfish
Iniciamos glassfish:
$ /usr/local/apps/SDK/glassfish/bin/asadmin start-domain domain1
Waiting for DAS to start ....
Started domain: domain1
Domain location: /usr/local/apps/SDK/glassfish/glassfish/domains/domain1
Log file: /usr/local/apps/SDK/glassfish/glassfish/domains/domain1/logs/server.log
Admin port for the domain: 4848
Command start-domain executed successfully.
Accedemos a la web de administración:
http://192.168.0.100:4848
Paramos el servicio:
$ /usr/local/apps/SDK/glassfish/bin/asadmin stop-domain domain1
Waiting for the domain to stop ...
Command stop-domain executed successfully.
Cambiamos el Master password:
$ /usr/local/apps/SDK/glassfish/bin/asadmin change-master-password --savemasterpassword=true
Enter New_Master_Password password> NuevoMasterPasswordEnter New_Master_Password password again> NuevoMasterPassword
Command change-master-password executed successfully.
Cambiamos el admin password:
Debe estar iniciado y ejecutar lo siguiente:
glassfish@glassfish:/root$ /usr/local/apps/SDK/glassfish/bin/asadmin change-admin-password
$ /usr/local/apps/SDK/glassfish/bin/asadmin change-admin-password
Enter admin user name [default: admin]>
Enter admin password>
Enter new admin password> NuevoPasswordAdminEnter new admin password again> NuevoPasswordAdmin
Command change-admin-password executed successfully.
Nos logueamos nuevamente al glassfish.
Instalamos sudo porque lo utilizaremos en el script:
# apt-get install sudo
Creamos el script para iniciarlo:
# vim /etc/init.d/glassfish
#! /bin/sh
#Agregar el path de java
export AS_JAVA=/usr/lib/jvm/java-6-sun
GLASSFISHPATH=/usr/local/apps/SDK/glassfish/bin/
case "$1" in
start)
echo "starting glassfish from $GLASSFISHPATH"
sudo -u glassfish $GLASSFISHPATH/asadmin start-domain domain1
#Reemplazar por la siguiente linea cuando habilite https:
#sudo -u glassfish $GLASSFISHPATH/asadmin --secure start-domain domain1
;;
restart)
$0 stop
$0 start
;;
stop)
echo "stopping glassfish from $GLASSFISHPATH"
sudo -u glassfish $GLASSFISHPATH/asadmin stop-domain domain1
#Reemplazar por la siguiente linea cuando habilite https:
#sudo -u glassfish $GLASSFISHPATH/asadmin --secure stop-domain domain1
;;
*)
echo $"usage: $0 {start|stop|restart}"
exit 3
;;
esac
:
# chmod a+x /etc/init.d/glassfish
# /etc/init.d/glassfish start
starting glassfish from /usr/local/apps/SDK/glassfish/bin/
Waiting for DAS to start ....
Started domain: domain1
Domain location: /usr/local/apps/SDK/glassfish/glassfish/domains/domain1
Log file: /usr/local/apps/SDK/glassfish/glassfish/domains/domain1/logs/server.log
Admin port for the domain: 4848
Command start-domain executed successfully.
Agregarlo al inicio:
# cd /etc/rc2.d/
# ln -s ../init.d/glassfish S99glassfish
FUENTES:
http://www.nabisoft.com/tutorials/glassfish/installing-glassfish-301-on-ubuntu
http://www.gurx.net/index.php?option=com_content&view=article&id=39:instalar-sun-java
http://packages.debian.org/es/squeeze/sun-java6-jre
2 comentarios:
Gracias me sirvio de mucha ayuda. Te lo agradezco.
Publicar un comentario