SCM-Manager Installation

1. RPM installation.

Create a new file at /etc/yum.repos.d/SCM-Manager.repo with the following content to install the scm-manager repository:

[scm-releases]
name=SCM-Manager Releases
baseurl=http://maven.scm-manager.org/nexus/content/repositories/releases
enabled=1
protect=0
gpgcheck=0
metadata_expire=30s
autorefresh=1
type=rpm-md


2. Install openjdk package.

  yum install java-1.x.0-openjdk

3. Install scm-server package.

  yum install scm-server
                           
4. By default, it runs on port 8080

Hit http://localhost:8080/scm on web browser, pProvide username, and password as ‘scmadmin’ and login.


Reference Link: SCM-Manager Configuration.

How to Create Project in SCM-Manager

1. Under Repositories tab click on Add to create a new project. 



2. Provide the Name of the Project under “Name:” field say project1
Select Subversion in drop down box under field “Type:”
Provide contact details such as email id under field “Contacts:”
Provide description of the project under field “Description:”
And click OK.



3. After creating the repository you will get the svn url under field “Url:”
This url is used for taking repository checkout and also committing the code in svn.    



4. Now add the users under Permission tab who are going to access this repository for taking checkout and committing new codes under the repository.  



Local SVN

Step 1: Installation of Packages.
The Two packages needed for svn is as below

#yum install -y subversion mod_dav_svn
* httpd package needs to be installed.

Step 2: Create and configure Subversion Repository.
The steps that I am going to follow are as follows.
1. Create subversion directory under /usr/local/ and change the owner and group as apache.apache.

#mkdir /usr/local/subversion
#chown –R apache.apache subversion/  #subversion and inside all the directories will have                                                                apache.apache ownership

Here the subversion folder will contain all the repository that we are going to create now and in future.

2. Create repository by using svnadmin command as follows.

#svnadmin create myproject1
* Here my repository name is myproject1

3. Touch svnupload.sh file and add following lines and save.
#vim svnupload.sh   
       
#!/bin/bash
home_dir=/usr/local/subversion/myproject1/
svnlook changed /usr/local/subversion/myproject1 >> /usr/local/subversion/myproject1/test.txt
cat /usr/local/subversion/myproject1/test.txt| sed 's/^[A-Z]//g'| sed 's/^  //g' >> /usr/local/subversion/myproject1/upload.txt
for i in `cat /usr/local/subversion/myproject1/upload.txt`;do svn export --username "svn" --password "svn123" --no-auth-cache http://localhost/myproject1/$i /var/www/html/$i --force;done
for i in `cat /usr/local/subversion/myproject1/upload.txt`;do chown -R apache:apache /var/www/html/$i ;done
for i in `cat /usr/local/subversion/myproject1/upload.txt`;do chmod -R 775 /var/www/html/$i ;done
cat /usr/local/subversion/myproject1/test.txt |grep D | sed 's/^[A-Z]//g'| sed 's/^  //g' >> /usr/local/subversion/myproject1/delete.txt
for i in `cat /usr/local/subversion/myproject1/delete.txt`;do /bin/rm –rf /var/www/html/$i ;done
> /usr/local/subversion/myproject1/test.txt
> /usr/local/subversion/myproject1/upload.txt
> /usr/local/subversion/myproject1/delete.txt

 # chmod +x svnupload.sh           #give this file a execute permission   

4. Go to the hooks directory under repository.

#cd /usr/local/subversion/myproject1
#cd hooks
#cp post-commit.tmpl post-commit --- copy post-commit.tmpl as post-commit
#vim post-commit --- open post-commit file

#REPOS="$1"                                                                 #comment this line
#REV="$2"                                                                    #comment this line
#mailer.py commit "$REPOS" "$REV" /path/to/mailer.conf     #comment this line
/bin/sh /usr/local/subversion/myproject1/svnupload.sh        #add this line

#chmod –R 775 hooks/                  #give hooks directory and sub-files 775 permission

Step 3: Configuring subversion.

#cd /etc/httpd/conf.d/
#vim svn.conf --- touch new file say svn.conf and add following line.

