THE IT IDEAS

  • Home

Tuesday, 25 November 2014

How to install Tomcat in Ubuntu

 THE IT IDEAS     17:15     tomcat   

Prerequisite for Tomcat Server
- java jdk


Download tomcat with below commands.
#cd /opt
#wget http://ftp.nluug.nl/internet/apache/tomcat/tomcat-8/v8.0.9/bin/apache-tomcat-8.0.9.zip
#unzip apache-tomcat-8.0.9.zip
#mv apache-tomcat-8.0.9 tomcat


Configure environment variable for Tomcat
#nano ~/.bashrc

Copy below line and paste in opened file and save.
export CATALINA_HOME=~/path/to/tomcat

Run below command to effective the change.
#~/.bashrc


Run Below command to Start Tomcat script.
#CATALINE_HOME/bin/startup.sh

You can see the webpage on localhost:8080 in your machine.
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

How to install Oracle JAVA JDK with apt-get command

 THE IT IDEAS     17:04     java   


Installing Oracle JAVA JDK

Run below command to one by one to install JAVA JDK.

#apt-get install python-software-properties
#add-apt-repository ppa:webupd8team/java
#apt-get update


To Install JDK6 Run below Command

#apt-get install oracle-java6-installer

To Install JDK7 Run below Command

#apt-get install oracle-java7-installer

To Install JDK8 Run below Command

#apt-get install oracle-java8-installer

Installation of JAVA JDK is Over !!!




Managing Java
When there are multiple Java installations on your ubuntu, the Java version to use as default can be chosen. To do this, execute the following command:

#update-alternatives --config java

It will usually return something like this if you have 2 installations (if you have more, it will of course return more):

There are 2 choices for the alternative java (providing /usr/bin/java).

Selection    Path                                            Priority   Status
------------------------------------------------------------
* 0            /usr/lib/jvm/java-7-oracle/jre/bin/java          1062      auto mode
  1            /usr/lib/jvm/java-6-oracle/jre/bin/java          1061      manual mode


Press enter to keep the current choice[*], or type selection number:


You can now choose the number to use as default. This can also be done for the Java compiler (javac):

#update-alternatives --config javac

It is the same selection screen as the previous command and should be used in the same way. This command can be executed for all other commands which have different installations. In Java, this includes but is not limited to: keytool, javadoc and jarsigner.
Setting the "JAVA_HOME" environment variable

To set the JAVA_HOME environment variable, which is needed for some programs, first find out the path of your Java installation:

#update-alternatives --config java

It returns something like:

There are 2 choices for the alternative java (providing /usr/bin/java).

Selection    Path                                            Priority   Status
------------------------------------------------------------
* 0            /usr/lib/jvm/java-7-oracle/jre/bin/java          1062      auto mode
  1            /usr/lib/jvm/java-6-oracle/jre/bin/java          1061      manual mode

Press enter to keep the current choice[*], or type selection number:

The path of the installation is for each:

    /usr/lib/jvm/java-7-oracle

    /usr/lib/jvm/java-6-oracle

Copy the path from your preferred installation and then edit the file /etc/environment:

#nano /etc/environment

In this file, add the following line (replacing YOUR_PATH by the just copied path):

JAVA_HOME=/usr/lib/jvm/java-7-oracle

That should be enough to set the environment variable. Now reload this file:

#source /etc/environment

Test it by executing:

#echo $JAVA_HOME
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

How to set environment Variable permenantly in MAC OS 10.9

 THE IT IDEAS     16:47     environment   


#echo $PATH
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin

# nano ~/.bash_profile

Paste whole output of first echo command and save the file.

Run below command to use .bash_profile file
#source ~/.bash_profile

You can add another environment variable in above file. and It will remain the same after reboot.
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

How to Mount AWS S3 Bucket into AWS EC2 Instance (Linux)

 THE IT IDEAS     16:10     EC2, mount, s3   

First need to create access key from AWS Console Under Security Credentials, create AWS Access key ans Security key

Create file /etc/passwd-s3fs
#touch /etc/passwd-s3fs

Paste your Accesskeyid and Secret Access Key id in this file with below formet and save.

accesskeyid:secretaccesskey

give apropriate right to this file.
#chmod 400 /etc/passwd-s3fs
#chown root:root /etc/passwd-s3fs



