Showing posts with label GIT. Show all posts
Showing posts with label GIT. Show all posts

Wednesday, 2 March 2016

Install SVN Versioning Server On CentOS 6.5:


Install SVN Versioning Server On CentOS 6.5:
============================


SVN – Apache subversion

SVN – Subversion is a versioning and revision control system used by developers to track and keep up earlier versions of their source codes.


# yum update

Before installing SVN packages, you must install and configure apache ( Webserver ) .
Install and configure apache

Step 1 » Type the below command to install apache along with dependencies.

# yum install httpd

Step 2 » Open the file /etc/httpd/conf/httpd.conf .

and add this line below . “ServerName youripaddress:80″

#ServerName www.example.com:80
ServerName 192.168.1.2:80

Step 3 » Issue the below command to start apache service .

# service httpd start

and type this below command to start apache service automatically while booting.

# chkconfig httpd on

Now open your server ip address in the browser . you can see the apache test page.

If you not able to see the apache test page, Disable the firewall ( iptables ) and selinux service on your server .
Disable firewall ( Iptables ) »
[root@krizna ~]# service iptables stop
[root@krizna ~]# chkconfig iptables off

Disable Selinux » open the file /etc/selinux/config and find the line
SELINUX=enforcing

and replace with
SELINUX=disabled

now reboot the server and try again.
Install and configure svn server

Step 4 » Now start installing svn packages, Just type the below command .

# yum install subversion mod_dav_svn

Step 5 » Now create new directory for svn repository.

# mkdir /svn

Step 6 » Create a new repository in the svn by issuing the below command

# svnadmin create /svn/newrep

Step 7 » Now issue the below commands one by one for necessary permissions.

# chown -R apache.apache /svn/newrep/

# chcon -h system_u:object_r:httpd_sys_content_t /svn/newrep/

# chcon -R -h apache:object_r:httpd_sys_content_t /svn/newrep/

Step 8 » Now create a password file “newrep.users” with username “krizna” by typing below command

# htpasswd -cm /svn/newrep.users admin

Step 9 » Now open the SVN apache config file ( /etc/httpd/conf.d/subversion.conf ) and add the below lines at the end of the file .

   
<location /repos>
DAV svn
# SVN path
SVNParentPath /svn
AuthType Basic
AuthName "Authorization Realm"
#password file path
AuthUserFile /svn/newrep.users
Require valid-user
</location>

:wq

Step 10 » Restart apache service
[root@krizna ~]# service httpd restart

Step 11 » Now open your svn path http://yourserverip/repos/newrep in a browser( Ex: http://192.168.1.2/repos/newrep ) . you can see newrep revision page after typing username and password created (step 8).

Step 12 » Create basic repository structure with the below commands

# mkdir -p /tmp/svn/{trunk,branches,tags}

# svn import -m 'Initializing basic repository structure' /tmp/svn/ http://localhost/repos/newrep/

Step 13 »  Now you can see updated revision and structure details .

http://192.168.100.120/repos/newrep


Disable anonymous access
If you want to disable the anonymous user to access the repository, just  edit the following line in ‘ostechnix_repo/conf/svnserver.conf’ file.

[root@server ~]# vi /var/www/svn/ostechnix_repo/conf/svnserve.conf
## Line no 12 - Uncomment and Change to 'none' ##
anon-access = none
## Line No 27 - Uncomment to enable acess control ##
authz-db = authz



Ref:
https://ostechnix.wordpress.com/2013/04/30/install-subversion-server-in-centos-6-4-rhel-6-4-scientific-linux-6-4/
http://tecadmin.net/setup-svn-subversion-server-on-centosrhel-56-fedora/
https://www.howtoforge.com/how-to-install-svn-with-apache-dav_svn-on-centos-7
http://www.krizna.com/centos/install-svn-server-on-centos-6/
http://wiki.centos.org/HowTos/Subversion

=================================================================================================================

How To Install Websvn In CentOS :

WebSVN offers a view onto your subversion repositories that’s been designed to reflect the Subversion methodology. You can view the log of any file or directory and see a list of all the files changed, added or deleted in any given revision. You can also view the differences between two versions of a file so as to see exactly what was changed in a particular revision.

Features

WebSVN offers the following features:

    Easy to use interface;
    Customisable templating system;
    Colourisation of file listings;
    Blame view;
    Log message searching;
    RSS feed support.

Installation:

1 – Download the websvn to /var/www/html.

# cd /var/www/html
# wget http://websvn.tigris.org/files/documents/1380/49057/websvn-2.3.3.zip

2 – Extract the zip package.

# unzip websvn-2.3.3.zip

# mv websvn-2.3.3 websvn

3 – Installl php to your system.

# yum install php

4 – Edit web svn config.

# cd /var/www/html/websvn/include

# cp distconfig.php config.php

# vi config.php

// Configure these lines if your commands aren't on your path.
//
 $config->setSVNCommandPath('/usr/bin'); //  e.g. c:\\program files\\subversion\\bin
 $config->setDiffPath('/usr/bin');