<Location /myproject1>
DAV svn
SVNPath /usr/local/subversion/myproject1
AuthType Basic
AuthName "Subversion repositories"
AuthUserFile /etc/httpd/conf.d/.htpasswd
Require valid-user
</Location>

Now create user for subversion say test1

#htpasswd –cm /etc/httpd/conf.d/.htpasswd test1

Now restart Apache service.

Take checkout of the repository on your local machine and try to upload code through local svn.

http://<server-ip-address>/myproject1


For More Details Refer Link What is SVN? && How does SVN work?

How to Create VPC, Subnets, Internet Gateway and Nat Gateway

1. Go to VPC Dashboard under AWS console after you log in.



2. Creating VPC.
Click on Create VPC on VPC dashboard.
Now provide the details as per the requirements.
Here I have Given Name Tag as “Pranav-VPC”.
CIDR block as 192.168.0.0/24 i.e. total 254 host IP’s possible.
Remaining field kept default as it is. 



3. Creating subnets.
Here I am going to create two subnets, one is for Public facing servers and the other one is for Private servers.
First, create a Public subnet with the details as follows.
Name Tag: Public-1a (Depends on you)
VPC: Select VPC created in above step
Availability Zone: us-east-1a (Depends on you)
CIDR block: 192.168.0.0/25 i.e. 128 host IP’s are possible starting from 192.168.0.0 - 192.168.0.127 



Now we create a Private subnet with the details as follows.
Name Tag: Private-1a (Depends on you)
VPC: Select VPC created in the previous step
Availability Zone: us-east-1a (Depends on you)
CIDR block: 192.168.0.64/25 i.e. 128 host IP’s are possible starting from 192.168.0.128 - 192.168.0.255




For More detailed subnet calculation refer http://www.subnet-calculator.com/ 

4. Creating Route tables.
When we create VPC, a default route table associated with that VPC gets created automatically and it is the main route table for that VPC.
Let’s name it as a “Private-RT”.



Create one more route table and name it as “Public-RT”
Associate this route table with our VPC “Pranav-VPC”.



5. Subnet association with route tables.
Under Route tables select “Public-RT”, go to Subnet Associations tab and select public subnet to associate with it.



Similarly select route table “Private-RT”, go to Subnet Associations tab and select private subnet to associate with it.



6. Creating Internet Gateway.
Internet Gateway will be used to route internet bound traffic from the VPC to the internet. 
Go to the Internet Gateway on left side of the dashboard.
Click on Create Internet Gateway and provide Name tag as say “Pranav-IGW”


After creation, click on to Attach to VPC in order to attach the Internet Gateway to VPC say “Pranav-VPC”.  



7. Associating Internet GW with a public subnet.
A public subnet is considered public when there is a route available in the associated route table to the Internet Gateway.
Go to the Route Tables on left side of the Dashboard.
Select Public subnet i.e. “Public-RT” in this case.
Go to the Routes tab and click on add another route.
Add 0.0.0.0/0 at the Destination field and select Internet GW i.e. “Pranav-IGW” at the Target field and then save.


8. Creating NAT Gateway.
Network address translation (NAT) gateway enables instances in a private subnet to connect to the Internet or other AWS services, but prevent the Internet from initiating a connection with those instances.
Go to the “Nat Gateways” on the left side of the VPC Dashboard, click on Create Nat Gateway.
Provide the necessary details, like subnet and Elastic IP, and create the NAT Gateway. 





9. Associating NAT Gateway with a private subnet.
Now go to the “Private-RT” route table and add the route for the traffic destined for the Internet toward the gateway. 





VsFTP Interview Questions

Q) Active and Passive FTP?
Active and Passive FTP are two modes of connection that FTP runs in. FTP uses two channels between client and server, the command channel and the data channel.
Typically command channel is on port no 21 and data channel is on port no 20. The command channel handles commands and responses, the data channel handles actually transferring files.
The difference between active and passive mode lies in whether server or client initiate the data connection.
In active mode, server initiate data connection with the client after the client has established a connection on command channel.
In passive mode, the client establishes the data connection with the server. 

Reference Link: stackoverflow.com

