Saturday 24 February 2018

Amazon Web Service tutorial for beginners

Amazon Web Service tutorial for beginners

Question: What is Amazon EC2?
Full form of Amazon EC2 is Amazon Elastic Compute Cloud.
Amazon EC2 is a web service that provides secure, resizable compute capacity in the cloud.
You can use EC2 to launch as many as virtual servers as you need, and configure security and networking and manage storage.
EC2 enables you to scale up resource as per your requirements.


Question: What are features of Amazon EC2?
  1. Create instances (Virtual computing)
  2. Preconfigured templates for your instances.
  3. Configurations of CPU, memory, storage, and networking capacity for your instances, known as instance types
  4. Secure login information for your instances using key pairs
  5. Firewall Setting that enables you to specify the protocols, ports, and source IP ranges that can reach your instances
  6. Static IPv4 addresses for dynamic cloud computing, known as Elastic IP addresses



Question: What is Full form of Amazon ECS?
Full form of Amazon ECS is Amazon Elastic Container Service.
Amazon ECS is highly scalable, fast, container management service that is easy to manage containers.


Question: What are Feature of ECS?
Amazon ECS is a regional service that running application containers in a highly available manner across multiple Availability Zones within a region.
You can create Amazon ECS clusters within a new or existing VPC.


Question: What is Lambda?
Amazon Lambda is web service that runs code in response to events and automatically manages the compute resources required by that code.


Question: What Is Amazon Batch?
Amazon Batch enables you to run batch computing workloads on the Amazon Cloud.
Batch computing is a common way for engineers to manage large amounts of compute resources.


Question: What are components of Amazon Batch?
  1. Jobs
  2. Job Definitions
  3. Job Queues
  4. Compute Environment



Question: What is Amazon Elastic Beanstalk?
It is Service which can quickly deploy and manage applications in the Amazon Cloud.
Elastic Beanstalk automatically handles the details of capacity, load balancing, scaling, and application health monitoring.
Elastic Beanstalk supports applications developed in Java, PHP, .NET, Node.js, Python, and Ruby etc.


Question: What is Amazon Lightsail?
Lightsail is designed to be the easiest way to launch and manage a virtual private server (VPS).



Question: What is Amazon S3?
Full form of S3 is Amazon Simple Storage Service.
Amazon S3 is a web service which provides storage Service through web services interfaces.



Question: What is Amazon EFS?
Full form of Amazon EFS is Amazon Elastic File System.
EFS provides simple, scalable file storage for use with Amazon EC2 instances.



Question: What is Amazon Glacier?
Amazon Glacier is an online file storage web service that provides storage for data archiving and backup.


Question: What is Amazon Storage Gateway?
Amazon Storage Gateway is a service that connects an on-premises software appliance with cloud-based storage to provide seamless and secure integration in the cloud.



Question: What is Relational Database Service?
Amazon Relational Database Service (Amazon RDS) makes it easy to set up, operate, and scale a relational database in the cloud.



Question: What is AWS DynamoDB?
Amazon DynamoDB is a fully managed NoSQL database service that provides fast and predictable performance with seamless scalability.



Question: What is AWS ElastiCache?
ElastiCache is a web service that makes it easy to set up, manage, and scale a distributed in-memory data store in the cloud.



Question: What is Amazon Redshift?
Redshift is Web service which offers fast query performance using the same SQL-based tools and business intelligence applications.


Question: What is Elastic IP addresses in aws?
An Elastic IP address is a static IPv4 address designed for dynamic cloud computing.
An Elastic IP address is associated with your AWS account.
With an Elastic IP address, you can mask the failure of an instance by rapidly remapping the address to another instance in your account.



Question: What is IPv4?
Internet Protocol Version 4 (IPv4) is the fourth revision of the Internet Protocol and a widely used protocol in data communication over different kinds of networks.



Question: What is difference between IPv4 and IPv6?
Internet Protocol Version 4 (IPv4) is the fourth revision of the Internet Protocol where as IPv6 is the sixth revision to the Internet Protocol and the successor to IPv4



Question: What is EC2 instance in aws?
An EC2 instance is a virtual server in Amazon's Elastic Compute Cloud (EC2) for running applications on the Amazon Web Services (AWS) infrastructure.



Question: What is volume in aws?
An Amazon EBS volume is a durable, block-level storage device that you can attach to a single EC2 instance.
You can use EBS volumes as primary storage for data that requires frequent updates, such as the system drive for an instance or storage for a database application.