// For syntax colouring, if option enabled...
 $config->setEnscriptPath('/usr/bin');
 $config->setSedPath('/bin');

// For delivered tarballs, if option enabled...
 $config->setTarPath('/bin');

// For delivered GZIP'd files and tarballs, if option enabled...
 $config->setGZipPath('/bin');

//
$config->parentPath('/svn/');

$extEnscript[".pl"] = "perl";
$extEnscript[".py"] = "python";
$extEnscript[".sql"] = "sql";
$extEnscript[".java"] = "java";
$extEnscript[".html"] = "html";
$extEnscript[".xml"] = "html";
$extEnscript[".thtml"] = "html";
$extEnscript[".tpl"] = "html";
$extEnscript[".sh"] = "bash";

:wq

# service httpd restart

Browse websvn now:

http://192.168.100.120/websvn/

Note: if you got error can not find enscript toosl under /usr/bin/enscript

Then fire below command and restart http and browse once again:

#  yum install enscript



Refer:

http://linoxide.com/linux-how-to/install-websvn-subversion-centos-7/
http://www.unixmen.com/install-websvn-centos-7/

Redmine Installation in CentOS 6.5



1. Install CentOS 6.5 with yum updated

# yum update

After the update completed, we need to restart the system using the following command :

# reboot

Install the dependencies packages

# yum install nano zip unzip libyaml-devel zlib-devel curl-devel openssl-devel httpd-devel apr-devel apr-util-devel mysql-devel gcc ruby-devel gcc-c++ make postgresql-devel ImageMagick-devel sqlite-devel perl-LDAP mod_perl perl-Digest-SHA rmagick


Install Apache and MySQL:
=========================

Apache is a server application for communicating over the HTTP protocol. Apache runs on operating systems such as Unix, Linux, Microsoft Windows, and other operating systems.

Apache play an important role in the development of the internet and the world wide web.

MySQL is the database management free open source most popular on the world, MySQL has high speed, stability and ease of use, portability, operating on multiple operating systems offer a large system is very powerful utility functions.

With the speed and high security, MySQL is well suited for applications that access databases on the internet.

Use the following command to install :

# yum install httpd mysql mysql-server

Allow start services when OS boot :

chkconfig httpd on
chkconfig mysqld on
service httpd start
service mysqld start

Set the password for MySQL

/usr/bin/mysql_secure_installation

Because we not have a password for the root account so you press Enter to skip.

Enter current password for root (enter for none):

Select Yes to set the password for the MySQL root account.

Set root password? [Y/n] y

Enter and confirm your password, remove the anonymous user, select Yes

Remove anonymous users? [Y/n] y

Allow remote login to MySQL as root account, select No.

Disallow root login remotely? [Y/n] n

Delete the test database, select Yes

Remove test database and access to it? [Y/n] y

Reload privilege tables, select Yes

Reload privilege tables now? [Y/n] y

Turn off SELinux

SELinux is a security feature advanced for Linux operating system, when installing the system you need to turn off this feature to get the process done smoothly, after successful you can turn on back if you want.

# vim /etc/selinux/config

Change the file content :

SELINUX=disabled

:wq

Set up the Hostname

By default when installing a new OS Centos not set the hostname, so we need to setting with the command :

# vim /etc/hosts

Add your domain name or host name that you set on both the command line, save the file and exit, the server name will be changed when restarting.

192.168.100.116  redmine.example.com    redmine

:wq


Configuring the Firewall:
=========================

We do not want to turn off the firewall because it's quite important, so you need to add rules to allow port 80 for HTTP and port 443 for HTTPS.

In the Centos OS, you can configuration firewall by editing files iptables and ip6tables.

# vim /etc/sysconfig/iptables

Press Enter to create a new line after the line of port 22, copy the following two commands and right click on the window to the Paste command.

-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT

:wq

The same applies for IP6 firewall :

# vim /etc/sysconfig/ip6tables

Add these lines to the file.

-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT

:wq

After you finish editing both files, run the commands to apply the new rules for firewall.

# /etc/init.d/iptables restart
# /etc/init.d/ip6tables restart

Allow turn on the firewall when reboot the operating system.

# chkconfig iptables on
# chkconfig ip6tables on

Finally, we need to restart the system to apply the changes to the SELinux and Hostname.

# reboot

Install PHP and phpMyAdmin:
===========================

Because we use MySQL database management system, so we need to install phpMyAdmin program management.

phpMyAdmin is a free open source tool written by PHP language to manage MySQL database via a web browser.

It can create, modify or delete databases, tables, fields or records, perform SQL statements, or managing users and permissions.

The command to install PHP and the packages :

# yum -y install php php-mysql php-gd php-imap php-ldap php-mbstring php-odbc php-pear php-xml php-xmlrpc php-pecl-apc php-soap

Restarting the Apache service :

# service httpd restart

And install phpMyadmin :

# rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
# yum install http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
# yum -y install phpmyadmin

Editing the virtual host file to allow remote login to the phpMyadmin.

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

Replace text "Allow from 127.0.0.1" to "Allow from all", save the file and exit.

Editing the configuration file for the phpMyadmin

