Archive

Archive for the ‘CentOS’ Category

IMAP-Server

May 24, 2012 admin No comments

Dovecot:
http://chemnitzer.linux-tage.de/2010/vortraege/detail.html?idx=439

Categories: CentOS Tags:

How to install graphviz & Redmine 1.2 (CentOS 5.6)

November 2, 2011 admin No comments

Imtall graphviz

# wget -O /etc/yum.repos.d/graphviz-rhel.repo http://www.graphviz.org/graphviz-rhel.repo
# yum install graphviz.x86_64
# yum install graphviz-gd
# yum install graphviz-ruby

 

Imtall wiki_graphviz_plugin

/opt/redmine/vendor/plugins/wiki_graphviz_plugin/

# mkdir /opt/redmine/tmp/wiki_graphviz_plugin
# chown -R apache:apache /opt/redmine/tmp/
# cd /opt/redmine
# /etc/init.d/httpd restart

 

Categories: CentOS, Redmine Tags:

How to install Redmine 1.4 (CentOS 5.8)

January 17, 2011 admin 2 comments

Install the Apache

Install the MySQL 5.1

# yum install mysql mysql-devel mysql-server
# chkconfig --levels 235 mysqld on
# /etc/init.d/mysqld start

Create database for Redmine:

# mysql -u root -p
CREATE DATABASE redmine CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE USER 'redmine'@'localhost' IDENTIFIED BY 'redmine';
GRANT ALL ON redmine.* TO 'redmine'@'localhost';

 

Installing Ruby

# yum install gcc-c++ openssl openssl-devel zlib zlib-devel mysql-devel postgresql-devel subversion wget
# wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7.tar.gz
# tar zxvf ruby-1.8.7.tar.gz
# cd ruby-1.8.7
# ./configure
# make && make install

math.c:37:13: error: missing binary operator before token "("
make: *** [math.o] Error 1
Just open math.c [Don’t locate any where just use vi math.c from the same same location where you are executing the command ‘make’]
And look at the line
“#elif define(ERANGE)” it should be “#elif defined(ERANGE)”
Note: not “define”, it is “defined” => d is missing in this phrase

 

Installing RubyGems

# wget http://production.cf.rubygems.org/rubygems/rubygems-1.8.7.tgz
# tar zxvf rubygems-1.8.7.tgz
# cd rubygems-1.8.7
# ruby setup.rb

 

Installing Redmine

# cd /opt
# svn co http://redmine.rubyforge.org/svn/branches/1.4-stable redmine-1.4

Installing Bundler

# gem install bundler

Installing Rails

# cd /opt/redmine-1.4
# bundle install --without development test postgresql sqlite rmagick

 

Created lets configure our database settings for Redmine:

# cd /opt/redmine-1.4
# cp  config/database.yml.example config/database.yml

Edit config/database.yml and set your settings:

# vi config/database.yml
 production:
    adapter: mysql
    database: redmine
    host: localhost
    username: redmine
    password: redmine

Generate a session store secret:

# cd /opt/redmine-1.4
# rake config/initializers/session_store.rb

Create the database structure:

# RAILS_ENV=production rake db:migrate
# RAILS_ENV=production rake redmine:load_default_data

Configure email settings:

cd /opt/redmine-1.4
cp config/email.yml.example config/email.yml

 

Option 1. Running under Apache

# yum install httpd-devel curl-devel apr-devel gcc gcc-c++
# gem install passenger
# passenger-install-apache2-module
# cd /opt/redmine-1.4
# chown -R root:root .
# chown -R apache:apache files log tmp public/plugin_assets
# chmod -R 755 files log tmp public/plugin_assets
# chown -R apache:apache config/environment.rb
# vi /etc/httpd/conf.d/passenger.conf
LoadModule passenger_module /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.12/ext/apache2/mod_passenger.so
PassengerRoot /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.12
PassengerRuby /usr/local/bin/ruby

# delete HTTP header which would be added by Passenger
Header always unset "X-Powered-By"
Header always unset "X-Rack-Cache"
Header always unset "X-Content-Digest"
Header always unset "X-Runtime"