Installation of Fuse and S3FS.

#cd /opt

download fuse from source website:
#wget http://downloads.sourceforge.net/project/fuse/fuse-2.X/2.9.3/fuse-2.9.3.tar.gz

untar the downloaded archive
#tar -xvzf fuse-2.9.3.tar.gz
#cd fuse-2.9.3


configure the script and install
#./configure --prefix=/usr
#make
#make install


add the FUSE module to Ubuntu kernel
#modprobe fuse

to check if you have the latest version of FUSE installed, type
#pkg-config --modversion fuse



#cd /opt
Download s3fs with below command
#wget https://s3fs.googlecode.com/files/s3fs-1.74.tar.gz

untar the downloaded archive
#tar -xvzf s3fs-1.74.tar.gz
#cd s3fs-1.74


configure the script and install
#./configure --prefix=/usr
#make
#make install


Open /etc/fuse.conf file to make small change.
#nano /etc/fuse.conf

Uncomment the line where it says #user_allow_other.
To uncomment, just remove the "#" before user_allow_other and save.

Create one Directory to mount S3 bucket.

#mkdir /s3dir

Open below file and add one file to mount permenantly.
#nano /etc/fstab

Add below line into fstab file and save.

s3fs#s3bucketname /s3dir fuse allow_other,use_cache=tmp 0 2

Run below command to apply changes on fstab file.
#mount -a

Check the disk with below command.
#df -h
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Monday, 24 November 2014

How to change DocumentRoot path in Apache Ubuntu 14.04 LTS

 THE IT IDEAS     11:21     apache2, DocumentRoot change, ubuntu   

Make backup copy of Apache default file with below command

#sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/000-default.conf.bak

Edit 000-default.conf file to give DocumentRoot path

#sudo nano /etc/apache2/sites-available/000-default.conf

and change the following line with you new path:

DocumentRoot /var/www/html    (Default Line)


To


DocumentRoot /mywebsite   (Your website path)

after make changes in this file. Save and Close 000-default.conf file.

Now, Open apache.conf file and change the DocumentRoot path here as well.

#sudo nano /etc/apache2/apache2.conf

and find this

<Directory /var/www/html/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>

and change /var/www/html to your preferred directory and save it.

After made changes in both files, just restart the apache2 webserver.

Use below command to restart apache server.
#sudo service apache2 restart
OR
#sudo /etc/init.d/apache2 restart



If you will receive permission error check the user of apache and give the permission.

To check user of apache run below command.

#ps aux | grep apache

Above command will show like this.





Then run below command to give permission.

#sudo chown -R $USER:$USER /mywebsite             

The $USER variable will take the value of the user you are currently logged in

Give permission to folder with below command
#sudo chmod -R 755 /mywebsite
Now restart the webserver.

#sudo service apache2 restart
OR
#sudo /etc/init.d/apache2 restart


Check Now !!
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Thursday, 20 November 2014

How to Benchmarking Webserver

 THE IT IDEAS     15:53     How to Benchmarking Webserver   

By Default Apache providing benchmarking command as "ab". With this command you can measure Number of requests to perform for the benchmarking session with no. of Number of multiple requests to perform at a time.



Command with Output



# ab -n 1000 -c 100 localhost/test.php