# vim /usr/share/phpmyadmin/config.inc.php

Replace text :

$cfg['Servers'][$i]['auth_type'] = 'cookie';

To :

$cfg['Servers'][$i]['auth_type'] = 'http';

Save the file and exit, restarting the Apache service :

# service httpd restart

After successfully installed phpMyadmin, you can check at the address :

http://your-domain/phpmyadmin

Login with account : root / your_mysql-password

With Password has been set at step install MySQL database in the above.


Note: If you install the Redmine system on the PC or in a virtual machine which not on the dedicated server, we need to switch the application phpMyadmin to run on port 8080 because port 80 will be used for Redmine in the next steps.

We need add a port 8080 to the firewall and change the VirtualHost for phpMyadmin.

# vim /etc/sysconfig/iptables

Add the command line :

-A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT

The same applies for IP6 firewall :

# vim /etc/sysconfig/ip6tables

Add the command line :

-A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT

Restarting firewall service to allow the new port.

# /etc/init.d/iptables restart
# /etc/init.d/ip6tables restart

Editing the VirtualHost file to run phpMyadmin on the port 8080

# vim /etc/httpd/conf/httpd.conf

Change the file content :

<VirtualHost *:8080>
    DocumentRoot /usr/share/phpmyadmin/
    ServerName 192.168.100.116
</VirtualHost>

:wq

Next, add the command to allows listening on the port 8080 in the file "httpd.conf"

# vim /etc/httpd/conf/httpd.conf

Add the command line :

Listen 8080

Save the file and exit, restarting the Apache service :

# service httpd restart

Now, phpMyadmin will run on the port 8080 at the address :

http://your-domain:8080


Install Ruby:
=============


Ruby is a object-oriented programming language, capable of reflection. Syntax inherited from Ada and Perl with object-oriented features of Smalltalk, and also share some features with Python, Lisp, Dylan and CLU, Ruby is a single phase interpreter.

Ruby provides programming patterns, including functional programming, object-oriented, imperative, reflective, it uses dynamic variable and automatic memory management.

Install Ruby interpreter with version management program RVM.

# \curl -L https://get.rvm.io | bash

After successful, we will launch RVM

# source /etc/profile.d/rvm.sh

The following command will list the versions of Ruby to install :

# rvm list known

We choose the stable version [ruby-] 1.9.3 [-p545], and execute the following command :

# rvm install 1.9.3

The installation process is pretty long time, but you do not need any intervention, after successful, you check with the following command :

# ruby -v

Install Rubygems:
=================
Rubygems is a Ruby's packages management program, very popular in applications written by Ruby language and the Ruby On Rails framework.

# yum install rubygems


Install Passenger:
==================

The full name of the Passenger is Phusion Passenger, known as mod_rails or mod_rack, it is a web application intergrate with Apache and it can operate as a standalone web server support for the Ruby On Rails applications.

Execute the following commands :

# gem install passenger
# passenger-install-apache2-module

After completed, we copy a notification block in the window to create the configuration file in the next steps (select block notification and press C to copy).

 LoadModule passenger_module /usr/local/rvm/gems/ruby-2.2.3/gems/passenger-5.0.18/buildout/apache2/mod_passenger.so
   <IfModule mod_passenger.c>
     PassengerRoot /usr/local/rvm/gems/ruby-2.2.3/gems/passenger-5.0.18
     PassengerDefaultRuby /usr/local/rvm/gems/ruby-2.2.3/wrappers/ruby
   </IfModule>



Create a new virtual host file for Passenger :

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

Paste the command blocks into the empty file and save it, then restart the Apache service.

# service httpd restart


Create Database for Redmine:
============================

Use MySQLAdmin to create an empty database for Redmine, saved password to fill in the configuration file in the next steps.

mysql -u root -p'mysql@123'

mysql> create database redmine_db character set utf8;
mysql> create user 'redmine_admin'@'%' identified by 'mysql@123';
mysql> grant all privileges on redmine_db.* to 'redmine_admin'@'%';
mysql> quit;

# service mysqld restart


Install Redmine:
================

Redmine is a main program of the project management system, we will download and install the program from the website of Redmine.

Download Redmine version 2.5.x to directory "/var/www" on the Centos OS.

# cd /var/www
# wget http://www.redmine.org/releases/redmine-2.5.0.tar.gz

For latest version:
http://www.redmine.org/projects/redmine/wiki/Download
wget http://www.redmine.org/releases/redmine-3.0.1.tar.gz



Extract the folder and rename directory

# tar xvfz redmine-2.5.0.tar.gz
# mv redmine-2.5.0 redmine
# rm -rf redmine-2.5.0.tar.gz
# cd /var/www
# ls -la redmine
# chown -R apache:apache redmine
# chmod 755 redmine
# ls -la

Configuring the Database

The next, we need to configure the database was created from the above steps.

# cd /var/www/redmine/config
# cp database.yml.example database.yml
# vim database.yml


# if you want to use SQLite3 then use below settings:
# SQLite3 configuration example
production:
  adapter: sqlite3
  database: db/redmine_development.sqlite3



