JBoss 6.x Tuning/Slimming

Introduction

The following slimming recommendations are for a standard JBoss AS 6.0.0 final (Community) “All” configuration.

Slimming is very application specific, so this is by no means a universal document. If you have documented the process for slimming other services for JBoss 6.x please add to them here.

The slimming document for JBoss5.x http://community.jboss.org/wiki/JBoss5xTuningSlimming will be not complete out of date for JBoss 6.x, so you might look into.

Remove hornetQ JMS (Java Message Service)

In JBOSS_HOME/server/<node>/deploy/ remove:

  • hornetq
  • jms-ra.rar

In JBOSS_HOME/server/<node>/deployers/ remove:

  • hornetq

In JBOSS_HOME/common/lib remove (only if no server configuration use hornetq)

  • hornetq*

In JBOSS_HOME/server/<node>/conf/ remove useless configuration:

  • delete element <application-policy name=”hornetq”> from login-config.xml
  • remove props/hornetq-roles.properties
  • remove props/hornetq-users.properties

Turn off hot deployment

In JBOSS_HOME/server/<node>/deploy/ remove:

  • hdscanner-jboss-beans.xml

Remove Hypersonic DB

In JBOSS_HOME/server/<node>/deploy/ remove:

  • hsqldb-ds.xml

In JBOSS_HOME/common/lib remove (only if no server configuration use hornetq)

  • hsqldb.jar hsqldb-plugin.jar

The following services use the “DefaultDS” datasource for persistence:

  • JUDDI
  • UUID key generator
  • EJB2 timer

One option is to remove or adapt such services, the other option is to provide a datasource “DefaultDS” for another RDBMS.

Datasource examples will be located in docs/examples/jca.

EJB2 Timer service

To deactivate persistence for EJB2 timer replace:

 <mbean code="org.jboss.ejb.txtimer.DatabasePersistencePolicy" name="jboss.ejb:service=EJBTimerService,persistencePolicy=database">

    <!-- DataSourceBinding ObjectName -->
    <depends optional-attribute-name="DataSource">jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>

    <!-- The plugin that handles database persistence -->
    <attribute name="DatabasePersistencePlugin">org.jboss.ejb.txtimer.GeneralPurposeDatabasePersistencePlugin</attribute>

    <!-- The timers table name -->
    <attribute name="TimersTable">TIMERS</attribute>
    <depends>jboss.jdbc:datasource=DefaultDS,service=metadata</depends>
</mbean>
...

<mbean code="org.jboss.ejb.txtimer.EJBTimerServiceImpl" ...
   <depends optional-attribute-name="PersistencePolicy">jboss.ejb:service=EJBTimerService,persistencePolicy=database</depends>

with:

<mbean code="org.jboss.ejb.txtimer.NoopPersistencePolicy" name="jboss.ejb:service=EJBTimerService,persistencePolicy=noop"/>

...

  <mbean code="org.jboss.ejb.txtimer.EJBTimerServiceImpl" ...
   <depends optional-attribute-name="PersistencePolicy">jboss.ejb:service=EJBTimerService,persistencePolicy=noop</depends>

Remove JUDDI

In JBOSS_HOME/server/<node>/deploy/ remove:

  • juddi-service.sar

Remove Key Generator

In JBOSS_HOME/server/<node>/deploy/ remove:

  • uuid-key-generator.sar

Remove Administration console

In JBOSS_HOME/common/deploy/ remove:

  • admin-console.war

In JBOSS_HOME/server/<node>/deploy/ remove:

  • admin-console-activator-jboss-beans.xml

Remove JMX console

https://community.jboss.org/message/734664#734664

In JBOSS_HOME/common/deploy/ remove:

  • jmx-console.war

In JBOSS_HOME/server/<node>/deploy/ remove:

  • jmx-console-activator-jboss-beans.xml

Remove JBoss Web Services console

In JBOSS_HOME/common/deploy/ remove:

  • jbossws-console.war

In JBOSS_HOME/server/<node>/deploy/ remove:

  • jbossws-console.war
  • jbossws-console-activator-jboss-beans.xml

Build Your Checklist

The Weekly Review: How One Hour Can Save You A Week’s Worth of Hassle and Headache

A weekly review checklist is an essential tool to making sure you touch on all three of the pillars mentioned above. Here’s what a basic review checklist looks like, courtesy of GTD TimesPhoto by Karuka (Shutterstock).

Get Clear

  • Collect loose papers and materials
  • Get Inbox to zero
  • Empty your head

Get Current

  • Review Action Lists
  • Review past calendar data
  • Review upcoming calendar
  • Review Waiting For list
  • Review Project (and larger outcome) lists
  • Review any relevant checklists