This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking localhost (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requests


Server Software:        Apache/2.2.26
Server Hostname:        localhost
Server Port:            80

Document Path:          /test.php
Document Length:        7 bytes

Concurrency Level:      100
Time taken for tests:   0.195 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      230460 bytes
HTML transferred:       7014 bytes
Requests per second:    5121.43 [#/sec] (mean)
Time per request:       19.526 [ms] (mean)
Time per request:       0.195 [ms] (mean, across all concurrent requests)
Transfer rate:          1152.62 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    1   0.7      0       4
Processing:     3   18   4.7     17      30
Waiting:        3   18   4.7     17      30
Total:          7   19   4.4     18      31
WARNING: The median and mean for the initial connection time are not within a normal deviation
        These results are probably not that reliable.

Percentage of the requests served within a certain time (ms)
  50%     18
  66%     19
  75%     21
  80%     22
  90%     26
  95%     28
  98%     29
  99%     29
 100%     31 (longest request)



Note ::
"-n" switch for Number's of request.
"-c" switch for Number of multiple request at a time

Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

How to Choose AWS EC2 Instance

 THE IT IDEAS     13:22     EC2, instance   


Important Concepts
Let's start with some concepts, just to make sure that we are all on the same page.
An Amazon Machine Image (AMI) is a template that defines your operating environment, including the operating system. A single AMI can be used to launch one or thousands of instances.
Instances provide compute power and are the fundamental building blocks. Instances are created by launching an Amazon Machine Image (AMI) on a particular instance type. You can scale the number of instances you are running up or down on demand, either manually or automatically, using Auto Scaling.
Instance Types comprise various combinations of CPU, memory, storage, and networking capacity and give you the flexibility to choose the appropriate mix of resources for your applications. Each instance type has one or more size options that address different workload sizes. For the best experience, you should launch on instance types that are the best fit for your applications.
Instance Families are collections of instance types designed to meet a common goal. To make it easier for you to select the best option for your applications, Amazon EC2 instance types are grouped together into families based on target application profiles.
A vCPU is a virtual Central Processing Unit (CPU). A multicore processor has two or more vCPUs.

Meet the Family

Today, Amazon EC2 gives you the option of choosing between 10 different instance types, distributed across 6 instance families. You have the flexibility to choose the combination of instance types and sizes most appropriate for your application today, and you can always change the type you use later as your business and application needs change. So what are the available instance families and instance types?

General-Purpose

This family includes the M1 and M3 instance types, both of which provide a balance of CPU, memory, and network resources making them a good choice for many applications. For many of you, this family is often the first choice, with sizes ranging from 1 vCPU with 2 GiB of RAM to 8 vCPUs with 30 GiB of RAM. The balance of resources makes them ideal for running small and mid-size databases, more memory-hungry data processing tasks, caching fleets, and backend servers for SAP, Microsoft SharePoint, and other enterprise applications.
M3 instances are the newest generation of general-purpose instances, and give you the option of a larger number of virtual CPUs (vCPUs) that provide higher performance. M3 instances are recommended if you are seeking general-purpose instances with demanding CPU requirements. M1 instances are the original family of general-purpose instances and provide the lowest cost options for running your applications. M1 instances are a great option if you want smaller instance sizes with moderate CPU performance, and a lower overall price.
Compute-Optimized

This family includes the C1 and CC2 instance types, and is geared towards applications that benefit from high compute power.
Compute-optimized instances have a higher ratio of vCPUs to memory than other families and the lowest cost per vCPU of all the Amazon EC2 instance types. If you are running any CPU-bound scale-out applications, you should look at compute-optimized instances first. Examples of such applications include front end fleets for high-traffic web sites, on-demand batch processing, distributed analytics, web servers, video encoding, and high performance science and engineering applications like genome analysis, high-energy physics, or computational fluid dynamics.
CC2 instances are the latest generation of compute-optimized instances and provide the lowest cost for CPU performance for all Amazon EC2 instance types. In addition, CC2 instances provide a number of advanced capabilities: Intel Xeon E5-2670 processors; high core count (32 vCPUs); and support for cluster networking. These capabilities allowed us to create a cluster of 1064 CC2 instances that achieved a Linpack score of 240.09 Teraflops, good for an entry at number 42 in the November 2011 Top500 supercomputer list.
C1 instances are the first generation of compute-optimized instances. They are available in smaller sizes and are ideal for massively scaled-out applications at massive scale. Most examples of customers launching 1000s of instances to transcode videos or for virtual drug design are likely to take advantage of C1 instances.


Memory-Optimized

This family includes the M2 and CR1 instance types and is designed for memory-intensive applications. Instances in this family have the lowest cost per GiB of RAM of all Amazon EC2 instance types. If your application is memory-bound, you should use these instances. Examples include high performance databases and distributed cache, in-memory analytics, genome assembly, and larger deployments of SAP, Microsoft SharePoint, and other enterprise applications. In general, if you are running a performance-sensitive database you should first look at this family.
CR1 instances are the latest generation of memory-optimized instances and provide more memory (244 GiB), faster CPU (Intel Xeon E5-2670) compared to M2 instances. CR1 instances also support cluster networking for bandwidth intensive applications.
M2 instances are available in smaller sizes, and are an excellent option for many memory-bound applications. 
 
Storage-Optimized

This family includes the HI1 and HS1 instance types, and provides you with direct-attached storage options optimized for applications with specific disk I/O and storage capacity requirements. Currently there are two types of storage-optimized instances.
HI1 instances are optimized for very high random I/O performance and low cost per IOPS. These instances can deliver over 120,000 4k random read IOPS making them ideal for transactional applications. In particular, we designed these instances to be the best platform for large deployments of NoSQL databases like Cassandra and MongoDB.
HS1 instances are optimized for very high storage density, low storage cost, and high sequential I/O performance. HS1 instances give 48 TB of storage capacity across 24 hard disk drives, high network performance, and are capable of supporting throughput performance of as much as 2.6 GBps. These instances are designed for large-scale data warehouses, large always-on Hadoop clusters, and for cluster file systems. Indeed, HS1 instances are the underlying instance type for our petabyte-scale data warehousing service, Amazon Redshift.
 
Micro Instances

Micro, or T1, instances are a very low-cost instance option providing a small amount of CPU resources. Micro instances may opportunistically increase CPU capacity in short bursts when additional cycles are available. They are well suited for lower throughput applications like bastion hosts or administrative applications, or for low-traffic websites that require additional compute cycles from time to time.
Micro instances are available in the AWS Free Usage Tier to allow you to explore EC2 functionality at no charge. Due to the opportunistic scheduling used by Micro instances, you should not use them for applications that require sustained CPU performance. You can learn more about the characteristics of Micro instances and appropriate workload characteristics in the Amazon EC2 documentation.
GPU Instances. This family includes the CG1 instance type, and allows you to take advantage of the parallel performance of NVidia Tesla GPUs using the CUDA or OpenCL programming models for GPGPU computing. GPU instances also provide high CPU capabilities and support cluster networking. For applications like AMBER, a molecular dynamics application, you can get 4-5x improvement in performance compared to CC2 instances. Many of you are running computational chemistry, rendering, and financial analysis applications on CG1 instances today to take advantage of the speedup you can get from GPGUs.

Referance by :: http://aws.amazon.com/blogs/aws/choosing-the-right-ec2-instance-type-for-your-application/
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg
Newer Posts Older Posts Home

Like Us !!!

Recent Posts

Blog Archive

  • ▼  2016 (1)
    • ▼  April (1)
      • How to Install PHP 7.0, Apache 2.4.18, & MySQL 5.7...
  • ►  2015 (12)
    • ►  August (1)
    • ►  May (2)
    • ►  April (8)
    • ►  March (1)
  • ►  2014 (23)
    • ►  December (8)
    • ►  November (12)
    • ►  April (2)
    • ►  March (1)
  • ►  2013 (7)
    • ►  December (1)
    • ►  April (1)
    • ►  March (1)
    • ►  February (1)
    • ►  January (3)
  • ►  2012 (15)
    • ►  December (6)
    • ►  November (9)

Categories

apache2 EC2 error mysql php ubuntu aws aws rds browser github installation linux mount s3 AWS Bucket CentOS Computer DocumentRoot change How to Benchmarking Webserver IP LAMP Restart Computer SCP command SQL SERVER XRDP administrator amazon rds backup basic commands chat command line disable download drupal ec2.chroot environment external storage device fstab functions geoip gmail google home page iis instance internet java mod rewrite mongodb multiple login network password one password php5 php5-fpm php7 private browsing python repair filesystem repo reset password rhel sa password same computer script sftp share skype ssh tomcat ubuntu 16.04 ubuntu16 visudo windows 8 youtube
JobsMagBlogJobsMag.InThingsGuide

Popular Posts

  • PDOException: SQLSTATE[42000]: 1148 The used command is not allowed with this MySQL version in AWS RDS
    To Resolve this error you have to connect mysql with below command then you can able to run LOCAL INFILE command in mysql console or drupal...
  • How to make Google Chrome Theme
    Open Google Chrome and open Chrome web store and search my chrome theme Click on Add to Chrome     Click on Add to downloadi...
  • How to disable Username and Password in Network pc
    1. Click Start 2. Control Panel 3. Network and Internet 4. Network and Sharing Center 5. Click Choose homegroup and sharing options...

Copyright © THE IT IDEAS | Powered by Blogger