# if you want to use mysql then use below settings:
# SQL Server configuration example

#production:
#  adapter: mysql2
#  database: redmine             < database name
#  host: localhost              
#  username: root                < database user name
#  password: mysql@123                  < database password
#  encoding: utf8

:wq


# Setting up Rails

Install the package library support for Rails using the Bundle.
==============================================================

# cd /var/www/redmine
# gem install bundler
# bundle install
# rake generate_secret_token

The next, we create the database table for the Redmine application.

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


Activate FCGI:
==============

# cd /var/www/redmine/public
# mkdir plugin_assets
# cp dispatch.fcgi.example dispatch.fcgi
# cp htaccess.fcgi.example .htaccess


Setting up Apache and FastCGI

# cd /var/www/
# rpm --import https://fedoraproject.org/static/0608B895.txt
# wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# rpm -ivh epel-release-6-8.noarch.rpm
# yum  install mod_fcgid
# rm -rf epel-release-6-8.noarch.rpm

Creating Files Directory:
=========================
This directory contains data files generated during the operation of Redmine as document or image file, we create a new directory in the "/opt".

# mkdir -p /opt/redmine/files
# chown -R apache:apache /opt/redmine
# cd /var/www/redmine/config
# cp configuration.yml.example configuration.yml
# vim configuration.yml

otherwise we can create files directory under /var/www/redmine/

Configuring Email

Another very important function of Redmine is using email to notify members when the contents of each project changes, Redmine can use many different methods to send email that is Sendmail, SMTP, GMail ...

To configure the email we will edit the configuration file.

# cd /var/www/redmine/config/
# vim configuration.yml

# Outgoing email settings
production:
  email_delivery:
    delivery_method: :smtp
    smtp_settings:
      address: smtp3.netcore.co.in
      port: 25
      domain: netcore.co.in
      authentication: :login
      user_name: fctickets@firstcry.com
      password: Welcome@1

development:
  email_delivery:
    delivery_method: :smtp
    smtp_settings:
      address: smtp3.netcore.co.in
      port: 25
      domain: netcore.co.in
      authentication: :login
      user_name: fctickets@firstcry.com
      password: Welcome@1

:wq



Note : Do not use the Tab key to indent when editing the configuration file, you need to use the space bar on the keyboard.

If you use GMail's SMTP, you need to register an email account with the login methods used password normal and disable two-step authentication by smart phone.

Enter your Gmail account as below :

  email_delivery:
   delivery_method: :smtp
   smtp_settings:
        enable_starttls_auto: true
        address: "smtp.gmail.com"
        port: 587
        domain: "smtp.gmail.com"
        authentication: :plain
        user_name: "your_email@gmail.com"
        password: "your_password"

Save the file configuration and exit.


Create Virtual Host for Redmine:
================================

Create an Apache configuration file for the Redmine application at the port 80.

vim /etc/httpd/conf.d/redmine.conf

Copy the text below and paste into the editor window, note the information to change your domain name.

<VirtualHost *:80>
        ServerName 192.168.100.123
        ServerAdmin root@stage.firstcry.com
        DocumentRoot /var/www/html/redmine/public/
        ErrorLog logs/redmine_error_log
        <Directory "/var/www/html/redmine/public/">
                Options Indexes ExecCGI FollowSymLinks
                Order allow,deny
                Allow from all
                AllowOverride all
        </Directory>
</VirtualHost>

Save the file configuration and exit.


Running Redmine:
================

Before execute Redmine in the first time, we must permission for the directory installed Redmine and restart Apache service.

# cd /var/www
# chown -R apache:apache redmine
# chmod -R 755 redmine
# service httpd restart


Redmine will run at the following address URL :

http://your-domain

Login to system with an administrator account

admin / admin

You can change your password after successful login.

We can see Redmine has running but very primitive, in the next steps we will install the support plugins and customized Redmine to use professional.

Then Finally install Timesheet plugins and Roadmap plugins

======================================================================

Install Subversion:
===================

Subversion, also known as SVN, it is a version management system is very popular and easy to use, most programmers can use it competently.

We need to create a folder to store data for Redmine, the following command creates a directory and permissions for the Apache service.

# mkdir -p /opt/repositories/svn
# chown -R apache:apache /opt/repositories/
# chmod 0755 /opt/repositories

The following command install Subversion and the packages :

# yum install mod_dav_svn subversion subversion-ruby


The next, we will create a directory and copy the file called "Redmine.pm", it responsible for interface data repository with Redmine and it is written by Perl language programming.

# mkdir /usr/lib64/perl5/vendor_perl/Apache
# ln -s /var/www/redmine/extra/svn/Redmine.pm /usr/lib64/perl5/vendor_perl/Apache/Redmine.pm

Note : If you are using 32 bit Centos, change the path "/usr/lib64" to "/usr/lib"

After installation is complete, from the Redmine application, go to the page Administration> Settings> Repositories to check the results.

To support the authentication and access to data repository for each member, we need to create a virtual host for the Apache service can access Redmine database.

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

Add the following lines to the end and still retain the old contents of the file :