Question: What is Amazon EC2 Dedicated Hosts?
An Amazon EC2 Dedicated Host is a physical server with EC2 instance capacity fully dedicated to your use.
Dedicated Hosts can help you address compliance requirements and reduce costs by allowing you to use your existing server-bound software licenses.

Question: What is EBS Snapshots?
We back up the data on Amazon EBS volumes to Amazon S3 by taking point-in-time snapshots.
Snapshots are incremental backups, which means that only the blocks on the device that have changed after your most recent snapshot are saved.



Question: What is Elastic Load Balancing?
Elastic Load Balancing distributes incoming application traffic across multiple EC2 instances, in multiple Availability Zones.
The load balancer serves as a single point of contact for clients(like browser), which increases the availability of your application.
You can add and remove instances from your load balancer as your needs change, without disrupting the overall flow of requests to your application



Question: What Is Amazon VPC?
Amazon Virtual Private Cloud (Amazon VPC) enables you to launch AWS resources into a virtual network.
This virtual network closely resembles a traditional network that you'd operate in your own data center, with the benefits of using the scalable infrastructure of AWS.



Question: What is security groups in aws?
A security group acts as a virtual firewall that controls the traffic for one or more instances. When you launch an instance, you associate one or more security groups with the instance.
You add rules to each security group that allow traffic to or from its associated instances.


Friday 23 February 2018

PHP Redirect, 301 or 302 Redirection With PHP and benefits

301 or 302 Redirection With PHP and benefits

Question: What is Redirection?
On a Web site, redirection is a technique for moving visitors to a different web page OR Different website.


Question: Why we do need redirection?
We do need redirection, because we want to tell the visitor that current page is not appropriate for you or current page have been moved to new location.

Following are different reason, we do Redirection
  1. If user already login, and try to open the login page redirect him to user dashboard.
  2. Trying to access a page which is temporary not available.
  3. If user trying to access un-authorized page, Redirect him to user dashboard.
  4. Tring to access non-exist page, redirect him sitemap page OR 404 page.
  5. Trying to access non-exist website.


Question: What are different type of redirects?
  1. 301 permanent redirects
  2. 302 temporary redirects


Question: What is 301 permanent redirect?
301 code refers to the HTTP status code.
A 301 redirect is a permanent redirect which passes between ranking power(>90%) to the redirected page.


Question: When we use 301 redirects?
  1. When a web page permanently removed, we redirect user to new page.
  2. When we want to transfer the ranking benefits(SEO point of view) to new web page.
  3. Redirect user to new web page and stopped him to access old page(not available page).
  4. If you have updated the contents to new web page, MUST USE 301 Redirects
  5. 301 indicates to both browsers and search engine bots(Google, bing, yahoo) that the page has moved permanently.



Question: What is 302 temporary redirects?
302 refers to the HTTP status code.
A 302 redirect is a temporary redirect. We have to tell user its temporary unavailable and will be available very soon.


Question: When we use 302 redirects?
  1. If user already login, and try to open the login page redirect him to user dashboard.
  2. Trying to access a page which is temporary not available.
  3. If user trying to access un-authorized page, Redirect him to user dashboard.


Question: How to make 301 redirect with php (Permanent)?
header('Location: http://www.example.com/new-web-page.php', true, 301);exit;



Question: How to make 302 redirect with php (Temp)?
header('Location: http://www.example.com/new-web-page.php', true, 302);exit;

OR
header('Location: http://www.example.com/new-web-page.php');exit;

Both are same and works same.


Question: Can we use regular express in Redirection?
Yes, See Example:
if(preg_match("/^\/old\./", $_SERVER['REQUEST_URI'], $m)){
    header('Location: http://www.example.com/new-web-page.php', true, 301);exit;
}
URL start with /old will be redirect to http://www.example.com/new-web-page.php


Question: Give an URL to check 301 redirects?
http://www.aboutcity.net/youtube/videos/watch/wEVPkxFC0NI


Question: Where can I test redirect online? http://www.redirect-checker.org/index.php
(Check Your Redirects and Statuscode 301 vs 302, meta refresh & javascript redirects)


Question: How to make 301 redirect with htaccess?
Add following code in htaccess
Redirect 301 /old/ /new/

Make Sure "RewriteEngine On" and installed "mod_rewrite" on server.


Question: How to make 302 redirect with htaccess?
Add following code in htaccess
Redirect 302 /old/ /new/

Make Sure "RewriteEngine On" and installed "mod_rewrite" on server.

Question: What are different HTTP status code used in web?
301 - Permanent movement(redirection)
302 - Temporary movement(redirection)
400 - Bad request
401 - Authorization Required
For More details http://www.web-technology-experts-notes.in/2014/02/htaccess-code-snippets-example.html