segunda-feira, 28 de novembro de 2011

Installing SVN on CentOs 5.x

1. Installing

# yum install mod_dav_svn subversion

2. Configure

2.1 Configure /etc/httpd/conf.d

# vim /etc/httpd/conf.d/subversion.conf

# Needed to do Subversion Apache server.
LoadModule dav_svn_module     modules/mod_dav_svn.so
# Only needed if you decide to do "per-directory" access control.
LoadModule authz_svn_module   modules/mod_authz_svn.so
#
# Example location directive.
#
<Location /svn/repos>
   DAV svn
   SVNPath /var/www/svn/repos
#
#   # Limit write permission to list of valid users.
#   <LimitExcept GET PROPFIND OPTIONS REPORT>
#      # Require SSL connection for password protection.
#      # SSLRequireSSL
#
      AuthzSVNAccessFile /etc/svn-acl-conf
      AuthType Basic
      AuthName "Subversion repos"
      AuthUserFile /etc/svn-auth-conf
      Require valid-user
#   </LimitExcept>
</Location>

2.2 Creating your first user

#
#  htpasswd -cm  /etc/svn-auth-conf root




2.3 Configuring ACL


# vim /etc/svn-acl-conf
  [repos:/]
  user = access
  [groups]
  staff = root 



3. Create repository root directory

# cd /var/www
# mkdir svn
# cd /var/www/svn
# svnadmin create repos
# chown -R apache:apache repos
# service httpd restart
#



4. Starting Svn Service as a deamon


# svnserve -d -r /var/www/svn/repos





5. Referencias

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



sexta-feira, 30 de setembro de 2011

Installing Oracle 10g on CentOs 5x


1. Download

# mkdir /opt/oracle
# mkdir /opt/oracle/oracle10gx86linux
# cd /opt/oracle/oracle10gx86linux
# wget http://download.oracle.com/otn/linux/oracle10g/10201/10201_database_linux32.zip
#


2. Pre-requirements


# yum install compat-db sysstat libaio-devel libXp
#
# vim /etc/sysctl.conf  # editar parametros de kernel
       :
  kernel.shmmax = 2147483648
  kernel.shmall = 2097152
  kernel.shmmni=4096
  kernel.sem=250 32000 100 128
  fs.file-max=65536
  net.ipv4.ip_local_port_range=1024 65000
  net.core.rmem_default=1048576
  net.core.rmem_max=1048576
  net.core.wmem_default=262144
  net.core.wmem_max=262144          
      :
# /sbin/sysctl -p /etc/sysctl.conf
#
# vim /etc/security/limits.conf   # editar parametros de seguranca
       :
  oracle              soft    nproc   2047
  oracle              hard    nproc   16384
  oracle              soft    nofile  1024
  oracle              hard    nofile  65536
       :
# vim /etc/pam.d/login
       :
  session    required     /lib/security/pam_limits.so
  session    required     pam_limits.so
       :
# vim /etc/profile
       :
  # Oracle 10g
  if [ $USER = "oracle" ]; then
     if [ $SHELL = "/bin/ksh" ]; then
        ulimit -p 16384
        ulimit -n 65536
     else
        ulimit -u 16384 -n 65536
     fi
  fi
       :
#
# cp /etc/redhat-release /etc/redhat-release.original   # backup original release
# echo redhat-4? > /etc/redhat-release                  # redhat-4 fake
#
# groupadd  oinstall
# groupadd  dba
# useradd -m -g oinstall -G dba -d /home/oracle -s /bin/bash -c "Oracle Software Owner" oracle
# passwd oracle
  New UNIX password: oracle
  Retype new UNIX password: oracle
#


3. Run Oracle Installer

   #
   # su - oracle
   # cd /opt/oracle/oracle10gx86linux
   # ./runInstaller  # se o bicho pegar tente a) usar o parametro -ignoreSysPrereqs; b) fazer login como oracle na interface grafica ao inves de su
      [x] Basic Installation
          Oracle Home Location: /home/oracle/product/10.2.0/db_1
          Installation Type   : Enterprise Edition (1.3GB)
          DBA Group           : oinstall
          [x] Create Starter Database
          Global Database Name: orcl
          Database Password   : manager10g
          Enter full path inventory directory: /home/oracle/oraInventory
          Specify OSGroupName : oinstall
          Check Network Config Requirements [x]
      [x] Advanced Installation
          DBA Group : oinstall
          Enter or select a name for installation: OraDb10g_home1
          Path      : /home/oracle/oracle/product/10.2.0/db_1
          Components:
                      [x] Oracle Call Interface (OCI) 10.2.0.1.0
                      [x] Oracle Programmer (OCI) 10.2.0.1.0
          # 


