Skip to main content


Showing posts from July, 2018

How to upload EC2 Instance files or Folder (Project Images) to S3 Bucket

First, think to keep in mind this method only work when you have installed a custom ec2 instance of aws with Amazon Linux ami. 1) First Create an IAM User. (Give him Ec2FullAcess or S3FullAccess ) 2) Open your server through ssh or any other tool. Try to run the following command 1) aws configure It will ask 4 thinks like showing this images 1) AWS Access Key Id : (It is given at the time of creating IAM User) 2) AWS Secret Access Key (It will also be given at the time of creating IAM User) 3) Default Region Name (It would depend on the region you are but by default give it as "us-east-2") 4) Default output format: table   [You can also give it as JSON that totally depends on you] after completing all these steps you have to check your list AWS bucket present in your AWS  s3 account. Run the following command : aws s3 ls like as shown in below image. If you want to create some bucket from AWS CLI command then we have to run the following command

How to create subdomain in tomcat server at EC2 Instance

If you want to create a subdomain for your website that is hosted on aws ec2 instance under tomcat 8 server.  Step 1) First you have to create a "create record set" as i mentioned in below image suppoe i want to create a sub-domain under my website like this then you can enter your subdomain name in field of name.  and then you have to select Type of record that is A -IPv4 Address.  How to create subdomain in aws route 53. then you have to enter your ec2 instance public /elastic ip address in value field.  after enter click on save record set.  Now logged into to your server by ssh like putty. access your server and go to tomcat8 installation directory  in this you have to go conf/server.xml file and you have to edit this file by opening follwoing command.  sudo vi server.xml file  and you have to add these 2 lines under   <Engine name="Catalina" defaultHost="localhost"> <

How to Create Our Custom Logs for Tomcat Server On EC2 Instance.

If you want to create our own custom logs then you have to create a property file under your java web project 1) In Property, the file will look like this one. #Direct log message to stdout log4j.rootLogger=INFO, ROOT log4j.appender.ROOT=org.apache.log4j.RollingFileAppender # at aws create a directory under /usr/ like "sudo mkdir othogologs" then create a file inside it like dump.log and assign access to this file chmod 777 dump.log log4j.appender.ROOT.File=/usr/othogologs/dump.log #log4j.appender.ROOT.File=F:/logs/othogodump.log log4j.appender.ROOT.MaxFileSize=10240KB log4j.appender.ROOT.MaxBackupIndex=10 log4j.appender.ROOT.layout=org.apache.log4j.PatternLayout log4j.appender.ROOT.layout.ConversionPattern=[%d] %t %c %-5p - %m%n First you have to create our own directory inside the home director  (Means under directly under / ) so here is usr directory you can create your directory inside the usr directory. After creat