terça-feira, 25 de outubro de 2011

Installing RedMine on CentOS 5.5 ( includes compatible versions of Ruby, RubyGems and Rails with OpenLDAP)


1. Installing some Packages dependencies

# yum install gcc cc cl.exe
# yum install zlib zlib-devel
# yum groupinstall "Development Tools"
# yum install mysql-devel
# yum install libncurses5 libreadline5



2. Download and install Ruby

# mkdir /opt ; mkdir /opt/ruby
# cd /opt/ruby
# wget http://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p72.tar.gz
# tar -xzvf ruby-1.8.7-p72.tar.gz
# cd ruby-1.8.7-p72
# ./configure
# make
# make install



3. Download and Install RubyGems

# cd /opt/ruby
# wget http://rubyforge.org/frs/download.php/74445/rubygems-1.6.2.tgz
# tar -xzvf rubygems-1.6.2.tgz
# cd rubygems-1.6.2
# ruby setup.rb   # nao pode ser a mais atualizada


4. Install RubyGems Rake, Rack and Rails

# gem install rake  -v '0.8.7'
# gem install rack  -v=1.1.1
# gem install rails -v=2.3.11


5. Install LDAP dependencies

# yum -y install zlib-devel curl-devel openssl-devel httpd-devel apr-devel apr-util-devel
#
# cd /etc/yum.repos.d
# rpm --import http://opensource.wandisco.com/RPM-GPG-KEY-WANdisco
# wget http://opensource.wandisco.com/WANdisco-rhel5.repo
# yum install gcc gcc-c++ curl-devel zlib-devel kernel-devel dkms
# yum install httpd httpd-devel 
# yum install mod_dav_svn subversion subversion-tools subversion-devel
# yum install mod_perl mod_perl-devel perl-Apache-DBI perl-Digest-SHA1 perl-LDAP
#
# perl -MCPAN -e shell
  Are you ready for manual configuration? [yes] 
  CPAN build and cache directory? [/root/.cpan] 
  Cache size for build directory (in MB)? [10] 
  Perform cache scanning (atstart or never)? [atstart] 
  Cache metadata (yes/no)? [yes] 
  Your terminal expects ISO-8859-1 (yes/no)? [yes] 
  File to save your history? [/root/.cpan/histfile]
  Number of lines to save? [100] 
  Policy on building prerequisites (follow, ask or ignore)? [ask] 
  Where is your gzip program? [/bin/gzip]
  Where is your tar program? [/bin/tar] 
  Where is your unzip program? [/usr/bin/unzip]
  Where is your make program? [/usr/bin/make] 
  Where is your links program? [/usr/bin/links] 
  Where is your wget program? [/usr/bin/wget] 
  Warning: ncftpget not found in PATH
  Where is your ncftpget program? /usr/bin/ncftpget
  Where is your ftp program? [/usr/kerberos/bin/ftp] 
  Where is your gpg program? [/usr/bin/gpg]
  What is your favorite pager program? [/usr/bin/less] 
  What is your favorite shell? [/bin/bash] 
  Your choice:  [] 
       :
  cpan> install Authen::Simple::LDAP
       :
       a lot of <enter> 
       :
#
# gem install passenger
# passenger-install-apache2-module



6. Download RedMine

# mkdir /opt/redmine
# cd /opt/redmine
# wget http://rubyforge.org/frs/download.php/75097/redmine-1.2.1.tar.gz


7. Install RedMine


# cd /opt/redmine
# tar -xzvf redmine-1.2.1.tar.gz
# cd /opt/redmine/redmine-1.2.1
# chown -R root:root /opt/redmine/redmine-1.2.1






8. Install RedMine dependencies


# gem install rake     -v '0.8.7'
# gem install rack     -v=1.1.1
# gem install rails    -v=2.3.11
# gem install i18n     -v '0.4.2'
# gem install mysql    # or mysql2 '~> 0.2.7'

# yum install -y libxml2 libxml2-devel libxslt libxslt-devel


9. Create MySql Database for Ruby environments (Production, Development and Test)


# mysql -u root -p
mysql> create database redmine_prod character set utf8;
mysql> create database redmine_dev character set utf8;
mysql> create database redmine_test character set utf8;
mysql> create user 'redmine'@'localhost' identified by 'r3dm1n3';
mysql> grant all privileges on redmine_prod.* to 'redmine'@'localhost';
mysql> grant all privileges on redmine_dev.* to 'redmine'@'localhost';
mysql> grant all privileges on redmine_test.* to 'redmine'@'localhost';
mysql> exit