Get Creative

  • Review Someday/Maybe
  • Be creative and courageous

If you need more detail, David Allen offers a template checklist (free, but requires registration) on his site to get you started, and this one (scroll down to weekly review) is another good example. On the GTD forums, some users have shared their own checklists for inspiration. Whether you use a template or build yours from scratch (and it doesn’t have to be long—just those things you want to make sure you do every week), make sure you populate it with things you want to review and not do. Remember, you’re not supposed to spend time working during your weekly review—just reviewing.

Instalando e configurando o AWSTATS no Linux (ótimo relatório para web site)

postado por nightnux – uma dica de Pablo Santos

AWStats é uma ótima ferramenta para gerar estatísticas avançadas sobre o acesso à servidores FTP, HTTP e Servidores de e-mail. Com essa ferramenta é possível analisar os logs de vários Servidores, como Apache (NCSA combined/XLF/ELF ou common/CLF), WebStar, IIS (W3C) e muitos outros.

Para maiores detalhes sobre essa ferramenta, acesse o http://awstats.sf.netA instalação a seguir foi feita em um Servidor com Red Hat 6.2. Todos so comandos foram executados com o usuário root. Em primeiro lugar vamos fazer o download do pacote do awstats.

Como sempre, eu gosto de trabalhar no diretório /tmp (você não é obrigado a utilizar esse diretório, pode utilizar o diretório onde o awstats será instalado), portanto vamos baixar o pacote e descompactá-lo com os comandos a seguir:

# cd /tmp
# wget http://ovh.dl.sourceforge.net/sourceforge/awstats/awstats­7.0.tar.gz
# tar xzvf awstats-7.0.tar.gz
# cd awstats­-7.0

Agora vamos criar o diretório, onde o awstats será instalado e em seguida vamos copiar os arquivos descompactados para o diretório

# mkdir /usr/local/awstats
# cp -r * /usr/local/awstats/

Após a cópia dos arquivos, vamos executar o script de configuração localizado dentro do diretório tools

# cd /usr/local/awstats/tools
# perl awstats_configure.pl

O script de configuração irá fazer várias perguntas, são bem simples de serem respondidas (ou configuradas). Vejamos:

1 – Enter full config file path of your Web server.
Informe o arquivo de configuração do Apache, nesse caso como o sistema operacional é um Red Hat 6.2.

# cd /usr/local/awstats/tools
# perl awstats_configure.pl

2 – “Do you want me to setup Apache to write ‘combined’ log files”
Dependendo da configuração do Apache, os logs podem ser armazenados em vários arquivos, por exemplo: log de erro vai para o arquivo de erro error.log, o log de acesso vai para access.log, etc., “Fique atento, pois algumas opções podem não ser geradas no relatório.”

3 – Do you want me to build a new AWStats config/profile file (required if first install) [y/N] ?
Caso queira criar um arquivo de configuração escolha Y, caso contrário N — escolha “Y”

4 – Your web site, virtual server or profile name:
Escolha um nome para os logs “em um mesmo servidor eu posso ter vários sites hospedados, nesse passo informaremos apenas um. Este servirá de base para os outros sites.”

domain.com.br

5 – Directory path to store config file(s) (Enter for default):
Informe onde os arquivos de configuração deverão ser salvos

/etc/awstats

Feito isso a configuração já está quase pronta! Agora, vamos criar o diretório, onde o awstats irá armazenar uma espécie de Banco de Dados. Para isso utilizamos o comando abaixo.

# mkdir -­p /var/lib/awstats

Nesse exemplo, o relatório deverá ser gerado para páginas acessadas em um Servidor Web Apache. Para isso devemos alterar no mínimo 3 parâmetros dentro do arquivo de configuração para o domínio. Vamos editar e alterar os parâmetros.

# vim /etc/awstats/awstats.dominio.com.br

1. LogFile -> devemos especifcar o arquivo de log gerado pelo apache. Por exemplo: /var/log/apache/access_log
2. LogFormat -> o valor deve ser alterado para 4 (para maiores detalhes, veja a documentação do sistema).
3. SiteDomain -> faça uma “breve” descrição do relatório. Ex: dominio.com.br

Ufa! Agora podemos gerar o relatório. Para isso, vamos executar o comando:

# perl /usr/local/awstats/wwwroot/cgi­bin/awstats.pl ­update ­config=dominio.com.br

Agora basta acessar o relatório através do endereço abaixo.

http://localhost/awstats/awstats.pl?config=domain.com.br

Caso você necessite criar relatórios de outros sites (domínios) basta copiar o arquivo de configuração e alterar os parâmetros LogFile e SiteDomain