Active FTP:
1. The client connects to FTP server by establishing FTP control connection on port no 21 of the server.
2. Whenever the client requests data over the control connection the server initiates data transfer connection back to the client.
3. The source port for this data transfer connection is always on port no 20 of the server and destination port is the higher port (greater than 1024) on the client side.
4. Active mode is more secure for the server as it does not require an insecure port to be open at server end because it’s the server that initiates the data connection with the client side.

Passive FTP:
1. The client connects to FTP server by establishing FTP control connection on port no 21 of the server.
2. Whenever the client requests data over the control connection the client initiates data transfer connection back to the server.
3. The source port for this data transfer connection is always on the higher port on the client side and destination port is the higher port on the server side.

Reference Link: http://www.slacksite.com/other/ftp.html

Q) Restrict user to their home directory?

DNS Interview Questions

Q) What is DNS?
DNS (Domain Name System) is a service that translates between Internet name and Internet address i.e. it is used to resolve human-readable hostname like google.com into machine-readable IP address 216.58.203.142.

Q) What are DNS records and Types of DNS records?
DNS records are held in zone files used for mapping URL to IP address. DNS records are basically mapping file that tells DNS server which IP address each domain name is associated with, and how to handle requests sent to each domain. These records are typically the connection of your website with the outside world.
Request for your website are forwarded to your DNS server and then get pointed to web server that serves the website or to the Email server that handles the incoming mail.

1. A Record:
A records are one of the key record types within the DNS. The A record is used to associate the domain name to IP address.

2. AAAA Record:
AAAA records are similar to A records. The only difference is that the AAAA records point to the ipv6 address instead of the ipv4 address.

3. CNAME Record:
CNAME stands for Canonical name. A CNAME record points one of your subdomains to a different domain name. i.e. CNAME record is used to define one domain as an alias of another domain.

4. MX Record:
MX record stands for Mail Exchange Record. These records are used to identify the servers that handle the email address for your domain name.

5. NS Record:
NS or Nameserver record maps the domain name to a list of DNS servers authoritative for that domain. NS records indicate authoritative nameserver for the domain.

6. PTR Record:
PTR record type is used to perform the exact opposite functionality of DNS A record type. PTR record is used to translate an IP address to the domain name.

7. SOA Record:
SOA record stands for Start of Authority record. This record is used to inform resolver that the server which contains this record is the authoritative server for the requested domain name. That means it provides authoritative information about the domain.

Q) Recursive query in DNS?
The recursive query is a kind of query in which DNS server who receives your query will do all the job of fetching the answer and giving back to you.
During this process, the DNS server might also query other DNS servers on the internet for your answer.

Step by step understanding
1. Suppose that you want to browse www.example.com and your resolver.conf has got an entry of ISP DNS server.

2. DNS server on receiving the query will look into its table (cache) to find IP address ie A record for example.com.

3. If DNS server does not have the answer for the query in its cache, then it will send this query to “root” DNS server for the answer.

4. The root DNS server will reply with the list of server’s (referral) that are responsible for handling “.com” TLD server.

5. Our DNS server will select one of the .com TLD servers from the list given by root server to query the answer for example.com.

6. Similar to root servers, the TLD servers are also iterative in nature, so it replies back to our DNS server with the list of IP address of DNS servers responsible for the domain (authoritative nameserver) example.com.

7. This time also our DNS server will select one of the IP from given list of authoritative nameserver and queries A record for example.com.

8. Now our DNS server will reply us back with IP domain pair. Now the browser will send the request to the webserver for the content using IP address that it has learned.

9. Our DNS server now stores this record in its table (cache), so next time when it receives the same query then it will serve it from its cache.

Q) Iterative query in DNS?
In an iterative query, the DNS server will not go and fetch the complete answer for your query but will give back referral to another DNS server which might have the answer.

If the DNS server is not recursive (i.e iterative) in nature then, it will give the answer if it has in its record. Otherwise, will give us the referral to root servers, that means it will not query root server and other DNS servers.
Now its job of our resolver to query root servers, TLD servers, and authoritative name servers.
Reference link: Slashroot

AWS Interview Questions and Answers: Part 1

Q) What is Cloud Computing?
Cloud Computing is the on-demand delivery of computing power, database storage, applications, and other IT service through a cloud services platform with pay-as-you-go pricing. You can provision exactly the right type and size of computing resources you need. You can access as many resources as you need almost instantly.
Cloud Computing is a simple way to access server, storage, databases, and a set of application services.