PerlLoadModule Apache::Redmine
<Location /svn>
        DAV svn
        SVNParentPath "/opt/repositories/svn"
        SVNListParentPath on
        Order deny,allow
        Deny from all
        Satisfy any
        LimitXMLRequestBody 0
        SVNPathAuthz off
        PerlAccessHandler Apache::Authn::Redmine::access_handler
        PerlAuthenHandler Apache::Authn::Redmine::authen_handler
        AuthType Basic
        AuthName "Subversion Repository"
        Require valid-user
        RedmineDSN "DBI:mysql:database=redmine_db;host=localhost:3306"
        RedmineDbUser "redmine_admin"
        RedmineDbPass "your_password_database_redmine"
</Location>

:wq

Note : You need to change the password in the "RedmineDbPass" to correct the database password of Redmine.

At this point, we have finished the basic settings for Redmine.

Thank you!

====================================================================================================================================================
====================================================================================================================================================


Install TimeSheet Plugins:
==========================

1. Download timesheet redmine plugins 
   [ http://www.redmine.org/projects/redmine/wiki/PluginTimesheet]
2. copy under /var/www/redmine/plugins    or  /var/www/redmine/vendor/plugins
# cp -rvp timesheet-plugins /var/www/redmine/plugins/

3. Permission should be 755 and apache ownership
# chown -R apache:apache timesheet-plugins

4. goto below location and fire below commands:
5. Check premission once again:
# cd /var/www/redmine/plugins/
# ls -la
# cd /var/www/redmine/
# rake redmine:plugins:migrate RAILS_ENV=production
# /etc/init.d/httpd restart

Browse redmine server and try to login with existing same login details:
Browse redmine : http://192.168.100.119

If all data and users and projects working fine....... good luck...!!

Road map plugins:
http://www.redmine.org/plugins/roadmaps

===============================================================================




Redmine Migration: From LIVE Server to NEW Server:
==================================================
On Live Server:

1. Login to Live Redmine Server
2. Goto /var/www/

# cd /var/www/

3. Copy "redmine" folder to new server on /var/www/      

# scp -rvp redmine root@192.168.100.119:/var/www/

Note:

1. While copying data from live server to new server, please inform to developer team to stop work temporary on live server.
2. If on new server redmine folder alreday present on location /var/www/ then move it to another location.

On New Server:

1. Login to New Server.
2. Check redmine setup already done. if not then install redmine on it.
   refer: http://www.redmine.org/projects/redmine/wiki/install_Redmine_25x_on_Centos_65_complete

3. Goto /var/www/
4. Check redmine folder permission and ownership.
5. redmine folder ownership permission should be apache:apache with chmod 755 full permission.

# cd /var/www/
# chown -R apache:apache redmine
# chmod 755 redmine
# ls -la
# ls -ld

6. Check Live Server and New Server "redmine" folder data size and make sure both should be same.

# cd /var/www/
# du -sh redmine

once all clear above points then use below command to update or import data on new server:

# cd /var/www/redmine/
# rake db:migrate RAILS_ENV=production
# /etc/init.d/httpd restart

=========================================================================
Note: Use below command only if by using above command data not migrated:
=========================================================================
# bundle exec rake generate_secret_token
# bundle install
# /etc/init.d/httpd restart
=========================================================================

Enjoy....!!




Backup by using cron:

# Redmine Full backup 3pm and 9pm
0 15 * * * zip -r /home/backup_redmine/redmine_$(date +\%d-\%m-\%Y_\%H:\%M:\%S).zip /var/www/redmine

0 21 * * * zip -r /home/backup_redmine/redmine_$(date +\%d-\%m-\%Y_\%H:\%M:\%S).zip /var/www/redmine

* * * * 6 find /home/backup_redmine/ -mtime +5 -exec rm {} \;

0 * * *  * sync; echo 3 > /proc/sys/vm/drop_caches


========================================

Also install postfix  or sendmail to send/receive emails

bundle install --without development test rmagick
Note: The rake task db:migrate_plugins has been deprecated, please use the replacement version redmine:plugins:migrate
LoadError: cannot load such file -- dispatcher



Additional Plugins:
http://www.redmine.org/plugins/redmine_close_button
http://www.redmine.org/projects/redmine/wiki/Plugins
http://www.redmine.org/projects/redmine/wiki/PluginGraphs
http://www.redmine.org/projects/redmine/wiki/install_Redmine_25x_on_Centos_65_complete

email notification, issue creator



HowTo add a logo to your Redmine banner
=======================================

# vim /var/www/redmine/app/views/layouts/base.html.erb

Find this line:

    <h1><%= page_header_title %></h1>

And change it to:

     <!--<h1><%= page_header_title %></h1>-->

Add this line directly below:

     <img src="<%= Redmine::Utils.relative_url_root %>/images/logo.png" style="top-margin: 15px; left-margin: 15px;"/>

The ruby statement <%= Redmine::Utils.relative_url_root %> will produce the relative URI for your redmine installation.

Now it should look like this:

    </div>

     <!--<h1><%= page_header_title %></h1>-->
     <img src="<%= Redmine::Utils.relative_url_root %>/images/logo.png" style="top-margin: 15px; left-margin: 15px;"/>

    <% if display_main_menu?(@project) %>

Upload your logo

Example using the scp command:

scp logo.png root@example.com:/var/www/redmine/public/images

You probably should chown the uploaded logo:

chown redmine:redmine /var/www/redmine/public/images/logo.png

Restart your web server

Examples:

/etc/init.d/apache2 restart

/etc/init.d/httpd restart

/etc/init.d/nginx restart



Ref:  http://www.redmine.org/projects/redmine/wiki/Howto_add_a_logo_to_your_Redmine_banner

IMP Link: http://www.redmine.org/projects/redmine/wiki/install_Redmine_25x_on_Centos_65_complete

Installation of GitLab Centos 6.5


Installation of GitLab Centos 6.5
===================================

IMP: https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md
     https://about.gitlab.com/downloads/
     http://doc.gitlab.com/ce/install/installation.html
     http://tecadmin.net/install-ruby-2-1-on-centos-rhel/
     https://www.digitalocean.com/community/tutorials/how-to-install-ruby-on-rails-on-centos-6
================================================

Instalation:

Requirement:
HTTP
MySQL
PHP
Ruby
Git


# yum install http*
# yum install mysql mysql-server
# yum install php*                       <<----------  its optional part
# yum install git

Ruby Install:

Step 1: Install Required Packages
# yum install gcc-c++ patch readline readline-devel zlib zlib-devel
# yum install libyaml-devel libffi-devel openssl-devel make
# yum install bzip2 autoconf automake libtool bison iconv-devel
# yum install gcc g++ make automake autoconf curl-devel openssl-devel zlib-devel httpd-devel apr-devel apr-util-devel sqlite-devel
# yum install ruby-rdoc ruby-devel
# yum install ruby

OR

Step 1: Install Required Packages
# yum install gcc-c++ patch readline readline-devel zlib zlib-devel
# yum install libyaml-devel libffi-devel openssl-devel make
# yum install bzip2 autoconf automake libtool bison iconv-devel

Step 2: Install RVM
Install latest stable version of RVM on your system using following command. This command will automatically download all required files and install on your system.

# curl -L get.rvm.io | bash -s stable

Step 3: Setup RVM Environment

RVM provides a shell script to setup system environment before installing Ruby. Use below command to setup rvm environment.

# source /etc/profile.d/rvm.sh

Step 4: Install Ruby

After completing setup of RVM environment, lets install Ruby language using following command.

# rvm install 2.1.2


[Sample Output]

ruby-2.1.2 - #removing src/ruby-2.1.2..
Searching for binary rubies, this might take some time.
No binary rubies available for: centos/6/i386/ruby-2.1.2.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for centos.
Requirements installation successful.
Installing Ruby from source to: /usr/local/rvm/rubies/ruby-2.1.2, this may take a while depending on your cpu(s)...
ruby-2.1.2 - #downloading ruby-2.1.2, this may take a while depending on your connection...
ruby-2.1.2 - #extracting ruby-2.1.2 to /usr/local/rvm/src/ruby-2.1.2...
ruby-2.1.2 - #configuring.....................................................
ruby-2.1.2 - #post-configuration.

Step 5: Setup Default Ruby Version
Use rvm command to setup default ruby version to be used by applications.

# rvm use 2.1.2 --default

Using /usr/local/rvm/gems/ruby-2.1.2
============================================

Step 6: Check Current Ruby Version.

Using following command you can check the current ruby version is used.

# ruby --version

ruby 2.1.2p95 (2014-05-08 revision 45877) [i686-linux]


# Download gitlab package:


curl -O https://downloads-packages.s3.amazonaws.com/centos-6.6/gitlab-7.9.0_omnibus.2-1.el6.x86_64.rpm
sudo rpm -i gitlab-7.9.0_omnibus.2-1.el6.x86_64.rpm

After every changes in configuration file of gitlab then fire below commands:

sudo gitlab-ctl reconfigure
sudo gitlab-ctl restart

Start GitLab:
sudo gitlab-ctl start

# Check GitLab Status:
sudo gitlab-ctl status

If any of the processes is not behaving like expected, try tailing their logs to see what is wrong.

# sudo gitlab-ctl tail postgresql


For Email Alert:
vim /etc/gitlab/gitlab.rb
gitlab_rails['gitlab_email_from'] = 'gitlab@gitlab.firstcry.com'
gitlab_rails['gitlab_support_email'] = "namdev.rathod@firstcry.com"


Login GitLab Web Panel:

http://192.168.100.113
Default Login:
Username: root
Password: 5iveL!fe

We have to reset new password while login web panel


We can change login url from /etc/gitlab/gitlab.rb file

# Change the external_url to the address your users will type in their browser
external_url 'http://192.168.102.29:8888'
unicorn['port'] = 8888

:wq

sudo gitlab-ctl restart
sudo gitlab-ctl status
======================================================================================

Manage with MySQL:


mysql -u root -p'mysql@123'
CREATE USER 'gitlab'@'localhost' IDENTIFIED BY 'mysql@123';    
CREATE DATABASE IF NOT EXISTS `gitlabhq_production` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`;
GRANT SELECT, LOCK TABLES, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON `gitlabhq_production`.* TO 'gitlab'@'localhost';
commit;
\q

# Ensure you can use the InnoDB engine which is necessary to support long indexes
# If this fails, check your MySQL config files (e.g. `/etc/mysql/*.cnf`, `/etc/mysql/conf.d/*`) for the setting "innodb = off"
mysql> SET storage_engine=INNODB;



================================================================

Service Starting and stopping

# status
sudo gitlab-ctl status
# Start all GitLab components
sudo gitlab-ctl start

# Stop all GitLab components
sudo gitlab-ctl stop

# Restart all GitLab components
sudo gitlab-ctl restart

GitLab Server Logs:

gitlab-ctl tail
=========================================================

GitLab By default storing location of repo data:

omnibus-gitlab stores Git repository data under /var/opt/gitlab/git-data:
repositories are stored in /var/opt/gitlab/git-data/repositories
satellites in /var/opt/gitlab/git-data/gitlab-satellites.

We can change the location of the git-data parent directory by adding the following line to /etc/gitlab/gitlab.rb.
=======================================================================================================================

Backups of Application:

To create a backup of your repositories and GitLab metadata, run the following command.

Note that GitLab CI currently does not have a backup script.

sudo gitlab-rake gitlab:backup:create

This will store a tar file in /var/opt/gitlab/backups. The filename will look like 1393513186_gitlab_backup.tar, where 1393513186 is a timestamp.

If you want to store your GitLab backups in a different directory, add the following setting to /etc/gitlab/gitlab.rb and run sudo gitlab-ctl reconfigure:

gitlab_rails['backup_path'] = '/mnt/backups'


Scheduling a backup:

To schedule a cron job that backs up your repositories and GitLab metadata, use the root user:

crontab -e
There, add the following line to schedule the backup for everyday at 2 AM:

0 2 * * * /opt/gitlab/bin/gitlab-rake gitlab:backup:create

=======================================================================================

Restoring backup of Application:

We will assume that you have installed GitLab from an omnibus package and run sudo gitlab-ctl reconfigure at least once.

First make sure your backup tar file is in /var/opt/gitlab/backups.

sudo cp 1393513186_gitlab_backup.tar /var/opt/gitlab/backups/

Next, restore the backup by running the restore command. You need to specify the timestamp of the backup you are restoring.

# Stop processes that are connected to the database
sudo gitlab-ctl stop unicorn
sudo gitlab-ctl stop sidekiq

# This command will overwrite the contents of your GitLab database!
sudo gitlab-rake gitlab:backup:restore BACKUP=1393513186

# Start GitLab
sudo gitlab-ctl start

# Create satellites
sudo gitlab-rake gitlab:satellites:create

# Check GitLab
sudo gitlab-rake gitlab:check SANITIZE=true
=========================================================================================================================

Directory structure

Omnibus-gitlab uses four different directories.

    /opt/gitlab holds application code for GitLab and its dependencies.
    /var/opt/gitlab holds application data and configuration files that gitlab-ctl reconfigure writes to.
    /etc/gitlab holds configuration files for omnibus-gitlab. These are the only files that you should ever have to edit manually.
    /var/log/gitlab contains all log data generated by components of omnibus-gitlab.

======================================================================================================================
Uninstalling omnibus-gitlab

To uninstall omnibus-gitlab, preserving your data (repositories, database, configuration), run the following commands.

# Stop gitlab and remove its supervision process
sudo gitlab-ctl uninstall

# Debian/Ubuntu
sudo dpkg -r gitlab

# Redhat/Centos
sudo rpm -e gitlab
===============================================================

For redis setup:

https://gist.github.com/nghuuphuoc/7801123
http://blog.andolasoft.com/2013/07/how-to-install-and-configure-redis-server-on-centosfedora-server.html

===================================================================

To Manage GitLab From Browser:

https://www.digitalocean.com/community/tutorials/how-to-use-the-gitlab-user-interface-to-manage-projects
https://scotch.io/tutorials/how-to-setup-gitlab-a-self-hosted-github


Refer:
https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md
http://www.digitalsanctuary.com/tech-blog/general/installing-gitlab-on-redhat-enterprise-5-rhel-5.html
https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/install/installation.md
https://about.gitlab.com/downloads/#centos6
https://www.linode.com/docs/applications/development/gitlab-on-ubuntu-14-04

============================================================================================

Reset root password:

http://roland.kierkels.net/git/reset-your-gitlab-root-password-from-a-terminal/

Start the console with this command:

# gitlab-rails console production

Now there are multiple ways to find your user. In my case I know there was only one user and it had so it has ID 1. But you can also search for email or username

irb(main):001:0> u = User.where(id: 1).first

Now lets change your password:

> u.password = 'secret_pass'
> u.password_confirmation = 'secret_pass'

Its important that you change both password and password_confirmation to make it work.
Now lets save the changes.


> u.save!


The ( ! ) symbol is very important. Otherwise your changes are not pushed to the database. Now exit the console and try to login with your new password. It should work now


=========================================================================================================

Install Sendmail to send automatically password for newly created user:

 Install sendmail and m4 packages,

    ]# yum install sendmail* m4* -y

3. Edit configuration file, so the given line looks like below,
   
    add dnl # before below line
    ]# vi /etc/mail/sendmail.mc

    dnl # DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
     :wq

4. Compile the configuration,

    ]# m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf

5. Start the sendmail service,

    ]# service sendmail start
    ]# chkconfig sendmail on

6. Allow access to IPs to access this SMTP server, Here you generally specify your local internet ip.

    ]# vi /etc/mail/access

    Connect:202.52.134.200            RELAY

    :wq

    ]# service sendmail restart


[root@server~]# tail -f /var/log/maillog

=================================================================================================


GitLab Detail:

Main Configuration File: /var/opt/gitlab/gitlab-rails/etc/gitlab.yml
GitLab Document Root: /opt/gitlab
Default Repository Location: /var/opt/gitlab/git-data/repositories
Default Nginx Configuration File: /opt/gitlab/embedded/conf/nginx.conf
GitLab Nginx Configuration file Location: /var/opt/gitlab/nginx/conf
Postgresql data Directory: /var/opt/gitlab/postgresql/data

Step By Step Installation of Git with GitBlit GUI CentOS / Ubuntu



## Step By Step Installation of Git with GitBlit GUI CentOS / Ubuntu
===========================================

For start service manually:

GITBLIT Service start
cd /opt/gitblit ; java -jar gitblit.jar --baseFolder data &
=================================

Installation:

# yum install git  [Optional, if you want to manage git CLI.]

1. Creating Gitblit install directory
First of all we'll gonna to create a directory in our server in which we'll be installing our latest gitblit in.   

$ mkdir -p /opt/gitblit ; cd /opt/gitblit

2. Downloading and Extracting
Now, we will want to download the latest gitblit from the official site. Here, the current version of gitblit we are gonna install is 1.6.2 . So, please change it as the version you are gonna install in your system.

$ sudo wget http://dl.bintray.com/gitblit/releases/gitblit-1.6.2.tar.gz

Now, we'll be extracting our downloaded tarball package to our current folder ie /opt/gitblit/

$ sudo tar -zxvf gitblit-1.6.2.tar.gz

3. Configuring and Running

Now, we'll configure our Gitblit configuration. If you want to customize the behavior of Gitblit server, you can do it by modifying gitblit/data/gitblit.properties . Now, after you are done configuring the configuration. We finally wanna run our gitblit. We have two options on running gitblit, first is that we run it manually by the command below:

# cd /opt/gitblit/
# vim data/gitblit.properties

server.httpPort = 8080
server.httpsPort = 8443

web.siteName = reposerver

:wq

[Also you may set LDAP, EMAIL settings.]

$ sudo java -jar gitblit.jar --baseFolder data

Error: sudo: java: command not found


]$ yum install java*


Now, start glitblit service manually:
cd /var/gitblit/
java -jar gitblit.jar --baseFolder data &
==================================

Open your browser to:

http://localhost:8080
https://localhost:8443

Replace "localhost" with the ip-address of the machine depending on your system configuration.
Enter the default administrator credentials:

admin / admin

click the Login button.

Enjoy..............!!!!

================================================================================

If got login error: then configure file as below:

Now, we'll configure our Gitblit configuration. If you want to customize the behavior of Gitblit server, you can do it by modifying gitblit/data/gitblit.properties . Now, after you are done configuring the configuration. We finally wanna run our gitblit. We have two options on running gitblit, first is that we run it manually by the command below:

# cd /opt/gitblit/
# vim data/gitblit.properties

Note:
if need then give this file to full permission of data/  folder

set port number:

server.httpPort = 8080
server.httpsPort = 8443

:wq

start it manually:
cd /var/gitblit/
java -jar gitblit.jar --baseFolder data &

Login GitBlit: https://192.168.100.120:8443
============================================================================================================================================
============================================================================================================================================


GitBlit Server Migration From Live to New Installed Server :


1. Login to Live server   192.168.0.10
2. cd /var/gitblit   or cd /opt/gitblit
3. scp -rvp gitblit root@192.168.100.120:/var/                       <---  192.168.100.120  is a new server ip
4. Now, login to new server and check permission of gitblit folder. it should be full permission with root ownership
5. and restart gitblit service as below commands:


start it manually:
cd /var/gitblit/
java -jar gitblit.jar --baseFolder data &

6. Now, Verify all data and user login are working or not. it everything working fine...  Enjoy

=========================================================================================================

Refer:
http://linoxide.com/linux-how-to/serve-git-repositories-gitblit/          <---- important
https://www.howtoforge.com/how-to-install-the-latest-git-version-on-centos
http://www.unixmen.com/install-gitblit-ubuntu-fedora-centos/
http://www.liquidweb.com/kb/how-to-install-git-on-centos-6/

================================================