# for passenger tuning
PassengerLogLevel 0
RailsAutoDetect On
PassengerMaxPoolSize 20
PassengerMaxInstancesPerApp 4
PassengerPoolIdleTime 3600
PassengerUseGlobalQueue on
#PassengerHighPerformance on !!! conflict with DAV svn
PassengerStatThrottleRate 10
RailsSpawnMethod smart
RailsAppSpawnerIdleTime 86400
RailsFrameworkSpawnerIdleTime 0
PassengerUserSwitching On
PassengerDefaultUser apache
PassengerMaxRequests 3000
PassengerMinInstances 3
# vi /etc/httpd/conf/httpd.conf
DocumentRoot "/opt/redmine-1.4/public"
# ln -sf /opt/redmine-1.4/public /var/www/html/redmine

Redmine under a subdirectory

# vi /etc/httpd/conf/httpd.conf
RailsAutoDetect off
PassengerAppRoot /opt/redmine-1.4
RailsBaseURI  /redmine
Alias "/redmine" /opt/redmine-1.4/public

Check disable SElinux !!!
[error] *** Passenger could not be initialized because of this error: Unable to start the Phusion Passenger watchdog (/usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.11/agents/PassengerWatchdog): Permission denied (13)
How to disable SElinux

Option 2. Running under Apache

# 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
# yum update
# yum install curl-devel apr-devel
# yum install openssl openssl-devel
# yum install zlib zlib-devel
# yum install gcc gcc-c++
# yum install subversion mod_dav_svn
# yum install perl-HTML-Parser perl-SVN-Notify

Installing Thin

# gem install thin
# thin install
# chkconfig --levels 235 thin on

Configure Thin

# thin config -C /etc/thin/redmine.yml -c /opt/redmine --servers 3 -e production
# service thin start

 

Configure Apache and add a Redmine config file

# vi /etc/httpd/conf/httpd.conf

Uncomment

NameVirtualHost *:80
# vi /etc/httpd/conf.d/redmine.conf
<VirtualHost *:80>
        DocumentRoot /opt/redmine-1.4
        ServerName redmine.how2centos.com
        <Proxy balancer://redminecluster>
                 BalancerMember http://127.0.0.1:3000
                 BalancerMember http://127.0.0.1:3001
                 BalancerMember http://127.0.0.1:3002
        </Proxy>
        ProxyPass / balancer://redminecluster/
        ProxyPassReverse / balancer://redminecluster/
        ErrorLog /var/log/httpd/redmine_error.log
        CustomLog /var/log/httpd/redmine_access.log combined
</VirtualHost>

(13)Permission denied: proxy: HTTP: attempt to connect
# setsebool -P httpd_can_network_connect=1

Option 3. Starting Redmine on built-in WEBrick web server

# cd /opt/redmine-1.4
# ruby script/server webrick -p 8000 -e production

Change IPTables

# vi /etc/sysconfig/iptables

Includes the following before the REJECT line:

-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 8000 -j ACCEPT
# service iptables restart

 
After its started you can access Redmine on the following URL:

http://your.ser.ver.ip:8000/

Use default administrator account to log in:

    * login: admin
    * password: admin

 

Optional Intall ImageMagick

# yum install ImageMagick ImageMagick-devel libpng libpng-devel freetype freetype-devel giflib giflib-devel
# yum erase ImageMagick ImageMagick-devel
# wget ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick.tar.gz
# tar -xzvf ImageMagick.tar.gz
# cd ImageMagick-6.6.7-6
# ./configure --without-perl
# make
# make install
gem install rmagick

 
Can’t install RMagick 2.13.1. Can’t find MagickWand.h.

C_INCLUDE_PATH=/usr/src/ImageMagick-6.7.4-8 gem install rmagick

 

Optional Imtall SVN

# yum install mod_dav_svn subversion
# mkdir /opt/svn
# chown root:apache /opt/svn
# chmod 0750 /opt/svn
# ln -s /opt/redmine/extra/svn/Redmine.pm /usr/lib/perl5/5.8.8/Redmine.pm

 

# vi /etc/httpd/conf.d/svn.conf
PerlLoadModule Redmine
<Location /svn>
    DAV svn
    SVNParentPath "/opt/svn"
    AuthType Basic
    AuthName "Redmine SVN Repository"
    Require valid-user

    PerlAccessHandler Apache::Authn::Redmine::access_handler
    PerlAuthenHandler Apache::Authn::Redmine::authen_handler

    RedmineDSN "DBI:mysql:database=redmine;host=localhost"

    RedmineDbUser "redmine"
    RedmineDbPass "redmine"
</Location>

 

Optional Autocreate Subversion Repositories

Go to Administration -> Settings -> Repositoryand check Enable WS for repository management.