# cp /etc/awstats/awstats.dominio.com.br /etc/awstats/awstats.dominio2.com.br

Além disso é necessário alterar o endereço

http://localhost/awstats/awstats.pl?config=domain.com.br

para

http://localhost/awstats/awstats.pl?config=domain2.com.br

That’s all!

Instalando um certificado SSL

Você pode adquirir um Certificado SSL de uma certificadora como Verisign ou Thawte. Essas empresas oferecem excelentes documentações e instruções sobre como instalar o certificado em seu website.

Abaixo eu incluí um screenshot do processo de instalação do certificado no arquivo keystore.

Jbssl2.png

Atenção! Podemos ter uma importação pura e simples de um certificado, onde somente a chave pública é enviada ao servidor; no exemplo abaixo, procedimento para a importação de um certificado emitido pelo SERASA:

$ keytool -import -alias serasa -file serasa.cer

Será requisitado que você entre com uma password… essa password será a chave privada da keystore; ele só servirá para abrir o certificado do SERASA (serasa.jks), onde contém a chave publica.

Enter keystore password:
Re-enter new password:

Após a password, ele mostrará qual chain root foi importada…

Owner: CN=Autoridade Certificadora Raiz Brasileira, ST=DF, L=Brasilia, OU=Instituto Nacional de Tecnologia da Informacao - ITI, O=ICP-Brasil, C=BR
Issuer: CN=Autoridade Certificadora Raiz Brasileira, ST=DF, L=Brasilia, OU=Instituto Nacional de Tecnologia da Informacao - ITI, O=ICP-Brasil, C=BR Serial number: 4 Valid from: Fri Nov 30 10:58:00 BRST 2001 until: Wed Nov 30 21:59:00 BRST 2011 Certificate fingerprints:
         MD5:  96:89:7D:61:D1:55:2B:27:E2:5A:39:B4:2A:6C:44:6F
         SHA1: 8E:FD:CA:BC:93:E6:1E:92:5D:4D:1D:ED:18:1A:43:20:A4:67:A1:39
         Signature algorithm name: SHA1withRSA
         Version: 3
Extensions: #1: ObjectId: 2.5.29.15 Criticality=true KeyUsage [
 Key_CertSign
 Crl_Sign
#2: ObjectId: 2.5.29.19 Criticality=true BasicConstraints:[
 CA:true
 PathLen:2147483647