Q)What is Amazon EC2?

Amazon Elastic Compute Cloud (EC2) provides scalable (resizable) computing capacity in the Amazon Web Services (AWS) cloud. Using Amazon EC2 you can launch as many virtual servers as you need and configure security, networking, and also manage storage.

Q) What is the EC2 Instance?
An EC2 instance is a virtual server in Amazon’s Elastic Compute Cloud (EC2) for running applications on Amazon Web Service (AWS) infrastructure.

Q) Features of EC2?
1. Virtual computing environment known as instances
2. Preconfigured templates for your instances known as Amazon Machine Images (AMI).
3. Various configurations of CPU, Memory, Storage, and networking capacity is known instance types.
4. Secure login information for your instances using the key pair.
5. Storage volumes for temporary data that are deleted when you stop or terminate the instances known as instance store volume.
6. Persistent storage volume for your data using Amazon Elastic Block Store (EBS) known as Amazon EBS volume.
7. Multiple physical locations for your resources such as instances and Amazon EBS volumes known as regions and Availability zones.
8. A Firewall that enables you to specify the protocol, ports, and sources IP ranges that can reach your instances using security groups.
9. Static IP addresses for dynamic cloud computing knows as Elastic IP Addresses.
10. Metadata i.e. tags that you can create and assign to your Amazon EC2 resources.
11. Virtual networks you can create that are logically isolated from the rest of the AWS cloud and that you can optionally connect to your own network know as Virtual Private Cloud (VPC)

Q) What is AMI?
It’s a template that provides information (an operating system, an application server, and applications) required to launch an instance, which is a copy of AMI running as a virtual server in the AWS cloud.
An AMI includes the following:
1. A template for the root volume for instance (an operating system, an application server, and applications)
2. Launch permission that controls which AWS accounts can use the AMI to launch the instances.
3. A block device mapping that specifies the volumes attached to the instance when it is launched.

Q) Types of AMI?
You can select an AMI to use based on the following characters.
1. Regions and availability zones.
2. Operating Systems
3. Architecture (32-bit or 64-bit)
4. Launch permission     
5. Storage for root device

Q) What is an instance type?
When you launch an instance, the instance type that you specify determines the hardware of the host computer used for your instance.
Each instance type offers different compute, memory, and storage capabilities and are grouped into instance families based on these capabilities.

Q) Types of EC2 Instances?

1. General Purpose


2. Compute Optimized


3. Memory Optimized


4. Storage Optimized


5. Accelerated Computing

Q) What is VPC?

Amazon Virtual Private Cloud (VPC) enables you to launch Amazon Web Services (AWS) Resources into the virtual network that you have defined.
A Virtual Private Cloud (VPC) is a virtual network dedicated to your AWS account.
It is logically isolated from other virtual networks in the AWS cloud. You can launch AWS resources such as Amazon EC2 instances into your VPC.
You can configure your VPC; you can select its IP address range, create subnets, and configure route tables, network gateways, and security settings.

Q) Difference between Default and Non-Default VPC in AWS Cloud?
The primary difference between Default and Non-Default VPC is that Default VPC is created by AWS for you when you create a new account, whereas any VPC created by you is called Non-Default VPC.
Default VPC comes with the following pre-configured settings i.e. when AWS creates a default VPC, they do the following settings                  
i. Create a default subnet in each availability zone.
ii. Create an internet gateway and connect it to your default VPC.
iii. Create the main route table and send all the internet traffic from default VPC through an internet gateway.
iv. Create a default security group and associate it with your default VPC.
v. Create a default ACL’s and associate it with your default VPC
vi. Associate default DHCP option set with your default VPC.
Instances that you launch into default subnets will receive both private IP address and public IP address and also receive both private and public DNS hostnames.
Instances that you launch into non-default subnets will not receive a public IP address and DNS hostname.

Q) What is Security group?
A Security group act as a virtual firewall for your instance to control inbound and outbound traffic. When you launch an instance in a VPC, you can assign an instance to up to five security groups.
Security groups act at the instance level, not the subnet level. Therefore each instance in a subnet in your VPC could be assigned to a different set of security groups.
If you don’t specify a particular group at launch time, the instance is automatically assigned to the default security group for the VPC.
For each security group, you add rules that control the inbound traffic to instances and a separate set of rules that control the outbound traffic.