# vi /etc/cron.d/redmine
*/10 * * * * root ruby /opt/redmine/extra/svn/reposman.rb --redmine localhost --svn-dir /opt/svn/ --owner apache --url file:///opt/svn/ --verbose >> /var/log/reposman.log

 

Trac to Redmine migration

# yum install ruby-devel sqlite sqlite-devel ruby-rdoc
# gem install sqlite3-ruby --version=1.2.5
# rake redmine:migrate_from_trac RAILS_ENV=production --trace

Upgrade 1.3 to 1.4

A key is required to write a cookie containing the session data. Use config.action_controller.session = { :key => “_myapp_session”, :secret => “some secret phrase” } in config/environment.rb

#rake config/initializers/session_store.rb
Categories: CentOS, Redmine Tags:

How to use floating license & RIS

May 13, 2010 admin No comments

RIS License modul installation (CentOS 5.4)

# cd /usr/lib/php/modules/
# wget --http-user=*** --http-passwd=*** http://www.rillsoft.de/download/src/centos/5.4/i386/PHP_5.2.10/ris.so
# echo "extension=ris.so" > /etc/php.d/ris.ini
# /etc/init.d/httpd restart

For CentOS 5.4 64 Bit http://www.rillsoft.de/download/src/centos/5.4/x86_64/PHP_5.2.10/ris.so
For Ubuntu 10.04 32 Bit + PHP 5.3.2 http://www.rillsoft.de/download/src/ubuntu/10.04/i386/PHP_5.3.2/ris.so
For Ubuntu 10.04 64 Bit + PHP 5.3.2 http://www.rillsoft.de/download/src/ubuntu/10.04/amd64/PHP_5.3.2/ris.so

Verify it using the following command

# php -i | grep ris

 

Categories: CentOS, Rillsoft Tags:

How to install RIS (CentOS 5.4)

May 7, 2010 admin No comments

RIS installation

# cd /var/www/html
# rm ris_mysql.zip
# wget --http-user=*** --http-passwd=*** http://www.rillsoft.com/download/src/ris_mysql.zip
# unzip -uo ris_mysql.zip -d /var/www/html/ris
# chmod -R 777 cache log blob
# chown -R apache:apache /var/www/html
# php symfony cc

 

Configure Apache 2

Open httpd.conf

# vi /etc/httpd/conf/httpd.conf

At the end of your config file you’ll need to add the following code:

DocumentRoot /var/www/html/web
<Directory /var/www/html/web>
   <IfModule sapi_apache2.c>
      php_admin_flag engine on
      php_admin_flag safe_mode off
      php_admin_value open_basedir none
   </IfModule>
   <IfModule mod_php5.c>
      php_admin_flag engine on
      php_admin_flag safe_mode off
      php_admin_value open_basedir none
   </IfModule>
   Options +FollowSymLinks -Indexes
   AllowOverride All
</Directory>

Alias /sf /var/www/html/lib/vendor/symfony/data/web/sf
<Directory /var/www/html/lib/vendor/symfony/data/web/sf>
   AllowOverride All
   Allow from All
</Directory>
# /etc/init.d/httpd restart

 

PHP configuration check

Execute the check script.

# cd /var/www/html
# php lib/vendor/symfony/data/bin/check_configuration.php

You will see the following results:

********************************
*                              *
*  symfony requirements check  *
*                              *
********************************

php.ini used by PHP: /etc/php.ini

** WARNING **
*  The PHP CLI can use a different php.ini file
*  than the one used with your web server.
*  If this is the case, please launch this
*  utility from your web server.
** WARNING **

** Mandatory requirements **

  OK        PHP version is at least 5.2.4 (5.2.10)

** Optional checks **

  OK        PDO is installed
  OK        PDO has some drivers installed: mysql, odbc, sqlite
  OK        PHP-XML module is installed
  OK        XSL module is installed
  OK        The token_get_all() function is available
  OK        The mb_strlen() function is available
  OK        The iconv() function is available
  OK        The utf8_decode() is available
  OK        A PHP accelerator is installed
  OK        php.ini has short_open_tag set to off
  OK        php.ini has magic_quotes_gpc set to off
  OK        php.ini has register_globals set to off
  OK        php.ini has session.auto_start set to off
  OK        PHP version is not 5.2.9

 

Database configuration

Open databases.yml

# vi  /var/www/html/config/databases.yml

Make sure to change host, dbname, myUser and myPassword to match your account.