4. References



Installing Open LDAP and PhpLDAPAdmin on CentOS 5x


1. Install required Packages

# yum install openldap openldap-servers openldap-devel compat-openldap
# yum install php-ldap openldap-clients


2. Generating Hash password

# slappasswd -s josemarsilva
# {SSHA}Qb8a4HFCjVJ4kMu27OKASUE13AWu7eJr


3. Configure OpenLDAP 

# vim /etc/openldap/slapd.conf
       :
  include /etc/openldap/schema/core.schema
  include /etc/openldap/schema/cosine.schema
  include /etc/openldap/schema/inetorgperson.schema
  include /etc/openldap/schema/nis.schema
       :
  allow bind_v2
       :
  pidfile /var/run/openldap/slapd.pid
  argsfile /var/run/openldap/slapd.args
       :
  database bdb
       :
  suffix         "dc=josemarsilva,dc=com"             # Directory Structure ...
  rootdn         "cn=Manager,dc=josemarsilva,dc=com"  # ... and administrador ...
  rootpw {SSHA}Qb8a4HFCjVJ4kMu27OKASUE13AWu7eJr       # ... password hashed (previous step)
       :
  directory /var/lib/ldap
       :
  index objectClass eq,pres
  index ou,cn,mail,surname,givenname eq,pres,sub
  index uidNumber,gidNumber,loginShell eq,pres
  index uid,memberUid eq,pres,sub
  index nisMapName,nisMapEntry eq,
       :
#


4. Start OpenLDAP server and configure automatic startup with system

# service ldap start
# netstat -lnt | grep ":389"  # verifique servico ativo na porta 389
# chkconfig ldap on
#


5. Querying something from OpenLDAP databases

     5.a) Consider that everything was installed successfully, you should get this result

# ldapsearch -x -LLL -b '' -s base '(objectclass=*)' namingContexts
  +---------------------------------------+
  |dn:                                    |
  |namingContexts: dc=josemarsilva,dc=com |
  +---------------------------------------+
#


6. Installing PhpLDAPAdmin



    6.1. Installing


# yum install phpldapadmin 

#
# service httpd start  # iniciado o servico http do Apache
#

    6.2. Checking your browser and access following url


# http://localhost/phpldapadmin - login anonymous
#


7. References

  • http://blog.lcmm.info/?p=105
  • http://www.howtoforge.com/install-and-configure-openldap-on-centos-5
  • http://en.wikipedia.org/wiki/Plain_text



Installing MySQL 5.5 on CentOS 5x

1. Introduction

I suppose you want to uninstall previous version of MySQL before installing new version 5.5. So, this script does "uninstall previous version", including databases. If you want to save your data to migrate to 5.5 version you *must* backup your database before upgrade.Please read and understand this !!!


2. Uninstalling previous version of MySQL


# service mysqld stop               # stop service MySQL if running ...
# yum -y remove mysql               # ... remove previous version 



3. Installing Packages


# rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
# yum --enablerepo=remi,remi-test list mysql mysql-server                # check if avaialbe
# yum --enablerepo=remi,remi-test install mysql mysql-server mysql-devel # install from rmi repos
# yum --enablerepo=remi,remi-test install mysql mysql-server mysql-devel # install from rmi repos


4. Configuring MySQL


    4.1. Configure MySQL to startup with system


# chkconfig --add mysqld    # configure MySQL to ...
# chkconfig mysqld on       # ...  startup with system

  4.2. Configure MySQL security

# mysql_secure_installation # configurar segurança do MySQL
  +-------------------------------------------------------------+
  | Enter current password for root (enter for none): <enter>   |
  | Set root password? [Y/n] Y <enter>                          |
  | New password: mysecret <enter>                              |
  | Re-enter new password: mysecret <enter>                     |
  | Remove anonymous users? [Y/n] Y <enter>                     |
  | Disallow root login remotely? [Y/n] Y <enter>               |
  | Remove test database and access to it? [Y/n] Y <enter>      |
  | Reload privilege tables now? [Y/n] Y <enter>                |
  +-------------------------------------------------------------+


  4.3. Configure some performance parameters

# vim vi /etc/my.cnf  # configure o MySQL
  +- /etc/my.cnf --------------------------+
  |  ## InnoDB                             |
  | innodb-buffer-pool-size        = 128M  |
  | innodb-log-file-size           = 100M  |
  | innodb-log-buffer-size         = 8M    |
  | innodb-file-per-table          = 1     |
  | innodb-open-files              = 300   |
  +----------------------------------------+



  4.4. Restart MySQL Service

# service mysqld restart




5. Install driver PHP x MySQL

# yum -y install php-mysql             # install drivers Php x MySQL



6. References