Friday, 12 July 2019

Testlink - Installation on AWS CentOS

Installation Steps

  • Update the system :-
            $  sudo yum install epel-release -y
      $ sudo yum update -y && sudo shutdown -r now
     After install epel , restart the system to apply the updates.
  • Install a Web Server -Apache :-
             $  sudo yum install httpd -y
       It is recommended to remove/disable the Apache default welcome page in production environments.
       sudo sed -i 's/^/#&/g' /etc/httpd/conf.d/welcome.conf
       Prevent Apache from listing web directory files to visitors:
       sudo sed -i "s/Options Indexes FollowSymLinks/Options FollowSymLinks/" /etc/httpd/conf/httpd.conf
       Start the Apache service and enable it to auto-start on boot
       $  sudo systemctl start httpd.service
       $  sudo systemctl enable httpd.service
  • Install Mysql Database :-
        refer Mysql Installation
  • Install PHP 7.1 and Some extensions :-
      TestLink requires PHP 5.5 or later. In order to get better performance, we will install PHP 7.1 and all the necessary extension for TestLink as follows,
      sudo rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
      $ sudo yum install mod_php71w php71w-mysqlnd php71w-common php71w-gd php71w-ldap php71w-cli php71w-mcrypt php71w-xml -y
      We will need to modify PHP settings to meet TestLink’s requirements as follows:
      sudo cp /etc/php.ini /etc/php.ini.bak
      $ sudo sed -i "s/session.gc_maxlifetime = 1440/session.gc_maxlifetime = 2880/" /etc/php.ini
      $ sudo sed -i "s/max_execution_time = 30/max_execution_time = 120/" /etc/php.ini
  • Install Testlink 1.9.16 :-
       Download the testlink and unzip into /var/www/html folder.
       $ sudo cd wget https://github.com/TestLinkOpenSourceTRMS/testlink-code/archive/1.9.16.tar.gz
       $ sudo tar -zxvf 1.9.16.tar.gz -C /var/www/html
       $ sudo chown -R apache:apache /var/www/html/testlink-code-1.9.16
       Create a custom configuration file for Testlink 
       sudo cp /var/www/html/testlink-code-1.9.16/custom_config.inc.php.example /var/www/html/testlink-code-1.9.16/custom_config.inc.php
       Modify the custom Testlink configuration file 
       sudo vi /var/www/html/testlink-code-1.9.16/custom_config.inc.php
       Find the below lines
       // $tlCfg->log_path = '/var/testlink-ga-testlink-code/logs/'; /* unix example */
       // $g_repositoryPath = '/var/testlink-ga-testlink-code/upload_area/'; /* unix example */
       Replace them with below lines
       $tlCfg->log_path = '/var/www/html/testlink-code-1.9.16/logs/';
       $g_repositoryPath = '/var/www/html/testlink-code-1.9.16/upload_area/';
       Create virtual Host for Testlink       
           
cat <<EOF | sudo tee -a /etc/httpd/conf.d/testlink.conf
<VirtualHost *:80>
ServerAdmin admin@example.com
DocumentRoot /var/www/html/testlink-code-1.9.16/
ServerName testlink.example.com
ServerAlias www.testlink.example.com
<Directory /var/www/html/testlink-code-1.9.16/>
Options FollowSymLinks
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog /var/log/httpd/testlink.example.com-error_log
CustomLog /var/log/httpd/testlink.example.com-access_log common
</VirtualHost>
EOF
                                                   

  • Restart Apache in order to apply all above settings :-
           sudo systemctl restart httpd.service
  • Finishing the installation :-
      When you visit http://xx.xxx.xxx.xx:80 
            you will get New Installation wizard, there you can do database setup by providing below details             
  • Database Type: MySQL/MariaDB (5.6+ / 10.+)
  • Database host: localhost
  • Database name: testlink
  • Table prefix: <LEAVE IT EMPTY>
  • Database admin login: root
  • Database admin password: <your-MariaDB-root-password>
  • TestLink DB login: testlinkuser
  • TestLink DB password: yourpassword
           Once these setup done, you can login with username & password.

Thursday, 11 July 2019

MongoDB - Installation on CentOS

Installation Steps

Install MongoDB v4.0.10 Community Edition :-
  • Configure the package management system (yum) :-
              Create a /etc/yum.repos.d/mongodb-org-4.0.repo file so that you can install MongoDB directly using yum.
       $ Sudo vi /etc/yum.repos.d/mongodb-org-4.0.repo                  
           [mongodb-org-4.0]
       name=MongoDB Repository
       baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.0/x86_64/
       gpgcheck=1
       enabled=1
       gpgkey=https://www.mongodb.org/static/pgp/server-4.0.asc
                                                                          
  • Install the MongoDB packages:-
       $ sudo yum install -y mongodb-org
  • Directory Paths :-
             By default, MongoDB runs using the mongod user account and uses the following default directories:
       /var/lib/mongo (the data directory)
       /var/log/mongodb (the log directory)
  • Configuration :-
              Update the below on /etc/mongod.conf file.
# network interfaces
              net:
              port: 27017
              bindIp: 0.0.0.0  
#Authentication
               security:
               authorization: enabled
                                                                                                                                                                                                     
              
  • Start MongoDB :-
              $ sudo service mongod start
  • Connect MongoDB :-
              $ mongo

Mysql Installation on AWS CentOS Machine

Installation Steps

  • Install wget :- (Optional)
          $ sudo yum install wget
  • Download mysql :-
  • Verify Integrity Value :- 
          To check downloaded file is corrupted or not fire the below command
          $ md5sum mysql80-community-release-el7-3.noarch.rpm
As we cross checked both md5 values are same in above images, so now we verified that file was not corrupted. 
  • Adding Downloaded package into yum Repository:-
          $ sudo rpm -ivh  mysql80-community-release-el7-3.noarch.rpm
  • Installing Mysql:-
            $ sudo yum install mysql-server
  • Check root user password :-
          During installation, the root user password is generated and stored in mysqld.log file.
          $ sudo grep 'temporary password' /var/log/mysqld.log
          So the password is 5xgQoryw2F(=    
          The default password policy requires 12 characters, with at least one uppercase letter, one lowercase letter, one number and one special character.
  • Configuring MySql :-
          Run the security script to set new password of root user
          $ sudo mysql_secure_installation
          Press Y for all questions – in order to remove anonymous users, disallow remote root login, remove the test database and access to it, and reload the privilege tables.
          
  • To Verify our Installation:-
          $ mysqladmin -u root -p version

Note: MySQL is automatically enabled to start at boot when it is installed. You can change that default behavior with
         $ sudo systemctl disable mysqld

  • Starting MySql & Checking Status of MySql:-
           $ sudo systemctl start mysqld
           $  sudo systemctl status mysqld
           Installation successfully completed.
  • Connecting MySql:-
    $ mysql -u username -p

FAQs

Problem

After Installation we faced issue that couldn't able to access mysql server remotely.

Solution

Note:
  1. Add Public Ip on hosts file $ Sudo vi /etc/hosts 
  2. Add bind-address=0.0.0.0 on $ Sudo vi /etc/my.cnf
  3. Set host as '%' while creating user to access remote from anywhere.