Q) Basic Characteristics of Security group for VPC.
i. You can create up to 500 security groups per VPC. You can add up to 50 inbound and outbound rules to each security group. You can associate up to 5 security groups per network interface.
ii. You can specify allow rules, but not deny rules.
iii. You can specify separate rules for inbound and outbound traffic.
iv. By default, no inbound traffic is allowed until you add inbound rules to the security groups.
v. By default, an outbound rule allows all outbound traffic. You can remove the rule and add outbound rules that allow specific outbound traffic only.
vi. Security groups are stateful means the responses to allowed inbound traffic are allowed to flow outbound regardless of outbound rules and vice versa.
vii. Instances associated with security groups can’t talk to each other unless you add rules allowing it.
Viii. Security groups are associated with network interfaces. After you launch an instance, you can change the security group associated with the instance, which changes the security group’s associated with a primary network interface (eth0).
You can also change the security group associated with any other network interface.

Q) What is Network Access Control List (NACL)?
Network Access Control List (NACL) is an optional layer of security for your VPC that acts as a firewall to control traffic in and out of one or more subnets.
Default VPC comes with modifiable default network ACL, by default it allows all inbound and outbound traffic (IPv4/IPv6).
You can create a custom network ACL and associate it with the subnet. By default, custom ACL denies all the inbound and outbound traffic until you add the rules.
Each subnet in your VPC must be associated with a network ACL. If you don't explicitly associate a subnet with a network ACL, the subnet is automatically associated with the default network ACL.
You can associate a network ACL with multiple subnets; however, a subnet can be associated with only one network ACL at a time. 
Network ACL contains a numbered list of rules which are evaluated in order from lowest to determine whether traffic is allowed in or out of any subnet associated with the network ACL. 
A network ACL has separate inbound and outbound rules, and each rule can either allow or deny traffic.
Network ACLs are stateless; responses to allowed inbound traffic are subject to the rules for outbound traffic (and vice versa).

Reference Link: https://docs.aws.amazon.com/vpc/latest/userguide/vpc-network-acls.html

Q) What is S3?
Amazon S3 is storage for the internet. A Simple Storage Service that offers software developers a high-scalable, reliable and low-latency data storage infrastructure at very low costs. It is designed to make web-scale computing easier for developers.
Amazon S3 provides a web service interface that you can use to store and retrieve any amount of data, at any time, from anywhere on the web.
Using this web service, developers can easily build applications that make use of internet storage.

Q) Amazon EBS Volume?
Amazon Elastic Block Store (Amazon EBS) provides the block-level storage volume for use with Amazon EC2 Instances. EBS volumes are highly available and reliable storage volumes that can be attached to any running instance that is in the same availability zone.
Amazon EBS is recommended when data must be quickly accessible and requires long-term persistence. EBS volumes particularly well suited for use as the primary storage for the file systems, databases, or any applications that require fine granular updates and access to raw, unformatted, and block-level storage.
Amazon EBS is well suited to both database-style applications that rely on random reads and writes and to the throughput-intensive application that performs long, continuous read and writes.
Amazon EBS provides the following volume type:
1. General purpose SSD (gp2,gp3) Volume size: 1GiB to 16TiB
2. Provisioned IOPS SSD (io1,io2,io2 block express) Volume size: 4GiB to 16TiB
3. Throughput Optimized HDD (st1) 125GiB to 16TiB
4. Cold HDD (sc1) Volume size: 125GiB to 16TiB
5. Magnetic (standard) Volume size: 1GiB to 1TiB


Q) Instance store volume?
An Instance store provides temporary block-level storage for your instance. This storage is located on disks that are physically attached to the host computer. Instance store is ideal for the temporary storage of information that changes frequently, such as buffers, cache, scratch data, and other temporary content or for the data that is replicated across a fleet of instances, such as a load-balanced pool of web servers.
The data on an instance store volume persists only during the life of the associated Amazon EC2 instance; if you stop or terminate an instance, any data on instance store volumes is lost.