10. Configure all Ruby environments (Production, Development and Test)


# cd /opt/redmine/redmine-1.2.1
# cp config/database.yml.example config/database.yml
# vim config/database.yml
  +----------------------------+
  | production:                |
  |   adapter: mysql           |
  |   database: redmine_prod   |
  |   host: localhost          |
  |   username: redmine        |
  |   password: r3dm1n3        |
  |   encoding: utf8           |
  |                            |
  | development:               |
  |   adapter: mysql           |
  |   database: redmine_dev    |
  |   host: localhost          |
  |   username: redmine        |
  |   password: r3dm1n3        |
  |   encoding: utf8           |
  |                            |
  | test:                      |
  |   adapter: mysql           |
  |   database: redmine_test   |
  |   host: localhost          |
  |   username: redmine        |
  |   password: r3dm1n3        |
  |   encoding: utf8           |
  +----------------------------+


11. Initialize Ruby database environments (PRODuction and DEVelopment)

# rake generate_session_store
# RAILS_ENV=production  rake db:migrate
# RAILS_ENV=development rake db:migrate

# RAILS_ENV=production rake redmine:load_default_data
  Select language: [en]

# RAILS_ENV=development rake redmine:load_default_data
  Select language: [en]



12. Adjusting apache permission and creating symbolic link

# chown -R apache:apache files log tmp public/plugin_assets
# chmod -R 755 files log tmp public/plugin_assets
# ln -s /opt/redmine/redmine-1.2.1/public /var/www/html/redmine



13. Adjusting apache permission and creating symbolic link

# chown -R apache:apache files log tmp public/plugin_assets
# chmod -R 755 files log tmp public/plugin_assets
# ln -s /opt/redmine/redmine-1.2.1/public /var/www/html/redmine



14. Testing installation running a ad-hoc webapplication server

# ruby script/server webrick -e production
  • open following url in your browser http://localhost:3000
    • admin/admin



15. References




domingo, 2 de outubro de 2011

Installing Tomcat6 on CentOS 5x


1. Installing packages

# yum install yum-priorities

# rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
# rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm

# echo "Install the JPackage Project repository..."

# cd /etc/yum.repos.d/
# wget http://jpackage.org/jpackage50.repo
# yum install java

# echo "Install the Tomcat 6 RPM's ..."
# yum install tomcat6 tomcat6-webapps tomcat6-admin-webapps
#


2. Tip's

   # echo $CATALINA_HOME
   # ls -la /usr/share/tomcat6


3. References




Installing OCS Inventory on CentOs 5.x


1. Download

   # wget http://launchpad.net/ocsinventory-server/stable-1.3/server-release-1.3.1/+download/OCSNG_UNIX_SERVER-1.3.1.tar.gz
   # wget http://rpms.famillecollet.com/el5.i386/perl-XML-Entities-0.02-1.el5.remi.noarch.rpm


2. Install dependencies

   #
   # yum install -y httpd php php-gd php-pecl-zip php-mysql mysql-server  perl-Apache-DBI perl-XML-Simple perl-SOAP-Lite perl-Net-IP perl-XML-SAX-Base perl-Compress-Zlib mod_perl
   #


3. Install software


    3.1. Pre-configuration


   #
   # vim /etc/yum.conf
          :
     gpgcheck=0
          :
   # yum localinstall perl-XML-Entities-0.02-1.el5.remi.noarch.rpm
   # vim /etc/yum.conf
          :
     gpgcheck=1
          :
   # echo configure incializacao automatica caso desejado ...
   # chkconfig httpd on
   # chkconfig mysqld on


    3.2. Install from sources


   #
   # tar -zxvf OCSNG_UNIX_SERVER-1.3.1.tar.gz -C /usr/src/
   # ln -s /usr/src/OCSNG_UNIX_SERVER-1.3.1/ /usr/src/ocs
   #
   # vim /usr/src/ocs/setup.sh
         :
     DB_SERVER_USER="root"
     DB_SERVER_PWD=
         :
   # 
   # cd /usr/src/ocs/
   # ./setup.sh  # answer <enter> for all questions
   #



    3.3. Complete configuration on browser
  • open on your browser de following url: http://lolcahost/ocsreports
  • adjust configurations of  server / username / password and click "send"
  • click link "Click here to enter OCS-NG GUI"


