Apache Tomcat


Instalación Java 8
sudo apt-get install oracle-java8-installer

Configuración

wget http://www.eu.apache.org/dist/tomcat/tomcat-8/v8.0.32/bin/apache-tomcat-8.0.32.tar.gz

Copiamos los archivos a las ubicaciones que se listan y copia de los jars a ext de cuerdo a la imagen anterior.

Desde: target/tomcat8x

  1. shared/lib/*.jar

  2. conf/context.xml

  3. conf/catalina.properties

  4. common/lib/*.jar

Hacia /opt/apache-tomcat-8.0.32/lib/ext y /opt/apache-tomcat-8.0.32/lib/conf

cp /CODIGO/workspace/myhippoproject/target/tomcat8x/conf/catalina.properties /opt/apache-tomcat-8.0.32/conf/
cp /CODIGO/workspace/myhippoproject/target/tomcat8x/conf/context.xml /opt/apache-tomcat-8.0.32/conf/
cp /CODIGO/workspace/myhippoproject/target/tomcat8x/common/lib/*.jar /opt/apache-tomcat-8.0.32/lib/ext/
cp /CODIGO/workspace/myhippoproject/target/tomcat8x/shared/lib/*.jar /opt/apache-tomcat-8.0.32/lib/ext/

Configuración VARS ENV

source /.profile

export JAVA_HOME=/usr/lib/jvm/java-8-oracle

export PATH=$PATH:$JAVA_HOME

export MAVEN_HOME=/usr/share/maven

export M2_HOME=/usr/share/maven

export PATH=$PATH:$MAVEN_HOME/bin:$M2_HOME/bin

export CATALINA_HOME=/opt/apache-tomcat-8.0.32

export CATALINA_BASE=$CATALINA_HOME

export PATH=$PATH:$CATALINA_HOME/bin:$CATALINA_BASE/bin

echo $CATALINA_HOME/bin

cd $CATALINA_HOME/bin

tar xvfz commons-daemon-native.tar.gz

cd commons-daemon-1.0.15-native-src/

cd unix

./configure

make

./bin/jsvc -classpath $CATALINA_HOME/bin/bootstrap.jar:$CATALINA_HOME/bin/tomcat-juli.jar -outfile $CATALINA_BASE/logs/catalina.out -errfile $CATALINA_BASE/logs/catalina.err -Dcatalina.home=$CATALINA_HOME -Dcatalina.base=$CATALINA_BASE -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file=$CATALINA_BASE/conf/logging.properties org.apache.catalina.startup.Bootstrap

Verificamos la instalación y ejecutamos el servisor

$CATALINA_HOME/bin/daemon.sh start

Git


Instalación

  1. sudo yum install git
  2. git --version

 

Uso

Clonando un repositorio.

git clone <repository-name.git>

Verificación del estatus del repositorio local, indicandonos si está sincronizado

git status

Como buena práctica, antes verificamos que nuestro repo LOCAL tenga todos los cambios en el MASTER.

git pull origin master

Se agregan todos los cambios locales al listado de los cambios por subir.

git add .

En caso de haber elimidado algunos archivos, deberemos utilizar:

git add --all

Enviamos los cambios y hacemos commit

git push origin master
git commit -m "Comentarios"

Comparto contigo algunos proyectos en https://gitahub.com/yanellyjm

Deploy to JBoss 7


This is a brief technical memory to deploy with JBoss 7, any comments or observations are welcome

REQUIREMENTS

  • To deploy with JBoos 7 requiered install and to configured the environment variables for maven 3 and Java 7

  • This is optional, you can define a goal for maven with:

<build>

    <finalName>project name</finalName>

    <plugins>

      <plugin>

         <groupId>org.apache.maven.plugins</groupId>

         <artifactId>maven-war-plugin</artifactId>

         <version>2.3</version>

         <executions>

            <execution>

               <phase>package</phase>

               <configuration>

                  <webXml>WEB-INF/web.xml</webXml>

               </configuration>

            </execution>

         </executions>

      </plugin>

   </plugins>

  </build>

INSTALLLING JBOSS 7

 

Unpackage the jboss-as-7.0.0.Final.zip in the next location

C:\Development_Tools\JBoss

Configure the JBOSS_HOME with the JBoss path

Generate war file executing the next maven command in the location where is the pom file

  • mvn clean install

 Copy the war file generated from

C:\Development_Tools\EclipseWorkspace\WebsiteServices\target

 To

 C:\Development_Tools\JBoss\jboss-as-7.0.0\jboss-as-7.0.0\standalone\deployments

Copy properties file to next location

 C:\Development_Tools\JBoss\jboss-as-7.0.0\jboss-as-7.0.0\standalone\configuration

 

Modify the standalone.xml adding next sections with proper data:

<system-properties>

        <property name=”service.endpoint.jndi.location” value=”jnp://es-jndi-dev.something.com:8180″/>

        <property name=”website.services.properties.file.location” value=”WebsiteServices.properties”/>

    </system-properties>

<subsystem xmlns=”urn:jboss:domain:datasources:1.0″>

            <datasources>

                <datasource jndi-name=”java:/OracleDS” pool-name=”OracleDS_Pool” enabled=”true” jta=”true” use-java-context=”true” use-ccm=”true”>

                    <connection-url>

                        jdbc:oracle:thin:@name.company.com:1521:WEBDEV

                    </connection-url>

                    <driver>jdbc.driver.OracleDriver

                    </driver>

<new-connection-sql>

select 1 from dual

</new-connection-sql>

<pool>

<min-pool-size>

5

</min-pool-size>

<max-pool-size>

20

</max-pool-size>

<prefill>

false

</prefill>

<use-strict-min>

true

</use-strict-min>

<flush-strategy>

FailingConnectionOnly

</flush-strategy>

</pool>

<security>

<user-name>

WEBDB

</user-name>

<password>

wRuzuf5E

</password>

</security>

<validation>

<check-valid-connection-sql>

select 1 from dual

</check-valid-connection-sql>

<validate-on-match>

false

</validate-on-match>

<background-validation>

false

</background-validation>

<useFastFail>

false

</useFastFail>

</validation>

<timeout>

<idle-timeout-minutes>

45

</idle-timeout-minutes>

<query-timeout>

600

</query-timeout>

</timeout>

<statement>

<track-statements>

TRUE

</track-statements>

</statement>

</datasource>

 

 Finally you can run the bat for JBoss 7.0 with the following command  in this location

C:\Development_Tools\JBoss\jboss-as-7.0.0\jboss-as-7.0.0\bin

 Encrypting datasource password

 export  JBOSS_HOME=/apps/jboss/jboss-as

export CLASSPATH=$JBOSS_HOME/modules/org/picketbox/main/picketbox

-4.0.7.Final.jar:$JBOSS_HOME/modules/org/jboss/logging/main/jboss-logging-3.1.0.GA.jar:$CLASSPATH

java  org.picketbox.datasource.security.SecureIdentityLoginModule  mypassword

Encoded password: -50fa369660ea3144207a6dde3d75616de44

 Define the application policy for the corresponding datasource  

<application-policy name = “WebDBPassword”>

<authentication>

<login-module code = “org.jboss.resource.security.SecureIdentityLoginModule” flag = “required”>

<module-option name = “username”>WEBDB</module-option>

<module-option name = “password”>-50ba369694jfk40la3144207a6df87216de44</module-option>

<module-option name =“managedConnectionFactoryName”>

jboss.jca:service=LocalTxCM,name=OracleDS

</module-option>

</login-module>

</authentication>

</application-policy>

Link

Maven


Instalación

Generar, ajustar y ejecutar el siguiente script; o bien, ejecutar en consola los comandos correspondientes.

#!/bin/sh
export M2_HOME=”/opt/maven”

$M2_HOME/bin $*

 

O bien,

#!/bin/bash
echo “Instalando MAVEN”

chmod 775 /qnue/maven-###/.bin
cd /root
yes | /qnue_data/maven-####.bin
/bin/mv /root/maven-#### /opt
/bin/rm -rv /usr/bin/javac
/bin/ln -s /opt/maven-###/bin/java /usr/bin
/bin/ln -s /opt/maven-###/bin/javac /usr/bin
export MAVEN_HOME=/opt/maven-###
export M2_HOME=/opt/maven-###
export MAVEN_OPTS=”-Xms1024m -Xmx4096m -XX:PermSize=1024m”
export PATH=$PATH:$MAVEN_HOME/bin

 

Algunas anotaciones sobre problemas típicos.

Missing artifact

<dependency>
<groupId>org.testng</groupId>
<artifactId> </artifactId>
<version>5.1</version>
</dependency>

La solución básica es ‘Maven’->’Update Project’, si con esto no se soluciona podemos buscar y encontraremos que tal vez, la versión no está disponible, por tanto no se ha podido actualizar; si con todo, aún no se ha resuelto, dejame saber tu caso.

REFERENCIA.