giovedì 28 giugno 2012

openshift: hot deploy

Da provare!!
basta aggiungere un solo file (hot_deploy) nella cartella .openshift/markers/ per evitare che openshift faccia il reboot dell'application server.


bisogna vedere come si comporta (forse va aggiunto nel commit il file ROOT.war.dodeploy per effettuare il rideploy a caldo)


https://openshift.redhat.com/community/blogs/new-openshift-release-june-26-2012-jboss-eap-hot-deployments-pricing-and-more


Hot Deployment

Hot deployment is slowly being added. We've started with the Jboss AS 7 cartridge, but will be implementing the same feature with the others soon. Hot deployment allows you to push to your application without having to restart it. This helps with zero downtime deployments. To use it add the following marker to your git repo:
.openshift/markers/hot_deploy
Just git add, commit and push it and we'll attempt to deploy the new code without stopping JBoss. Keep in mind you still have to live inside your memory footprint. 
So, if you have a memory intensive app that has a memory intensive build, you may want to look at using Jenkins to build so the process happens inside a different gear.

openshift: come gestire la rotazione dei log

Utile post dal forum per gestire la rotazione dei log ed eventuale eliminazione/compressione:
https://openshift.redhat.com/community/forums/openshift/log-rotation-not-enabled





cd $OPENSHIFT_LOGS_DIR   
 
   find . -type f ( -name access_log-* , -name error_log-* ) -mtime +180  
   #  Add this to the above command to backup as a gzipped tarball:    | xargs tar -czvf  backup-logs-$(date +%Y%m%d).tar.gz   
   #  Add this to the above command to delete 'em:   -exec rm {} \;      or     | xargs rm)   

martedì 5 giugno 2012

openshift+jboss: RewriteValve from 80 to 443

riportato dal forum:


1. In your application, create a file called jboss-web.xml in src/main/webapp/WEB-INF/ directory with this content.
 sh$ cat  src/main/webapp/WEB-INF/jboss-web.xml   
<jboss-web>
      <security-domain>jboss-web-policy</security-domain>
       <valve>
             <class-name>org.jboss.web.rewrite.RewriteValve</class-name>
       </valve>
</jboss-web>
2. Create a rewrite.properties file in the src/main/webapp/WEB-INF/ directory with checking for http and redirecting to https.
sh$ cat src/main/webapp/WEB-INF/rewrite.properties  
RewriteCond %{HTTP:X-Forwarded-Proto} http   
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [R,L]    

links utili