Thursday, October 1, 2015

Redmine - Installation / Upgradation / Backup-Restore On Ubuntu 14.04

                        Redmine is a flexible project management web application. Written using Ruby on Rails framework, it is cross-platform and cross-database. Its main features are:
  1. Multiple projects support
  2. Flexible role based access control and Flexible issue tracking system 
  3. Gantt chart and calendar and News, documents and files management 
  4. Per project wiki and Per project forums and Simple time tracking functionality 
  5. Custom fields for issues, projects and users and SCM integration (SVN, CVS, Mercurial)
  6. Multiple LDAP authentication support and User self-registration support
    Bitnami Structure and Configuration
                                              The applications in Bitnami are installed in the 'apps' folder that you can find in the installation directory. In virtual machines, cloud images and in Bitnami Cloud hosting servers the installation directory is /opt/bitnami.
    The main folders that you can find inside 'apps/redmine' are the following:
    • conf: folder that includes the apache configuration files for redmine
    • htdocs: this folder includes the redmine files (Gemfile and Rakefile files, redmine configuration files, plugins folder, gems, etc).
    • The location of the redmine configuration files (database configuration, email settings, etc) is the 'apps/redmine/htdocs/config' folder.
    Start / Stop the Services On Redmine Server
                                                     Each Bitnami stack includes a control script that lets you easily stop, start and restart servers.The script is located at /opt/bitnami/ctlscript.sh or Installation Directory Which you are selected. Call it without any arguments to restart all services:                             
    $ sudo /opt/bitnami/ctlscript.sh start
                  OR
    $./ctlscript.sh start / stop /restart
    The same way use it to restart a specific service only by passing the service name as argument - eg:- mysql
                             $ sudo /opt/bitnami/ctlscript.sh restart mysql         
      Fresh Installation Of Bitnami Redmine On Ubuntu 14.04
    1. Download the latest stable versions from redmine.org      
    2. Copy the bitnami-redmine-3.1.1-0-linux-x64-installer.run package to Server
    3. Set executable permission
    $chmod +x bitnami-redmine-3.1.1-0-linux-x64-installer.run
        4. Install the bitnami redmine
    $./bitnami-redmine-3.1.1-0-linux-x64-installer.run
    Note :- During the installation time set the MYSQL root Password and Redmine admin user
                Backup And Restore Redmine
                                               Bitnami stacks are self-contained and the simplest option for performing a backup is to copy or compress the Bitnami stack installation directory. To do so in a safe manner, you will need to stop all servers, so this method may not be appropriate if you have people accessing the application continuously.
    Backup
    1. Stop All Services                
    ictops@ubuntu:~opt/redmine-3.1.1-0$./ctlscript.sh stop
        2.   Copy  all Contents from directory-FILES
    ictops@ubuntu:~opt/redmine-3.1.1-0/apps/redmine/htdocs/files$
        3.   Took Database backup Via SQLYOg or Command Line
    Restore :-
    1. Import the DB into the new server and modified the database.yml file
    2. Restore all files from which you are backed up into the new server directory named -FILES
    3. After Importing DB into the New server, need to migrate DB(Which is mentioned in the Upgradation steps)
    Upgrade Remine / Restore the Old Redmine Data and DB to New Redmine
                                   It is strongly recommended that you create a backup before starting the update process. If you have important data, it is advisable that you create and try to restore a backup to ensure that everything works properly.
                                  In the Redmine case, these are the steps to migrate the database from an old version to a new one.
    1. Login into the new Redmine Server
    2. Copy the database backup to the new Bitnami version server.
    3. Stop all servers and start only MySQL. Note that the installation directory could be different.
                 $ sudo /opt/redmine-3.1.1-0/ctlscript.sh stop
                $ sudo /opt/redmine-3.1.1-0/ctlscript.sh start mysql
    1. Remove the previous database and create the new one. You can configure the database user password with a secure password.
            /opt/redmine-3.1.1-0/mysql/bin/$ mysql -u root -p
    Password: ****
    mysql> drop database bitnami_redmine;
    mysql> create database bitnami_redmine;
    mysql> grant all privileges on bitnami_redmine.* to 'ictops_redmine'@'localhost' identified by 'DATABASE_PASSWORD'
    1. Restore the new database:
    $ mysql -u root -p bitnami_redmine < backup.sql
    1. Edit the Redmine configuration file to update the database user password (/opt/redmine-3.1.1-0/apps/redmine/htdocs/config/database.yml)
    production:
     adapter: mysql2
     database: bitnami_redmine
     host: localhost
     username: ictops_redmine
     password: "DATABASE_PASSWORD"
     encoding: utf8
    1. Migrate the database to the latest version:
    Note :- You should start the "Use Redmine" command prompt from the Windows Start Menu. On Linux or OS X, you should run this command from a "use_redmine" console.
    $ cd /opt/redmine-3.1.1-0/
    /opt/redmine-3.1.1-0/$ ./use_redmine
    $ cd /opt/redmine-3.1.1-0/apps/redmine/htdocs
    $ ruby bin/rake db:migrate RAILS_ENV=production

    Thursday, September 10, 2015

    SSH Passwordless Login Using SSH Keygen




    SSH Controller :-
    1. Create Key Using SSH keygen
                       administrator@IT-SVR-ANZLR:~$ssh-keygen -t rsa
    Note :- The above steps will create two key files on the server (private and public keys)
                                               id_rsa and id_rsa.pub
    2. Copy key to remote Server - sts009.ictops.in From SSH Controller
    Copy the Public key file (id_rsa.pub) from SSH Controller to remote server
                        administrator@IT-SVR-ANZLR:~$scp id_rsa.pub administrator@sts009.ictops.in:/home/administrator
                                          OR
                         administrator@IT-SVR-ANZLR:~$ssh-copy-id administrator@sts009.ictops.in
    Note :-The First command just copy the file into the remote server.
    Second command copy the files into the remote server in the home directory .ssh folder.If the folder in not present in the remote server
    Remote Server - sts009.ictops.in
    3. Login into the Server and Create a Directory in home location
                         administrator@AVCETTSTS009:~$ mkdir .ssh
    4. Copy the Public Key Contents into authorized_keys under .ssh directory
                         administrator@AVCETTSTS009:~$ cat id_rsa.pub >>~/.ssh/authorized_keys
                         administrator@AVCETTSTS009:~$ chmod 700 ~/.ssh/authorized_keys5. Login from SSH Controller to Remote Server Without Password
                         administrator@IT-SVR-ANZLR:~$ssh sts009.ictops.in

    Wednesday, June 10, 2015

    Copy A Folder Contents To Another Location In Compressed Format Via Batch Files

                                       For copying the backup of a folder contents to another local folder and saved it as compressed type of file.Here we need to take data backup from “c:\wamp\www” to another local folder in Drive F: (F:\Backup), here it saved as ictops.7z (F:\Backup\ictops.7z)
    1. Created new test document and copy the below mentioned script into it
    2. Finally Save the file as a .bat extension
    3. Download and Install 7 Zip application software  
    @echo off
    echo **** IT Tech Beats Backup Solution******
    "c:\Program Files\7-Zip\7z.exe"  a -t7z -r "F:\Backup\ictops.7z" "C:\wamp\www\*.*"
    echo !!!!!!!!BACKUP COMPLETED THANKS!!!!!!!!

    Friday, May 29, 2015

    Backup And Compress Folder Contents To Another Location Via Batch Files Based On Date And Time

                                              For taking the backup of a folder contents to another local folder.Here we need to take data backup from “c:\wamp\www” to another local folder in Drive F: (F:\Backup).In destination location,the backed up folder names created Data and Time wise.Also zipped the destination folder.
    1. Created new test document and copy the below mentioned script into it
    2. Finally Save the file as a .bat extension
    3. Download and Install 7 Zip application software  
    @echo off
    @COLOR 0A
    echo **** IT Tech Beats Backup Solution******
    :: variables
    set drive=F:\Backup

    set year=%DATE:~10,4%
    set day=%DATE:~7,2%
    set month=%DATE:~4,2%
    set hr=%TIME:~0,2%
    set min=%TIME:~3,2%

    set ICTOPS=%day%-%month%-%year%-%hr%-%min%

    set backupcmd=xcopy /s /c /d /e /h /i /r /k /y
    echo ### Backing up your Websites ...

    "c:\Program Files\7-Zip\7z.exe"  a -t7z -r "%drive%\%ICTOPS%" "C:\wamp\www\*.*"
    echo !!!!!!!!BACKUP COMPLETED.Your Backup is located at %drive% THANKS  !!!!!!!!
    pause

    Copy A Folder Contents To Another Location Via Batch Files

                       For copying the backup of a folder contents to another local folder.Here we need to take data backup from “c:\wamp\www” to another local folder in Drive F: (F:\Backup)
    1. Created new test document and copy the below mentioned script into it
    2. Finally Save the file as a .bat extension                  
    @echo off
    echo **** IT Tech Beats Backup Solution******
    XCOPY C:\wamp\www\*.*  F:\Backup\*.* /s /e
    echo !!!!!!!!BACKUP COMPLETED THANKS!!!!!!!!
    Where
    /s  ----> Copies folders and subfolders except for empty ones
    /e  ----> Copies directories and subdirectories, including empty ones  

    Thursday, May 21, 2015

    Reset MySQL root Password In Ubuntu

                                      In Linux distributions you can recover the mysql root password using the following steps
    1. Stop all the MySQL processes
    service mysql stop
         2.   Start MySQL server with –skip-grant-tables enabled
    This option will let you login as root without any password
    mysqld_safe --skip-grant-tables &
         3.   Connect to the MySQL server from your shell
    mysql -u root
    Eg :- root@ubuntu:~# mysql -u root
                         mysql>
          4.  Setup a new MySQL root password
    use mysql;
                update user set password=PASSWORD("New Password") where User='root';
                flush privileges;
                exit
    Eg :-    mysql -u root
    mysql> update user set password=PASSWORD('amma') where user='root';
    Query OK, 4 rows affected (0.02 sec)
    Rows matched: 4  Changed: 4  Warnings: 0
          5.  Start all the MySQL processes
                           service mysql start
          6.  Test your new MySQL root password
    mysql -u root -p

    Tuesday, May 19, 2015

    Clear Cached Credentials For A Network Share On A Windows Machine Without Rebooting

    For checking the cached information's :-
    1. Open the command prompt (Run--->CMD)
    2. Execute the command : net use
    3. For Clearing cache :-  net use * /d
    Eg:-
    C:\>net use
    New connections will be remembered.
    Status       Local     Remote                    Network
    -----------------------------------------------------------------------------
    OK                     \\10.3.3.173\www          Microsoft Windows Network
    Disconnected           \\192.168.172.219\IPC$    Microsoft Windows Network
    The command completed successfully.
    C:\>net use * /d
    You have these remote connections:
                       \\10.3.3.173\www
                       \\192.168.172.219\IPC$
    Continuing will cancel the connections.
    Do you want to continue this operation? (Y/N) [N]:
    bloggerwidgets