Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Thursday, 28 January 2016

How To Add Swap Space to Amazon EC2 Linux


Add Swap Space

 METHOD: 1

Step: 1. Attach the EBS volume to the instance in AWS Panel :

Note: The device you set it to (in my case, /dev/xvdg).

Step: 2. To see which Devices are Active on your Instance :

Go to Terminal & Type :

# fdisk -l

Step: 3. Setup the SWAP Area :

# mkswap -f /dev/xvdg

(the -f option is to force the command to proceed – omit it if you are unsure about the target)

Step: 4. In order to have the SWAP Space Available after a Boot :

# vi /etc/fstab   

/dev/xvdg       swap    swap    defaults        0  0

-- Save & Quit (:wq)

Step: 5. Finally, We can turn on SWAP (without a reboot) :
   
# swapon /dev/xvdg

Step: 6. To Check SWAP : 

# free -m

METHOD: 2

Step: 1. Type the following command with count being equal to the desired block size :

# dd if=/dev/zero of=/swapfile bs=1M count=1024

Step: 2. Setup the SWAP file with the command :

# mkswap /swapfile

Step: 3. To Enable the SWAP file Immediately but not Automatically at Boot Time :

# swapon /swapfile

Step: 4. To Enable it at the Boot Time  :

# vi /etc/fstab

/swapfile     swap     swap     defaults     0 0

-- Save & Quit (:wq)

Step: 5. To Check SWAP : 

# free -m


Thanks For Visiting on My Blog, For More Tutorials Keep Visiting My Blog

How to Install DNS Server in CentOS/RHEL 6x

DNS Server Configuration

Note: Before Start
Set ip-address manually (I use 192.168.72.140)
Set hostname FQDN (I use server1.domain.com)

Step: 1. To set IP-Address :

# system-config-network-tui

Uncheck DHCP & Give the IP Address manually.

OK -> Quit

Step: 2. Installation of DNS Server :

# yum -y install bind* caching-nameserver

Step: 3. Make sure that the Host Names are set Properly :

# vi /etc/hosts

127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
192.168.72.140 server1.domain.com server1 (IP Address & FQDN)

-- Save & Quit (:wq)

# vi /etc/sysconfig/network

NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=server1.domain.com

-- Save & Quit (:wq)

Step: 4. Set Hostname :

# hostname server1.domain.com

Step: 5. DNS resolve Entry :

# vi /etc/resolv.conf

search domain.com
nameserver 192.168.10.1

-- Save & Quit (:wq)

Step: 6. Configure DNS Server :

# vi /etc/named.conf

Edit those Lines :