dev:
  propel:
    param:
      classname: DebugPDO
      debug: { realmemoryusage: true, details: { time: { enabled: true }, slow: { enabled: true, threshold: 0.1 }, mem: { enabled: true }, mempeak: { enabled: true }, memdelta: { enabled: true } } }
test:
  propel:
    param:
      classname: DebugPDO
all:
  propel:
    class: sfPropelDatabase
    param:
      classname: PropelPDO
      dsn: 'mysql:host=localhost;dbname=ris'
      username: myUser
      password: myPassword
      encoding: utf8
      persistent: true
      pooling: true

 

# vi  /var/www/html/config/propel.ini
propel.targetPackage       = lib.model
propel.packageObjectModel  = true
propel.project             = ris
propel.database            = mysql
propel.database.driver     = mysql
propel.database.createUrl  = ${propel.database.url}
propel.database.url        = mysql:host=localhost;dbname=ris
propel.database.user       = myUser
propel.database.password   = myPassword
propel.database.encoding   = utf8
...

 

Configuration for Swift_FailoverTransport

# vi  /var/www/html/apps/frontend/config/factories.yml
...
  mailer:
    class: sfMailer
    param:
      logging:            %SF_LOGGING_ENABLED%
      charset:            %SF_CHARSET%
      delivery_strategy:  realtime
      transport:
        class:            Swift_SmtpTransport
        param:
          host:           smtp.googlemail.com
          port:           465
          encryption:     ssl
          username:       myUser
          password:       myPassword
...

 

Initialize database

Run the following symfony tasks:

# cd /var/www/html
# php symfony cc
# php symfony propel:insert-sql --no-confirmation
# php symfony propel:data-load --trace --env=dev --application=frontend
Categories: CentOS, Rillsoft Tags:

How to disable SElinux (CentOS 5.4)

May 7, 2010 admin No comments
# vi /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
SELINUX=disabled
# SELINUXTYPE= type of policy in use. Possible values are:
# targeted - Only targeted network daemons are protected.
# strict - Full SELinux protection.
SELINUXTYPE=targeted
# SETLOCALDEFS= Check local definition changes
SETLOCALDEFS=0
# shutdown -r now
Categories: CentOS Tags:

How to install Samba (CentOS 5.4)

May 6, 2010 admin No comments
# yum install cups-libs samba samba-common
# mv /etc/samba/smb.conf /etc/samba/smb.conf.orig
# vi /etc/samba/smb.conf
[global]
workgroup = CentOS
netbios name = CentOS
name resolve order = bcast host lmhosts wins
server string = Samba Server Version %v
security = user
passdb backend = tdbsam

[www]
comment = Public WWW
path = /var/www
create mask = 0660
directory mask = 0771
writable = yes
# chkconfig --levels 235 smb on
# /etc/init.d/smb start
# smbpasswd -a root
# /etc/init.d/smb restart

Change IPTables

# vi /etc/sysconfig/iptables

Includes the following before the REJECT line:

-A RH-Firewall-1-INPUT -p udp -m udp --dport 137 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp -m udp --dport 138 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 139 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 445 -j ACCEPT
# service iptables restart

Check disable SElinux !!!
How to disable SElinux

net use  Z: \\***.***.***.***\www /user:root
Categories: CentOS Tags:

How to install PHP APC (CentOS 5.4 & Plesk 9.3 bei hosteurope.de)

May 5, 2010 admin No comments
# yum install php-pear
# yum install php-devel
# yum install httpd-devel
# pecl install apc
# echo "extension=apc.so" > /etc/php.d/apc.ini
# /etc/init.d/httpd restart

Verify it using the following command

# php -i | grep apc
Categories: CentOS, PHP Tags:

How to install Apache2 (CentOS 5.4)

May 5, 2010 admin No comments
# yum install httpd httpd-devel
# chkconfig --levels 235 httpd on
# /etc/init.d/httpd start

Change IPTables

# vi /etc/sysconfig/iptables

Includes the following before the REJECT line:

-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT
# service iptables restart

Check disable SElinux !!!
How to disable SElinux

Categories: CentOS Tags:

How to install MySQL (CentOS 5.4)

February 17, 2010 admin No comments
# yum install mysql mysql-devel mysql-server
# chkconfig --levels 235 mysqld on
# /etc/init.d/mysqld start

 

# mysql -u root -p
CREATE DATABASE ris CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE USER 'ris'@'localhost' IDENTIFIED BY 'myPassword';
GRANT ALL ON ris.* TO 'ris'@'localhost';
Categories: CentOS, MySQL Tags: