sudo yum update -y
sudo amazon-linux-extras install -y lamp-mariadb10.2-php7.2 php7.2
sudo yum install -y httpd
sudo systemctl start httpd
sudo systemctl enable httpd
wget https://wordpress.org/latest.tar.gz
tar -xzf latest.tar.gz
cp wordpress/wp-config-sample.php wordpress/wp-config.php
nano wordpress/wp-config.php
sudo cp -r wordpress/* /var/www/html/
sudo chown -R apache /var/www
sudo chgrp -R apache /var/www
sudo chmod 2775 /var/www
sudo find /var/www -type d -exec sudo chmod 2775 {} \;
sudo find /var/www -type f -exec sudo chmod 0664 {} \;
sudo systemctl restart httpd
Friday, 27 September 2019
September 27, 2019
Installing Wordpress in Redhat/Centos
Friday, 1 June 2018
June 01, 2018
Best Practices to run Nodejs
The safe user does not have permissions to use default http port 80.
Do not run your applications as a root.
To use http port for non root user,
use the below
Do not run your applications as a root.
To use http port for non root user,
use the below
sudo apt-get install libcap2-bin
sudo setcap cap_net_bind_service=+ep `readlink -f \`which node\``
Now you can able access default http port.
for nodejs
node app.js
production:
pm2 start app.js
forever start app.js
instead of sudo node app.js
sudo pm2 app.js
etc.
Saturday, 21 April 2018
April 21, 2018
sudo -u keycloak ./jboss-cli.sh 'embed-server,/subsystem=undertow/server=default-server/http-listener=default:write-attribute(name=proxy-address-forwarding,value=true)'
Cannot start embedded server: Failed to instantiate class "org.jboss.logmanager.handlers.PeriodicRotatingFileHandler" for handler "FILE": java.lang.reflect.InvocationTargetException: /opt/keycloak-3.4.3.Final/standalone/log/server.log (Permission denied)
solution:
Cannot start embedded server: Failed to instantiate class "org.jboss.logmanager.handlers.PeriodicRotatingFileHandler" for handler "FILE": java.lang.reflect.InvocationTargetException: /opt/keycloak-3.4.3.Final/standalone/log/server.log (Permission denied)
solution:
April 21, 2018
https required keycloak
Keycloak admin login page not showing without https .
Disable https in the dashboard, but without logging in, we cannot disable.
So use the below commands
go to bin folder of keycloak.
./kcadm.sh config credentials --server http://localhost:8080/auth --realm master --user admin
./kcadm.sh update realms/realmname -s sslRequired=NONE
Saturday, 14 April 2018
April 14, 2018
https: Address already in use /0.0.0.0:8443
18:02:14,277 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC000001: Failed to start service org.wildfly.undertow.listener.https: org.jboss.msc.service.StartException in service org.wildfly.undertow.listener.https: Address already in use /0.0.0.0:8443
at org.wildfly.extension.undertow//org.wildfly.extension.undertow.ListenerService.start(ListenerService.java:179)
at org.jboss.msc//org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:2032)
at org.jboss.msc//org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1955)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.base/java.lang.Thread.run(Thread.java:844)
at org.wildfly.extension.undertow//org.wildfly.extension.undertow.ListenerService.start(ListenerService.java:179)
at org.jboss.msc//org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:2032)
at org.jboss.msc//org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1955)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.base/java.lang.Thread.run(Thread.java:844)
April 14, 2018
PPK to Pem Conversion in Mac
Wednesday, 11 April 2018
April 11, 2018
No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 47.995 s
[INFO] Finished at: 2018-04-11T12:51:26+00:00
[INFO] Final Memory: 210M/483M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project keycloak-common: Compilation failure
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :keycloak-common
Solution:
sudo apt-get install openjdk-8-jdk
Sunday, 1 April 2018
April 01, 2018
php 5.5.9 Uncaught exception 'PusherException'
Wednesday, 28 February 2018
February 28, 2018
Install Apache Tomcat latest stable version on Ubuntu
Step1:
Update your apt-get package
Install Java Developer kit
Install Java Developer kit
Install Java Developer kit
Install Tomcat8 admin tools and documents
step5:
Run tomcat as service
Step6:
Update your apt-get package
apt-get update
Step2:Install Java Developer kit
sudo apt-get install default-jdk
Step3:Install Java Developer kit
apt-get install tomcat8
Step3:Install Java Developer kit
apt-get install tomcat8
step4:Install Tomcat8 admin tools and documents
apt-get install tomcat8-docs tomcat8-examples tomcat8-admin
step5:
Run tomcat as service
systemctl start tomcat8
To stop and restart servicesystemctl stop tomcat8
systemctl restart tomcat8
NOTE: For security reasons, using the manager webapp is restricted to users with role "manager-gui". The host-manager webapp is restricted to users with role "admin-gui". Users are defined in /etc/tomcat8/tomcat-users.xml.Step6:
sudo vi/etc/tomcat8/tomcat-users.xml
<role rolename="manager-gui"/> <role rolename="admin-gui"/> <user username="admin" password="admin123" roles="manager-gui,admin-gui"/>
Tuesday, 27 February 2018
February 27, 2018
Installing Apache Webserver on Ubuntu
ubuntu@ip-172-29-21-77:~$ sudo apt-get update
Hit:1 http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu xenial InRelease
Get:2 http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu xenial-updates InRelease [102 kB]
Get:3 http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu xenial-backports InRelease [102 kB]
Get:4 http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu xenial/main Sources [868 kB]
Get:5 http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu xenial/restricted Sources [4808 B]
Get:6 http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu xenial/universe Sources [7728 kB]
Get:7 http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu xenial/multiverse Sources [179 kB]
Get:8 http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages [7532 kB]
Get:9 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
Get:10 http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu xenial/universe Translation-en [4354 kB]
Get:11 http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu xenial/multiverse amd64 Packages [144 kB]
Get:12 http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu xenial/multiverse Translation-en [106 kB]
Get:13 http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu xenial-updates/main Sources [298 kB]
Get:14 http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu xenial-updates/restricted Sources [2524 B]
Get:15 http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu xenial-updates/universe Sources [191 kB]
Get:16 http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu xenial-updates/multiverse Sources [7968 B]
Get:17 http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [736 kB]
Get:18 http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu xenial-updates/main Translation-en [305 kB]
Get:19 http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [592 kB]
Get:20 http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu xenial-updates/universe Translation-en [239 kB]
Get:21 http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu xenial-updates/multiverse amd64 Packages [16.2 kB]
Get:22 http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu xenial-updates/multiverse Translation-en [8052 B]
Get:23 http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu xenial-backports/main Sources [3432 B]
Get:24 http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu xenial-backports/universe Sources [4900 B]
Get:25 http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu xenial-backports/main amd64 Packages [4836 B]
Get:26 http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu xenial-backports/main Translation-en [3220 B]
Get:27 http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu xenial-backports/universe amd64 Packages [6628 B]
Get:28 http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu xenial-backports/universe Translation-en [3768 B]
Get:29 http://security.ubuntu.com/ubuntu xenial-security/main Sources [116 kB]
Get:30 http://security.ubuntu.com/ubuntu xenial-security/restricted Sources [2116 B]
Get:31 http://security.ubuntu.com/ubuntu xenial-security/universe Sources [59.1 kB]
Get:32 http://security.ubuntu.com/ubuntu xenial-security/multiverse Sources [1516 B]
Get:33 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages [459 kB]
Get:34 http://security.ubuntu.com/ubuntu xenial-security/main Translation-en [198 kB]
Get:35 http://security.ubuntu.com/ubuntu xenial-security/universe amd64 Packages [320 kB]
Get:36 http://security.ubuntu.com/ubuntu xenial-security/universe Translation-en [119 kB]
Get:37 http://security.ubuntu.com/ubuntu xenial-security/multiverse amd64 Packages [3208 B]
Get:38 http://security.ubuntu.com/ubuntu xenial-security/multiverse Translation-en [1408 B]
Fetched 24.9 MB in 4s (5053 kB/s)
Reading package lists... Done
ubuntu@ip-172-29-21-77:~$ sudo apt-get install apache2
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
apache2-bin apache2-data apache2-utils libapr1 libaprutil1
libaprutil1-dbd-sqlite3 libaprutil1-ldap liblua5.1-0 ssl-cert
Suggested packages:
www-browser apache2-doc apache2-suexec-pristine | apache2-suexec-custom
openssl-blacklist
The following NEW packages will be installed:
apache2 apache2-bin apache2-data apache2-utils libapr1 libaprutil1
libaprutil1-dbd-sqlite3 libaprutil1-ldap liblua5.1-0 ssl-cert
0 upgraded, 10 newly installed, 0 to remove and 51 not upgraded.
Need to get 1557 kB of archives.
After this operation, 6432 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu xenial/main amd64 libapr1 amd64 1.5.2-3 [86.0 kB]
Get:2 http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu xenial/main amd64 libaprutil1 amd64 1.5.4-1build1 [77.1 kB]
Get:3 http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu xenial/main amd64 libaprutil1-dbd-sqlite3 amd64 1.5.4-1build1 [10.6 kB]
Get:4 http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu xenial/main amd64 libaprutil1-ldap amd64 1.5.4-1build1 [8720 B]
Get:5 http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu xenial/main amd64 liblua5.1-0 amd64 5.1.5-8ubuntu1 [102 kB]
Get:6 http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu xenial-updates/main amd64 apache2-bin amd64 2.4.18-2ubuntu3.5 [925 kB]
Get:7 http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu xenial-updates/main amd64 apache2-utils amd64 2.4.18-2ubuntu3.5 [82.3 kB]
Get:8 http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu xenial-updates/main amd64 apache2-data all 2.4.18-2ubuntu3.5 [162 kB]
Get:9 http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu xenial-updates/main amd64 apache2 amd64 2.4.18-2ubuntu3.5 [86.7 kB]
Get:10 http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu xenial/main amd64 ssl-cert all 1.0.37 [16.9 kB]
Fetched 1557 kB in 0s (18.1 MB/s)
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_CTYPE = "UTF-8",
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_US.UTF-8").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
Preconfiguring packages ...
Selecting previously unselected package libapr1:amd64.
(Reading database ... 51122 files and directories currently installed.)
Preparing to unpack .../libapr1_1.5.2-3_amd64.deb ...
Unpacking libapr1:amd64 (1.5.2-3) ...
Selecting previously unselected package libaprutil1:amd64.
Preparing to unpack .../libaprutil1_1.5.4-1build1_amd64.deb ...
Unpacking libaprutil1:amd64 (1.5.4-1build1) ...
Selecting previously unselected package libaprutil1-dbd-sqlite3:amd64.
Preparing to unpack .../libaprutil1-dbd-sqlite3_1.5.4-1build1_amd64.deb ...
Unpacking libaprutil1-dbd-sqlite3:amd64 (1.5.4-1build1) ...
Selecting previously unselected package libaprutil1-ldap:amd64.
Preparing to unpack .../libaprutil1-ldap_1.5.4-1build1_amd64.deb ...
Unpacking libaprutil1-ldap:amd64 (1.5.4-1build1) ...
Selecting previously unselected package liblua5.1-0:amd64.
Preparing to unpack .../liblua5.1-0_5.1.5-8ubuntu1_amd64.deb ...
Unpacking liblua5.1-0:amd64 (5.1.5-8ubuntu1) ...
Selecting previously unselected package apache2-bin.
Preparing to unpack .../apache2-bin_2.4.18-2ubuntu3.5_amd64.deb ...
Unpacking apache2-bin (2.4.18-2ubuntu3.5) ...
Selecting previously unselected package apache2-utils.
Preparing to unpack .../apache2-utils_2.4.18-2ubuntu3.5_amd64.deb ...
Unpacking apache2-utils (2.4.18-2ubuntu3.5) ...
Selecting previously unselected package apache2-data.
Preparing to unpack .../apache2-data_2.4.18-2ubuntu3.5_all.deb ...
Unpacking apache2-data (2.4.18-2ubuntu3.5) ...
Selecting previously unselected package apache2.
Preparing to unpack .../apache2_2.4.18-2ubuntu3.5_amd64.deb ...
Unpacking apache2 (2.4.18-2ubuntu3.5) ...
Selecting previously unselected package ssl-cert.
Preparing to unpack .../ssl-cert_1.0.37_all.deb ...
Unpacking ssl-cert (1.0.37) ...
Processing triggers for libc-bin (2.23-0ubuntu10) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for systemd (229-4ubuntu21) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for ufw (0.35-0ubuntu2) ...
Setting up libapr1:amd64 (1.5.2-3) ...
Setting up libaprutil1:amd64 (1.5.4-1build1) ...
Setting up libaprutil1-dbd-sqlite3:amd64 (1.5.4-1build1) ...
Setting up libaprutil1-ldap:amd64 (1.5.4-1build1) ...
Setting up liblua5.1-0:amd64 (5.1.5-8ubuntu1) ...
Setting up apache2-bin (2.4.18-2ubuntu3.5) ...
Setting up apache2-utils (2.4.18-2ubuntu3.5) ...
Setting up apache2-data (2.4.18-2ubuntu3.5) ...
Setting up apache2 (2.4.18-2ubuntu3.5) ...
Enabling module mpm_event.
Enabling module authz_core.
Enabling module authz_host.
Enabling module authn_core.
Enabling module auth_basic.
Enabling module access_compat.
Enabling module authn_file.
Enabling module authz_user.
Enabling module alias.
Enabling module dir.
Enabling module autoindex.
Enabling module env.
Enabling module mime.
Enabling module negotiation.
Enabling module setenvif.
Enabling module filter.
Enabling module deflate.
Enabling module status.
Enabling conf charset.
Enabling conf localized-error-pages.
Enabling conf other-vhosts-access-log.
Enabling conf security.
Enabling conf serve-cgi-bin.
Enabling site 000-default.
Setting up ssl-cert (1.0.37) ...
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
Processing triggers for libc-bin (2.23-0ubuntu10) ...
Processing triggers for systemd (229-4ubuntu21) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for ufw (0.35-0ubuntu2) ...
ubuntu@ip-172-29-21-77:~$
Sunday, 12 November 2017
November 12, 2017
Installing Nodejs on CentOS/Redhat Linux
Follow these steps to install nodejs on Centos.
yum install -y gcc-c++ make
sudo yum install -y gcc-c++ make
curl -sL https://rpm.nodesource.com/setup_6.x | sudo -E bash -
yum install -y gcc-c++ make
sudo yum install -y gcc-c++ make
yum install nodejs
sudo yum install nodejs
node -v
v6.12.0
[centos@ip-174-35-28-152 ~]$ npm -v
3.10.10
yum install -y gcc-c++ make
sudo yum install -y gcc-c++ make
curl -sL https://rpm.nodesource.com/setup_6.x | sudo -E bash -
yum install -y gcc-c++ make
sudo yum install -y gcc-c++ make
yum install nodejs
sudo yum install nodejs
node -v
v6.12.0
[centos@ip-174-35-28-152 ~]$ npm -v
3.10.10
Thursday, 28 September 2017
September 28, 2017
Amazon Virtual Private Network (VPC) in short
Amazon Virtual Network Cloud (VPC) enables enables you to build a secure virtual network in the amazon cloud.
For creating VPC, no hardware or physical data centres required. You can define your own network space and control how your network and EC2 resources inside your network are exposed to the internet.
What sort of security options do i have over my virtual private network ?
You can leverage the security options in AWS VPC to provide more granular access both to and from the EC2 instances in your virtual network.
You can create a public facing subnet for your web servers that have access to internet , private facing subnet with no internet access for backend systems such as databases, app servers etc.
What if i don’t want to connect my secure network to the public facing internet to restrict within corporate network ?
You can create a hardware virtual private network connection between your corporate data centre and your Amazon VPC.
It can be used to enable the inbound and outbound filtering at the instance level and subnet level.
For storing data , you can use S3 and restrict access ,so that it is only accessible from instances in your VPC.
Saturday, 26 August 2017
August 26, 2017
Error executing 'up': Cloudformation failure waiting for 'CREATE_COMPLETE'. State is 'ROLLBACK_COMPLETE'
ecs-cli up --keypair mycredentials --capability-iam --size 5 --azs us-east-1a,us-east-1b --instance-type m4.large
got this issue.
Failure event reason="Parameter validation failed: parameter value mycredentials for parameter name KeyName does not exist. Rollback requested by user." resourceType="AWS::CloudFormation::Stack"
ERRO[0045] Error executing 'up': Cloudformation failure waiting for 'CREATE_COMPLETE'. State is 'ROLLBACK_COMPLETE'
Wednesday, 23 August 2017
August 23, 2017
S3 bucket - repository/tag: invalid reference format.
I am unable to backup docker volume to S3. Trying to run the docker command.
docker run -d --name 945e1345eed616bbd2a5dd920df2d -e BACKUP_INTERVAL=1m \ S3_BUCKET=33222a9e09 -e AWS_ACCESS_KEY_ID=DFHFHGJHS2KIADCGGD7IBVZQ -e AWS_SECRET_ACCESS_KEY=mbfdbd6kvUgpPlH/7H5/jfJRJnaX1RTJBDF
docker: Error parsing reference: " S3_BUCKET=33222a9e09" is not a valid repository/tag: invalid reference format.
docker: Error parsing reference: "S3_BUCKET=hfghdgfhjdf" is not a valid repository/tag: invalid reference format.
How to configure s3 bucket to the docker volume backup
docker run -d --name 945e1345eed616bbd2a5dd920df2d -e BACKUP_INTERVAL=1m \ S3_BUCKET=33222a9e09 -e AWS_ACCESS_KEY_ID=DFHFHGJHS2KIADCGGD7IBVZQ -e AWS_SECRET_ACCESS_KEY=mbfdbd6kvUgpPlH/7H5/jfJRJnaX1RTJBDF
docker: Error parsing reference: " S3_BUCKET=33222a9e09" is not a valid repository/tag: invalid reference format.
docker: Error parsing reference: "S3_BUCKET=hfghdgfhjdf" is not a valid repository/tag: invalid reference format.
How to configure s3 bucket to the docker volume backup
Monday, 21 August 2017
August 21, 2017
Cloud Watch Alarms- policy issue
Sunday, 20 August 2017
August 20, 2017
AWS S3 Tutorial
Amazon Simple Storage Service is also known as Amazon S3. It is highly scalable object storage in the cloud securely.
It is used to store any amount of data.
MultiPart form uploading to AWS
S3 is Object Storage with a simple web service interface to store and retrive any amount of data from anywhere on the web.
What is multi part upload ?
1. Initiate the Multi part Upload
2. Seperate the object into multiple parts.
3. Upload the parts in any order, one at a time or in the parallel.
Date transmission - Browser going to App server and going to S3.
https://s3.amazonaws.com/upload-demo-images/5e64truyt47653745tr46tr736t4rt4r3t46
Nodejs code :
Install the dependencies.
npm install s3-stream-upload
var UploadStream = require("s3-stream-upload");
var S3 = require("aws-sdk").S3;
var key = "file.mp3";
var s3 = new S3();
fs.readFileStream(__dirname + "/file.mp3")
.pipe(UploadStream(s3, { Bucket: "my-S3-bucket", Key: key }))
.on("error", function (err) {
console.error(err);
})
.on("finish", function () {
console.log("File uploaded!");
});
my sample s3 url - 'https://s3.amazonaws.com/upload-demo-images/';
It is used to store any amount of data.
MultiPart form uploading to AWS
S3 is Object Storage with a simple web service interface to store and retrive any amount of data from anywhere on the web.
What is multi part upload ?
1. Initiate the Multi part Upload
2. Seperate the object into multiple parts.
3. Upload the parts in any order, one at a time or in the parallel.
Date transmission - Browser going to App server and going to S3.
https://s3.amazonaws.com/upload-demo-images/5e64truyt47653745tr46tr736t4rt4r3t46
Nodejs code :
Install the dependencies.
npm install s3-stream-upload
var UploadStream = require("s3-stream-upload");
var S3 = require("aws-sdk").S3;
var key = "file.mp3";
var s3 = new S3();
fs.readFileStream(__dirname + "/file.mp3")
.pipe(UploadStream(s3, { Bucket: "my-S3-bucket", Key: key }))
.on("error", function (err) {
console.error(err);
})
.on("finish", function () {
console.log("File uploaded!");
});
my sample s3 url - 'https://s3.amazonaws.com/upload-demo-images/';
Saturday, 19 August 2017
August 19, 2017
Aws Security Groups
The very first thing to ensure that the unwanted or unauthorized traffic doesn't get in into the instances using Security Group.
What is a Security Group?
It is a AWS firewall solution which filters the incoming and outgoing traffic from an instance.
Filtering is done based upon the ip protocols,ports and source/destination ip addresses.
At the backend requires X.509 certificate and key to authorise changes.
How to configure security groups while creating instance.
You can configure security groups while creating instance or anytime after creating instance.
What is a Security Group?
It is a AWS firewall solution which filters the incoming and outgoing traffic from an instance.
Filtering is done based upon the ip protocols,ports and source/destination ip addresses.
At the backend requires X.509 certificate and key to authorise changes.
How to configure security groups while creating instance.
You can configure security groups while creating instance or anytime after creating instance.
Figure 1.0
Figure 1.1
Here you can configure security group.
Start configure security rules. Security rules for set of firewall rules that control the traffic. what kind of traffic can reach the instance.
The rules we are going to configure are Inbound rules.
SSH/RDP:
If we use linux based machine, configure SSH. SSH stands for secure shell. Secure access to the remote machine.It always communicates over port 22.It is static and you cannot change the port.
If it is Windows based machine, configure RDP. By default it will give root access to the machine.
If we select source anywhere, across internet can access the machine via SSH. This is quite dangerous.
You can choose custom ip for security purpose.
Web Traffic:
Web traffic can come from any source.
0.0.0.0/0 -> allows all the traffic.which is not secure.
HTTP communicates over port 80.
HTTPS always communicates over port 443.
Depends on what traffic you want to allow in, you can add rule here.
Figure 1.2
Figure 1.3
Thursday, 17 August 2017
August 17, 2017
aws instance types
General Purpose (T2, M3, M4 class):
These provides overall balance of Ram, CPU and provide burstable performance.
IOP starts from 100 and upto 3000.
Compute Optimized (C3 and C4 class):
It is meant for hude traffic.
Storage Optimized(I3 and D2 class):
It is for large datawarehouse.
Memory Optimized(X1, R3 and R4 class):
It is for Memcached and enterprise apps.
Accelerated Computing(P2, G3 and F1 class):
It is for general-purpose GPU compute applications,graphics-intensive applications and FPGAs.
These provides overall balance of Ram, CPU and provide burstable performance.
IOP starts from 100 and upto 3000.
Compute Optimized (C3 and C4 class):
It is meant for hude traffic.
Storage Optimized(I3 and D2 class):
It is for large datawarehouse.
Memory Optimized(X1, R3 and R4 class):
It is for Memcached and enterprise apps.
Accelerated Computing(P2, G3 and F1 class):
It is for general-purpose GPU compute applications,graphics-intensive applications and FPGAs.
Wednesday, 16 August 2017
August 16, 2017
Unabme to run docker without sudo
I am unable to run docker without sudo.
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.25/containers/json: dial unix /var/run/docker.sock: connect: permission denied
I added docker to user group
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.25/containers/json: dial unix /var/run/docker.sock: connect: permission denied
I added docker to user group
sudo usermod -aG docker $USER
Still i am unable to run without sudo.
Sunday, 13 August 2017
August 13, 2017
docker Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
Warning: failed to get default registry endpoint from daemon (Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?). Using system default: https://index.docker.io/v1/
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
Labels
- Access Denied IAM (1)
- amazon ecs (1)
- amazon ecs clustor (1)
- amazon elastic beanstack (1)
- amazon elatsiccache (1)
- amazon vpc (1)
- amazon web services (1)
- amazon web services benefits (1)
- amazon web services cli (1)
- apache redirection (1)
- apache tomcat ubuntu 16.04 (1)
- application load balancing (1)
- apt get install docker (1)
- aws (1)
- aws diagram drag and drop (1)
- aws diagrams (1)
- aws diagrams creation (1)
- aws domains (1)
- aws dynamodb (1)
- Aws ebs (1)
- aws ec2 docker insufficient memory (1)
- aws eip (1)
- aws elastic beanstalk (1)
- aws elastic cache (1)
- aws elastic ip (1)
- aws lambda (1)
- aws lambda function (1)
- aws lambda pricing (1)
- aws no sql (1)
- aws online training (1)
- aws php (1)
- aws route53 (1)
- aws route53 domain issue (1)
- aws route53 Latency Based Routing queries pricing (1)
- AWS route53 strategy (1)
- aws route53 Traffic Flow pricing (1)
- aws route53 Tried to create resource record set type (1)
- aws s3 (1)
- aws s3 multi part data upload (1)
- aws s3 pricing (1)
- aws security group ip range (1)
- aws security group limits (1)
- aws security group rules (1)
- AWS SES (1)
- block vs object storage (1)
- but DryRun flag is set (1)
- centos (2)
- centos nodejs (1)
- centos npm (1)
- ChangeResourceRecordSet - Update issue (1)
- ChangeResourceRecordSets aws (1)
- ChangeResourceRecordSets nodejs (1)
- classic load balancing (1)
- cloud computing training (1)
- comodo ssl (1)
- ConfigError in aws (1)
- Connection timed out after (1)
- Could not load credentials from any providers (1)
- create database in mongodb (1)
- create database mongodb (1)
- create iam policy for route53 (1)
- creating docker image (1)
- creating subdomain api (1)
- cvc-enumeration-valid: Value 'UPDATE' is not facet-valid with respect to enumeration (1)
- Device: /dev/sda1 (1)
- digitalocean (1)
- docker hub (1)
- docker info (1)
- docker install (1)
- docker install ubuntu (1)
- docker machine (1)
- docker machine amazon linux (1)
- docker machine redhat (1)
- docker machine ubuntu (1)
- docker ubuntu (1)
- docker ubuntu 14.04 (1)
- docker version (1)
- docker-engine : Depends: libsystemd-journal0 (1)
- docker-engine issue (1)
- dynamodb (1)
- dynamodb api (1)
- dynamodb local (1)
- dynamodb pricing (1)
- ec2 image will be stored in aws s3. cheapest storage in aws (1)
- ec2 instance types (1)
- ec2 with elastic ip (1)
- eip (1)
- elastic block storage (1)
- elastic ip (1)
- elastic ip charges (1)
- Error starting instances (1)
- getting aws issues (1)
- homebrew mac osx (1)
- how to create aws diagrams (1)
- how to create dynamic subdomain (1)
- how to get docker status (1)
- how to install nodejs on ubuntu 16.04 (1)
- how to install comodo ssl (1)
- how to install mongodb on ubuntu (1)
- how to install nodejs in redhat (1)
- how to register domain aws (1)
- how to setup aws vpc (1)
- how to start docker (1)
- how to use aws vpc (1)
- how to use comodo ssl (1)
- how to use route53 (1)
- how to use vc (1)
- http to https redirection ec2 instance (1)
- iis https redirection (1)
- insalling comodo ssl (1)
- install amazon web services cli (1)
- install aws cli (1)
- install cli (1)
- install docker (2)
- install docker in aws (1)
- install docker ubuntu (2)
- install docker ubuntu 14.04 (1)
- install homebrew mac osx (1)
- install mongodb linux (1)
- install mongodb mac (1)
- install mongodb ubuntu (1)
- install mongodb ubuntu 16.04 (1)
- install mongodb windows (1)
- install nodejs (1)
- install nodejs in redhat (1)
- Invalid login: 535 Authentication Credentials Invalid (1)
- Invalid value 'i-08cbb15' for instanceId (1)
- InvalidInstanceID (1)
- lambda (1)
- lambda aws (1)
- lambda function aws (1)
- lambda lambda lambda (1)
- missing credentials in config (1)
- mongodb features (1)
- mongodb install ubuntu (1)
- mongodb scalability (1)
- mongodb server (1)
- mongodb ubuntu 16.04 (1)
- mongoose create database (1)
- mongoose mongoldb (1)
- mongoose nodes (1)
- nginx https redirection (1)
- No package httpd24 available (1)
- No package mysql55-server available (1)
- No package php56 available (1)
- No package php56-mysqlnd available (1)
- node js mongoose (1)
- node mongoose (1)
- node redhat (1)
- nodejs centos (1)
- nodejs docker image (1)
- not authorized to perform: route53:ChangeResourceRecordSets on resource: (1)
- object storage vs block storage (1)
- object store (1)
- online training amazon web services (1)
- online training ec2 (1)
- Orchestration in aws (1)
- Orchestration worrkflow (1)
- Permission denied (publickey) when SSH Access (1)
- php (1)
- pointing domain using route53 (1)
- redhat (1)
- redhat nodejs (1)
- registering subdomain (1)
- Request would have succeeded (1)
- route53 access denied (1)
- run mongodb mac (1)
- run mongodb ubuntu (1)
- run mongodb windows (1)
- run nodejs without sudo (1)
- security group best practices (1)
- security group inbound outbound (1)
- sharding features in mongod (1)
- start docker at reboot (1)
- storage area network (1)
- The pending instance AWS (1)
- tomcat admin (1)
- tomcat admin permissions (1)
- tomcat ubuntu (1)
- tomcat users (1)
- Traditional Architecture vs microservices (1)
- ubuntu 16.04 tomcat (1)
- ubuntu docker install (1)
- UnknownEndpoint: Inaccessible host aws (1)
- use of microservices (1)
- virtual private network (1)
- webservices subdomain (1)
- What are microservices (1)
- what are the domains in cloud (1)
- what is amazon vpc (2)
- what is aws diagram (1)
- what is aws ebs (1)
- what is aws ecs (1)
- what is aws route53 (1)
- what is aws s3 storage (1)
- what is block storage (1)
- what is elastic ip (1)
- what is object storage (1)
- what is Orchestration (1)
- what is sharding in mongodb (1)
- what is vpc (2)
- when to use aws ecs (1)
- when to use aws s3 (1)
- where to use ssl (1)
- why amazon elastic cache (1)
- why aws (1)
- why aws ecs (1)
- why elastic ip (1)
- why Orchestration (1)
- why route53 (1)
- why sharding (1)
- why vpc (2)
- why we need microservices (1)
- Why would i need Microservices (1)
- wordpress (1)
- ws security group ipv6 (1)
- yum (1)
- yum install httpd24 php56 mysql55-server php56-mysqlnd (1)