options {
        listen-on port 53 { 192.168.72.140; };
#       listen-on-v6 port 53 { ::1; };
allow-query { any; };

Add Those Lines :

zone"domain.com" IN {
type master;
file "forward.zone";
allow-update { none; };
};

zone"72.168.192.in-addr.arpa" IN {
type master;
file "reverse.zone";
allow-update { none; };
};

include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";

-- Save & Quit (:wq) 

Note: Create forward and reverse zone files which we mentioned in the ‘/etc/named.conf’ file.

Step: 7. Create Forward Zone :

# vi /var/named/forward.zone

$TTL 86400
@   IN  SOA     server1.domain.com. root.server1.domain.com. (
        2011071001  ;Serial
        3600        ;Refresh
        1800        ;Retry
        604800      ;Expire
        86400       ;Minimum TTL
)
           IN   NS          server1.domain.com.
server1    IN   A           192.168.72.140

-- Save & Quit (:wq) 

Step: 8. Create Reverse Zone :

# vi /var/named/reverse.zone

$TTL 86400
@   IN  SOA     server1.domain.com. root.server1.domain.com. (
        2011071001  ;Serial
        3600        ;Refresh
        1800        ;Retry
        604800      ;Expire
        86400       ;Minimum TTL
)
          IN  NS           server1.domain.com.
140       IN  PTR          server1.domain.com.

-- Save & Quit (:wq) 

Step: 9. Now Change Group of forward.zone & reverse.zone :

# cd /var/named/
# chgrp named forward.zone
# chgrp named reverse.zone

Step: 10. Restart the named Service :

Note: FIXING THE BIND (NAMED) SERVICE BUG – GENERATING /ETC/RNDC.KEY

# rndc-confgen -a -r /dev/urandom

# service named restart
# chkconfig named on

Step: 11. The DNS Server is ready now, 9. it’s time to Test :

# dig server1.domain.com
# dig -x 192.168.72.140
# nslookup
> sever1.domain.com
> 192.168.72.140

Thanks For Visiting on My Blog, For More Tutorials Keep Visiting My Blog

 

How to Install Latest MySQL 5.7.9 on Centos/RHEL 6x

Install Latest MySQL 5.7

Step: 1. Download the MySQL 5.7 Repository :

# cd /tmp
# wget http://dev.mysql.com/get/mysql57-community-release-el6-7.noarch.rpm (For RHEL/CentOS 6)
# wget http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm (For RHEL/CentOS 7)

Step: 2. Install MySQL 5.7 Repository :

# yum localinstall mysql57-community-release-el6-7.noarch.rpm  (For RHEL/CentOS 6)
# yum localinstall mysql57-community-release-el7-7.noarch.rpm  (For RHEL/CentOS 7)

Step: 3. Verify that the MySQL Yum Repository has been Added Successfully :

# yum repolist enabled | grep "mysql.*-community.*"

Step: 4. Installing Latest MySQL Version :

# yum -y install mysql-community-server

Step: 5. To Install Specific Version of MySQL from Specific Sub-Repository (Optional):

Note: You can also install different MySQL version using different sub-repositories of MySQL Community Server. MySQL series (currently MySQL 5.7) is activated by default, and the sub-repositories for all other versions (for example, the MySQL 5.6 or 5.5 series) are Deactivated by Default.

# yum-config-manager --disable mysql57-community
# yum-config-manager --enable mysql56-community

Then Run:

# yum repolist enabled | grep "mysql.*-community.*"
# yum -y install mysql-community-server

Step: 6. Start the MySQL Server :

# service mysqld restart
# chkconfig mysqld on

Step: 7. Change the MySQL Password Policy :

# vi /etc/my.cnf

Add these 3 lines below [mysqld]

validate_password_policy=LOW
validate_password_length=6
validate_password_dictionary_file=YES
validate_password_special_char_count =0
validate_password_mixed_case_count = 0

-- Save & Quit (:wq)

# service mysqld restart

Step: 8. Set MySQL Root Password :

# grep 'temporary password' /var/log/mysqld.log

Output: A temporary password is generated for root@localhost: zB#cXVhVb3(c

Step: 9. Check the root Login & Password Policy :

# mysql - u root -p
Enter password: zB#cXVhVb3(c

mysql> SHOW VARIABLES LIKE 'validate_password%';

+----------------------------------------+--------+
| Variable_name                                       | Value    |
+----------------------------------------+--------+
| validate_password_dictionary_file          |             |
| validate_password_length                      | 6          |
| validate_password_mixed_case_count   | 0          |
| validate_password_number_count         | 1          |
| validate_password_policy                      | LOW   |
| validate_password_special_char_count  | 0          |
+----------------------------------------+--------+
6 rows in set (0.07 sec)

mysql> exit

Step: 10. Change the Root Password :

# mysql_secure_installation

Enter password for user root: zB#cXVhVb3(c

Change the password for root ? ((Press y|Y for Yes, any other key for No) : y

New password: redhat123
Re-enter new password: redhat123

Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y
Remove anonymous users? (Press y|Y for Yes, any other key for No) : y
Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y
Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y
Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y

Step: 11. Allow Root Login from Remote :

# mysql -u root -predhat123

mysql> grant all privileges on *.* to root@'%' identified by 'redhat123' with grant option;
mysql> exit

Thanks For Visiting on My Blog, For More Tutorials Keep Visiting My Blog


Wednesday, 27 January 2016

How to Attach & Mount S3 Bucket on CentOS/RHEL & Ubuntu using S3FS

Install S3 Bucket


Q. What Is Amazon S3?

-- Amazon Simple Storage Service is storage for the Internet. It is designed to make web-scale computing easier for developers. Amazon S3 has a simple web services interface that you can use to store and retrieve any amount of data, at any time, from anywhere on the web.


Step: 1. Install Required Packages :

For CentOS/RHEL Users:

# yum -y install gcc libstdc++-devel gcc-c++ curl-devel libxml2-devel openssl-devel mailcap

For Ubuntu Users:

# apt-get -y install build-essential libcurl4-openssl-dev libxml2-dev mime-support

Step: 2. Install Latest Fuse :

For CentOS/RHEL Users:

# yum -y install fuse fuse-devel

For Ubuntu Users:

# apt-get -y install fuse fuse-utils

Step: 3. Download and Compile Latest S3FS :

# cd /usr/src/
# wget https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/s3fs/s3fs-1.74.tar.gz
# tar xzf s3fs-1.74.tar.gz
# cd s3fs-1.74
# ./configure --prefix=/usr/local
# make && make install

Step: 4. Make a File in /etc/passwd-s3fs & Put the Bucket_name, Access Key & Secret Key :

# vi /etc/passwd-s3fs

bucket_name:Aws_Access_Key:Aws_Secret_Key

-- Save & Quit (:wq)

Step: 5. Give Permission :

# chmod 640 /etc/passwd-s3fs

Step: 6. To Mount the S3 :

# mkdir /s3backups
# chmod -Rf 755 /s3backups
# /usr/local/bin/s3fs bucket_name /s3backups -ouse_cache=/tmp -o use_rrs=1

Step: 7. For Permanently Mount s3 :

# vi /etc/fstab

s3fs#bucket_name /s3backups fuse _netdev,use_cache=/tmp,use_rrs=1,allow_other 0 0

-- Save & Quit (:wq)

Step: 8. Unmount s3 :

# fusermount -u /s3backups

Thanks For Visiting on My Blog, For More Tutorials Keep Visiting My Blog


Tuesday, 26 January 2016

How to Install & Configure OsTicket on Centos/RHEL 6x

Install OsTicket


Q. What is OSTicket ?

-- OSTicket is a widely-used and trusted open source support Ticket System. It seamlessly routes
   inquiries created via email, web-forms and phone calls into a simple, easy-to-use, multi-user,
   web-based customer support platform.

Requirements:
===========

1. Install httpd.
2. Install mysql.
3. Install php.
4. Install OsTicket.

Step: 1. Install Apache Server :

# yum -y install httpd httpd-devel

Step: 2. Restart Apache Server :

# service httpd restart
# chkconfig httpd on

Step: 3. Install & Configure MySQL :

# yum -y install mysql mysql-server mysql-devel

Step: 4. Start Mysqld Service :

# service mysqld restart
# chkconfig mysqld on

Step: 5. Changing MySQL Root Password :

# mysql_secure_installation

Step: 6. Create Database for OsTicket  :

# mysql -u root -p
Enter password:

mysql> create database osticket;
mysql> grant all privileges on osticket.* to osticket@'localhost' identified by 'password';
mysql> flush privileges;
mysql> exit

Step: 7. Install PHP 5.3 :

# yum -y install php php-mysql php-common php-gd php-mbstring php-mcrypt php-devel \
  php-xml php-imap php-ldap php-mbstring php-odbc php-pear php-xmlrpc php-soap mod_ssl

Step: 8. Restart Apache Service :

# service httpd restart

Step: 9. Install & Configure OsTicket :

# yum -y install unzip
# cd /var/www/html
# wget http://osticket.com/sites/default/files/download/osTicket-v1.9.2.zip
# unzip osTicket-v1.9.2.zip
# ls -ltr
# mv upload support

Step: 10. Rename & Change Permission of 'ost-config.sample.php' :

# cd /var/www/html/support/include
# mv ost-config.sample.php ost-config.php
# chmod 777 ost-config.php

Step: 11. Enable Short_Open_Tag from /etc/php.ini :

# vi /etc/php.ini

-- Find This Line 'short_open_tag'

short_open_tag = On

-- Save & Quit (:wq)

Step: 12. Restart Apache Server :

# service httpd restart

Step: 13. Open Browser & Type :


http://ip address/support/setup/

-- System Settings :
   Helpdesk Name: Support Portal
   Default Email: kchatter@domain.com
   Default Language: English

-- Admin User :
   First Name: Kousik
   Last Name : Chatterjee
   Email Add : kchatterjee@domain.com
   Username  : administrator
   Password  : Passw0rd
   Retype Pass : Passw0rd

-- Database Settings :
   MySQL Hostname : localhost
   MySQL Database : osticket
   MySQL Username : osticket
   MySQL password : password

-- Click On 'Install Now'

Step: 14. After installed OsTicket Delete the /osticket/setup Directory :

# cd /var/www/html/support
# rm -rf setup

Step: 15. Change ost-config.php file Permission :

# chmod 644 /var/www/html/support/include/ost-config.php

Step: 16. Configure Apache Server :

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

<Directory /var/www/html/support/scp>
    Options +Indexes +Multiviews
        DirectoryIndex index.php
    AllowOverride All
    Allow from all

</Directory>

Uncommented :

NameVirtualHost *:80

-- Save & Quit (:wq)

Step: 17. Create a file under /etc/httpd/Conf.d Folder :

# vi /etc/httpd/conf.d/domain.com.conf

<VirtualHost *:80>

  # Admin email, Server Name (domain name) and any aliases
  ServerAdmin techsupport@domain.com
  ServerName www.domain.com
  ServerAlias domain.com
 
  # Index file and Document Root (where the public files are located)
  DirectoryIndex index.php
  DocumentRoot /var/www/html/support/scp

  # Custom log file locations
  LogLevel warn
  ErrorLog  /logs/domain.com-error_log
  CustomLog /logs/domain.com-access_log combined

</VirtualHost>

-- Save & Quit (:wq)

Step: 18. Restart Apache Server :

# mkdir /logs
# service httpd restart

Step: 19. Open Browser & Type :

http://domain.com/support
User: administrator
Pass: Passw0rd

Below, You'll Find some useful links regarding your Installation.

Your osTicket URL:
http://sever_ip_address/support/   

Your Staff Control Panel:
http://sever_ip_address/support/scp

osTicket Forums:
http://osticket.com/forum/   

osTicket Community Wiki:
http://osticket.com/wiki/

Thanks For Visiting on My Blog, For More Tutorials Keep Visiting My Blog

 

How to Install & Configure Redmine 2.6.1 on RHEL/Centos 6x

Install and Configure Redmine

Q. What is Redmine ?

Ans: Redmine is a flexible project management web application. Written using the Ruby on Rails framework, it is cross-platform and cross-database.

Features :

1. Multiple projects support
2. Flexible role based access control
3. Flexible issue tracking system etc.

Step: 1. Stop Iptables :

# service iptables stop
# chkconfig iptables off

Step: 2. Disable Selinux :

# vi /etc/sysconfig/selinux

SELINUX=disabled

-- Save & Quit (:wq)

Step: 3. Restart the Server :

# init 6

Step: 4. Install Prerequisites :

# yum install -y ruby-devel gcc-c++ openssl-devel httpd httpd-devel make ruby-rdoc libcurl-devel rubygem-rake zlib-devel curl-devel apr-devel apr-util-devel wget

Step: 5. Install Ruby :

# cd /tmp
# wget http://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.2.tar.gz
# tar -zxvf ruby-2.1.2.tar.gz
# cd ruby-2.1.2
# ./configure
# make install
# cd ..
# rm -rf ruby-2.1.2.tar.gz ruby-2.1.2

Step: 6. To Check Ruby Version :

# ruby -v

Step: 7. Install Rubygems :

# cd /tmp
# wget http://production.cf.rubygems.org/rubygems/rubygems-2.2.2.tgz
# tar zxvf rubygems-2.2.2.tgz
# cd rubygems-2.2.2
# ruby setup.rb
# cd ..
# rm -rf rubygems-2.2.2.tgz rubygems-2.2.2

Step: 8. To Check Gems Version :

# gem -v

Step: 9. Install Passenger :

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

Press Enter and press " ! " and make sure you select only the ruby one.

**LOOK CAREFULLY after successfully installing it give codes .we must edit in our apache. FOR ME .It may be other for you. ========================================================================
LoadModule passenger_module /usr/local/lib/ruby/gems/2.1.0/gems/passenger-4.0.50/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c>
PassengerRoot /usr/local/lib/ruby/gems/2.1.0/gems/passenger-4.0.50
PassengerDefaultRuby /usr/local/bin/ruby
</IfModule>
=========================================================================

Step: 10. To Load the Passenger Module into Apache :

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

Go, to the load module section and paste it.
Add the below line. In the module section. Line num 202.

LoadModule passenger_module /usr/local/lib/ruby/gems/2.1.0/gems/passenger-4.0.50/buildout/apache2/mod_passenger.so

Add the following line on line number 377.

<IfModule mod_passenger.c>
PassengerRoot /usr/local/lib/ruby/gems/2.1.0/gems/passenger-4.0.50
PassengerDefaultRuby /usr/local/bin/ruby
</IfModule>

-- Save & Quit (:wq)

Step: 11. Now, you can download the latest version of Redmine :

# cd /var/www/html
# wget wget http://www.redmine.org/releases/redmine-2.6.1.zip
# unzip redmine-2.6.1.zip
# mv redmine-2.6.1 redmine
# rm -rf redmine-2.6.1.zip
# chown -R apache.apache /var/www/html/redmine
# chmod -R 755 /var/www/html/redmine
# touch /var/www/html/redmine/log/production.log
# chown root.apache /var/www/html/redmine/log/production.log
# chmod 664 /var/www/html/redmine/log/production.log

Step: 12. Start the Apache Server :

# service httpd restart
# chkconfig httpd on

Step: 13. Install Mysql Server :

# yum -y install mysql mysql-server mysql-devel

Step: 14. Start Mysql Service :

# service mysqld restart
# chkconfig mysqld on

Step: 15. Set MySQL Root Password :

# mysql_secure_installation

Step: 16. Create Database for Redmine :

# mysql -u root -p
Enter Password:

mysql> create database redminedb character set utf8;
mysql> grant all privileges on redminedb.* to redmine@'localhost' identified by 'password';
mysql> flush privileges;
mysql> exit

Step: 17. Now, Install the Gem file and the bundler :

# gem install rake rack i18n rubytree RedCloth mysql coderay rails jquery-rails fastercsv builder mime-types awesome_nested_set activerecord-jdbc-adapter selenium-webdriver shoulda mysql2

# cd /var/www/html/redmine
# gem install bundler
# bundle install --without development test rmagick

Note: If you see any of the gem is not installing then go to.

# cd /var/www/html/redmine
# vi Gemfile

Commented the following line, Line no. 29

# gem "rmagick", ">= 2.0.0"

-- Save & Quit (:wq)

Step: 18. Setup the Database Connection for Redmine :

# cd /var/www/html/redmine/config
# mv database.yml.example database.yml
# vi database.yml

In the production section, update username, password and other parameters accordingly like so :

production:

adapter: mysql2
database: redmine
host: localhost
username: redmine
password: redhat
encoding: utf8

-- Save & Quit (:wq)

Step: 19. Create the Virtual host files for running Redmine :

# vi /etc/httpd/conf.d/redmine.conf

<VirtualHost *:80>
ServerName redmine

DocumentRoot /var/www/html
Alias /redmine /var/www/html/redmine/public

<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/html/redmine>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
<Directory /var/www/html/redmine/public>
PassengerEnabled on
SetHandler none
PassengerAppRoot /var/www/html/redmine
RailsBaseURI /redmine
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
</VirtualHost>

-- Save & Quit (:wq)

Step: 20. Restart Apache Server :

# service httpd restart

Step: 21. Set Environment to "production" Environment :

# cd /var/www/html/redmine/config
# vi environment.rb

If there is line uncomment it if not just proceed ahead.

ENV['RAILS_ENV'] ||= 'production'

Step: 22. In Terminal, use Following Command :

# gem install mysql2
# RAILS_ENV=production bundle exec rake generate_secret_token
# RAILS_ENV=production bundle exec rake db:migrate
# RAILS_ENV=production bundle exec rake redmine:load_default_data

Type en when asked.

Step: 23. Rename dispatch CGI files in /redmine/public/ :

# cd /var/www/html/redmine/public
# mv dispatch.fcgi.example dispatch.fcgi
# cp htaccess.fcgi.example .htaccess

Step: 24. Fix Rights for the Apache user :

# cd /var/www/html
# chown -R apache:apache redmine

Step: 25. Also, for Configuration of Email :

# cd /var/www/html/redmine/config
# cp configuration.yml.example configuration.yml
# vi configuration.yml

Just close.
You can configured the email as per your need.

Step: 26. Restart the Apache Server :

# service httpd restart

Step: 27. Point Your Web Browser & Type :

http://ip_address_server/redmine
or
http://domain_name/redmine
User: admin
Pass: admin

Thanks For Visiting on My Blog, For More Tutorials Keep Visiting My Blog


Sunday, 24 January 2016

How to Install Skype on RHEL/CentOS 6x

Install Skype on Linux

Step: 1. Download Skype 4.2 :

# cd /mnt
# wget http://download.skype.com/linux/skype_static-4.0.0.8.tar.bz2

Step: 2. Install Needed Dependencies :

# yum install alsa-lib.i686 fontconfig.i686 freetype.i686 glib2.i686 libSM.i686 libXScrnSaver.i686 libXi.i686 libXrandr.i686 libXrender.i686 libXv.i686 libstdc++.i686 pulseaudio-libs.i686 qt.i686 qt-x11.i686 zlib.i686

Step: 3. Extract Skype :

# mkdir /opt/skype
# tar xvf skype_static* -C /opt/skype --strip-components=1

Step: 4. Create libtiff.so.4 link on CentOS / Red Hat :

# cd /usr/lib
# ln -s libtiff.so.3 /usr/lib/libtiff.so.4

Step: 5. Create Launcher, Link icons, lang and sounds :

# ln -s /opt/skype/skype.desktop /usr/share/applications/skype.desktop
# ln -s /opt/skype/icons/SkypeBlue_48x48.png /usr/share/icons/skype.png
# ln -s /opt/skype/icons/SkypeBlue_48x48.png /usr/share/pixmaps/skype.png

# touch /usr/bin/skype
# chmod 755 /usr/bin/skype
# vi /usr/bin/skype

#!/bin/sh
export SKYPE_HOME="/opt/skype"

$SKYPE_HOME/skype --resources=$SKYPE_HOME $*

-- Save & Quit (:wq)

Step: 6. Start Skype :

Open Terminal & Type: skype

Thanks For Visiting on My Blog, For More Tutorials Keep Visiting My Blog

 
Copyright © 2016 Kousik Chatterjee's Blog