Q) What is IaaS?
Cloud Infrastructure Service, known as Infrastructure as a Service. IaaS model provides computing infrastructure including servers, storage, networking, and networking services (eg firewall).
IaaS provider offers these cloud servers and their associated resources via dashboard and/or API. IaaS clients have direct access to their servers and storage, just as they would with traditional servers but gain access to a much higher order of scalability. Users of IaaS can outsource and build a “virtual data center” in the cloud and have access to many of the same technologies and resource capabilities of a traditional data center without having to invest in capacity planning or the physical maintenance and management of it.

Examples: Amazon EC2, Windows Azure, Rackspace, Google Compute Engine.

Q) What is PaaS?
Cloud Platform Service or Platform as a Service provides the platform on which software can be developed or deployed. It provides you with computing platforms that typically include an operating system, programming language execution environment, database, web server, etc.

Examples: AWS Elastic Beanstalk, Google App Engine, Apache Stratos.

Q) What is SaaS?
Cloud application services, or Software as a Service (SaaS), is the most popular and known form of cloud service for consumers. SaaS moves the task of managing software and its deployment to third-party services.
In the IaaS model, you are provided with access to application software’s often referred to as on-demand software.
The use of SaaS applications tends to reduce the cost of software ownership by removing the need for technical staff to manage install, manage, and upgrade software, as well as reduce the cost of licensing software.

Examples: Google Apps, Netflix, WebEx, GoToMeeting, and DropBox, Microsoft Office 365.

Q) Regions and Availability zones?
Amazon EC2 is hosted in multiple locations worldwide. These locations are composed of regions and availability zones. Each region is a separate geographic area. Each region has multiple, isolated locations known as Availability zones. Amazon EC2 provides you the ability to place the resources, such as instances and data in multiple locations.
Each region is completely independent. Each availability zone is isolated, but the availability zones in a region are connected through a low-latency link.
Amazon EC2 resources are either global, tied to a region, or tied to an Availability Zone.

Availability zone:
Availability zones are effectively different data centers located within the regions. Each availability zone is completely independent of others which enables them to reside in different areas within the same region providing a level of business continuity in the event of a disaster.
All the Availability zones within the same regions are linked by extremely low latency links providing high availability features for many AWS services such as S3, RDS, etc. to communicate with each other.

Q) What is Edge Location?
A site that CloudFront uses to cache copies of your content for faster delivery to users at any location.
Edge locations are used in conjunction with the AWS CloudFront service which is a global Content Delivery Network service. Edge locations are deployed across the world in multiple locations to reduce the latency for the traffic served over the CDN and as a result, are usually located in highly populated areas.

Q) What is shared instance?
i. Shared instances are Amazon EC2 instances that are running on hardware that is not dedicated to a single AWS account i.e. different instances from different AWS account sharing the same physical host.
ii. In case of stop and start of instances, the underlying hardware (i.e. host) would change

Q) What is dedicated instance?
i. Dedicated instances are Amazon EC2 instances that run in Virtual Private Cloud (VPC) on hardware that is dedicated to a single customer.
ii. Your dedicated instances are physically isolated at the host hardware level from the instances that belong to other AWS account.
iii. Dedicated instances may share hardware with other instances from the same AWS account that is not dedicated instances.
iv. In case of stop and start of instances, the underlying hardware (i.e. host) would change.

Q) What is a Dedicated Host?
i. An Amazon EC2 Dedicated Host is a physical server with EC2 instance capacity fully dedicated to your use. You can use Dedicated Hosts to launch Amazon EC2 instances on physical servers that are dedicated for your use.
ii. Dedicated Hosts give you additional visibility and control over how instances are placed on a physical server.
iii. In case of stop and start of instances, the underlying hardware will not change.

Q) How ENI is attached to an Instance?

Ø  Hot Attach : ENI can be attached to an instance when it’s running.

Ø  Warm Attach:  ENI can be attached to an instance when it’s stopped.

Ø  Cold Attach : ENI can be attached to an instance when it is being launched.



Go for Part 2, 3 and 4 of AWS Interview Question and Answer Series


Part 2 : AWS Interview QnA Part 2

Part 3 : AWS Interview QnA Part 3

Part 4 : AWS Interview QnA Part 4