#3: ObjectId: 2.5.29.14 Criticality=false SubjectKeyIdentifier [ KeyIdentifier [ 0000: 8A FA F1 57 84 11 13 35 90 42 FA 57 49 54 69 0D ...W...5.B.WITi. 0010: A4 C4 F0 37 ...7 #4: ObjectId: 2.5.29.31 Criticality=false CRLDistributionPoints [
 [DistributionPoint:
    [URIName: http://acraiz.icpbrasil.gov.br/LCRacraiz.crl]
#5: ObjectId: 2.5.29.32 Criticality=false CertificatePolicies [
 [CertificatePolicyId: [2.16.76.1.1.0]
[PolicyQualifierInfo: [
 qualifierID: 1.3.6.1.5.5.7.2.1
 qualifier: 0000: 16 2C 68 74 74 70 3A 2F   2F 61 63 72 61 69 7A 2E  .,http://acraiz.
0010: 69 63 70 62 72 61 73 69 6C 2E 67 6F 76 2E 62 72 icpbrasil.gov.br 0020: 2F 44 50 43 61 63 72 61 69 7A 2E 70 64 66 /DPCacraiz.pdf ]] ]   Trust this certificate? [no]: yes
Certificate was added to keystore

Para listar a chave importada…

keytool -list

Será requisitada a password e posterior listagem… neste ponto, a keystore se encontra em $HOME/.keystore

Enter keystore password:
Keystore type: JKS Keystore provider: SUN Your keystore contains 1 entry serasa, 18/02/2008, trustedCertEntry,
Certificate fingerprint (MD5): 96:89:7D:61:D1:55:2B:27:E2:5A:39:B4:2A:6C:44:6F

Melhor renomear a .keystore para um nome que se entenda… como:

mv ../../.keystore serasa.jks

Usaremos entao como keystore serasa.jks

Dica: No Windows a keystore fica armazena no userdir, e.g., C:\Documents and Settings\ccsilva.

Mais tem um detalhe…

Obviamente você já deve ter percebido que precisará da senha da keystore, criptografada, para depois abrir o certificado e retirar a assinatura; ela não pode aparecer em plain-text e sim num properties, como abaixo:

user.jks=gHUrtR3FCQbigUmFOY/eXKxOtcajYEhp+g==RO6SyDLaAQ==

Então, para criptografar uma senha, você vai precisar de um pequeno aplicativo, disponível aqui; veja abaixo screenshot CriptografaSenha.png

  • Execute:
$ java -jar criptografia.jar

Have fun!

What You Can Do About Your Stress, and Your Bad Boss

Dealing with a bad boss is a tricky proposition. I know a number of people who love their jobs but hate their managers, and when someone tells them to just quit and find a different job, they resist—mostly because they feel like everything else about their job is so perfect, they just need to get over this one thing to make it worthwhile. Quitting is an option, but it’s not the only one. Let’s look at some others.

  • Get a hobby, or another activity to de-stress right after work. One of the best things you can do to leave your stress at the office is to treat yourself to something rewarding and relaxing immediately at the end of your workday. Hit the gym every day after work, for example—you’ll do your body and mind a world of good, and it’ll help you work off the stress of the day so you’ll get home and open the door without that extra baggage.
  • Visualize, meditate, or take time alone to power through it. One of the tips we mentioned when discussing chronic stress and what you can do about it is to take some time alone and practice muscle relaxation techniques or visualization techniques that remove you from the things that stress you out. Whether you do it in the car before you head into the house every day, or before you begin the commute home from work, take some time to let your conscious mind take over, identify that you’re stressed, and break it down so you’re more aware of your actions and your responses to your family and friends.
  • Transfer to a different team or role in your company. Some companies encourage this and others don’t, but if yours does, it might be time to find another department to transfer to. Talk to your HR rep or, if you know they’re looking for talent, a person in that team and ask if you can apply for the position. You’ll have to handle this delicately: You don’t want your current boss to sabotage your efforts, but you do want to be up-front about your desire for a change of scenery. If you can swing it diplomatically, you may be able to stay with your company, continue to do what you love (or even try something new) and leave your bad boss behind.
  • Build your case. You don’t want to start treating your boss with the same unprofessional demeanor that they treat you with, but you will need to start thinking on your feet and coming up with ways to parry their attacks and barbs. Whether it means you have to document your work so you can prove how busy you are (great for when they make you feel bad for not being productive enough,) or start keeping a work diary or an awesomeness journal to document your successes and prove your value, it’s time to start a paper trail in your favor to use when your boss complains. Worst case, it’s a paper trail you can use when applying to new jobs.
  • Let your boss know. This one’s really tricky, but if your boss is a bad boss not out of malice but out of ignorance or ineptitude, a tactful and professional approach may work wonders. Of course, this won’t work on a boss that’s a jerk or just doesn’t care, but if the problem is that they’re busy themselves or suffering under the weight of their own boss and letting it bleed through to you, they may be receptive to change—and once you talk through it, they may be on your side. I can vouch for this from experience. No one wants to be stressed out, and if you can appeal to your boss’s better nature, they may understand and be willing to compromise and work with you instead of against you.
  • Talk to HR or your boss’s boss. Again, you have to really have faith that this may actually work and you won’t be retaliated against. In many cases, a bad boss is just the person standing in front of a worse boss, or the bad boss and their boss have a closer relationship than you think. HR may also be a trap—not every company takes complaints by employees seriously, and as soon as it gets back to your boss, you could be in for it. However, if you do trust your company’s HR rep or your boss’s boss to mediate, or know they value you more than your boss might, talk to them. Focus on the issue or behavior and not the person, and let them know you want to help your boss, and you’re otherwise happy and engaged in your role, but these very specific things have you stressed out. Ask how they can help, how they’ll follow up, whether your conversations are confidential, and when you can expect to hear from them. Some of what they do is confidential as well, but make sure you get some confirmation you’ve been heard.
  • Just quit. There is a tipping point where nothing you can do will make a bad boss any better, and no amount of exercise after work or therapy is going to change the fact that your boss makes you miserable every day, and in turn you inadvertently make your family and friends miserable when you’re around them. Even if the job is great, it might be time to look for better opportunities where your work will be appreciated. It can be difficult, but your health and your relationships are worth it.

Whatever you do, if your boss is stressing you out and you can see the signs of it seeping into your personal life, you need to do something. What you do is really a matter of the degree of stress you’re feeling. If you think it’s manageable with exercise or meditation, then don’t wait—start now. If you know you’ll never really be able to deal with it, and your boss will never change, more drastic action may be warranted. In the end though, stress impacts your productivity, your health, and now, studies show, the health and well being of the people closest to you. You—and they—deserve better.

How do you deal with an aggravating boss every day, and how do you leave them behind when you leave the office? When do you make the call that it’s time to go? Share your coping mechanisms and stress-relief techniques in the comments below.

excerpt from LifeHacker (copyright)