4. References



Installing Cacic on CentOS 5.x


1. Download source from site





2. Download binarys
    a) make temporary install sub-directory
#
# mkdir /opt/cacic
# cd /opt/cacic
#





    b) download binary files


  • http://www.softwarepublico.gov.br/dotlrn/clubs/cacic/file-storage/index?folder_id=22395422& download manual "Cacic versão 2.6.0-Beta-2 - Pasta do Gerente WEB - Completa"





    c) extract binary files
#
# cd /var/www/html
# tar -zxf /opt/cacic/Cacic+versão+2.6.0-Beta-2+-+Pasta+do+Gerente+WEB+-+Completa.tgz
# ls -la # observe a pasta criada 'cacic260b2'
# chown -R apache:apache cacic260b2
# mv cacic260b2 cacic2  # precisa ser cacic2 o diretorio
#



3. Install dependencies and configure

#
# yum install php-mysql php-mcrypt
#
# vim /etc/php.ini
          :
  register_globals = On
  register_long_arrays = On
          :
#
# service httpd reload
# useradd ftpcacic
# passwd ftpcacic # ftpcacic
# mkdir /home/ftpcacic/agentes
# service vsftpd start

yum install php-gd



4. Install and configure web application

   4.1. Open the following url on your browser




   4.2. Configure web application interaface as follow

http-cacic260b2> Tipo Instalacao:
                 [x]  Nova
                      Dados administrador para criar database
                      Usuario  [root]
                      Senha    [****]
                 [ ] Demonstracao - inserir dados para demo
                 Banco de Dados:
                     Tipo       [MySQL] 
                     Servidor   [localhost] 
                     Porta      [3306] 
                     BancoDados [cacic_prod] 
                     usuario    [cacic_db_user]
                     senha      [cacic_db_passwd]
                     
                 clique no botão [Construir DB]
                 
                 clique no botão [Próximo]
                 
                 Dados de Localização:
                     Empresa  [INMETRICS]
                     Sigla    [INM-SPO]
                     Nome     [INMETRICS SAO PAULO]
                 Dados do administrador:
                     Usuario  [admin]
                     Senha    [admin]
                     Nome     [Administrador do Cacic]
                     E-mail   [cacic@inmetrics.com.br]
                     Telefone [(11) 3303-3200]
                 
                 clique no botão [Salvar]
                 
                 clique no botão [Próximo]
                 
                 Configuracoes
                     Servidor      [localhost]
                     Porta         [21]
                     Usuario       [ftpcacic]
                     Senha         [ftpcacic]
                     Sub-Diretorio [agentes]
                 
                 clique no botão [Gravar config.php] Caso falhe item 4.3
                 
                 clique no botão [Finalizar]




   4.3. Complete configuration editing files (caso falhe o Gravar config.php)

          Se você esqueceu de trocar as permissões dos arquivos, é possível que o instalador não consiga gravar o arquivo config.php. Então você deve fazê-lo manualmente. Neste ponto, a conclusão da instalação do CAC/config.php e Copiar o conteudo do arquivo config.php

# vim /var/www/html/cacic260b2//include/config.php # copy-and-paste the contents from install
# mv /var/www/html/cacic260b2/instalador /var/www/html/cacic260b2/instalador_backup
#


   4.4. Removendo scripts de instalação

          Por segurança remova os scripts de instalação, para evitar reinstalação acidental.

# ls -la /var/www/html/cacic2
# rm -rf /var/www/html/cacic2/instalador

#







5. Entre no Sistema

          Efetue login no Cacic com usuário e senha de administração informado http://localhost/cacic







6. Leia a documentação de instalação e configure o módulo gerente

Na opção de menu "Repositório" na barra lateral esquerda Menu >> Repositório >> Manual para instalação e Utilização . Localize o item "5 Menu de Administração"

6.1. Configuração padrão e Senha de administração do agente

Localize a senha de administração do agente e guarde-a Menu >> Administração >> Configurar Padrão 

6.2. Configuração padrão
Localize a senha de administração do agente e guarde-a Menu >> Administração >> Configurar Padrão 
Configure o endereço de e-mail para notificação de alteração de hardware e dispositivos USB