Saturday, January 31, 2015

how to mount s3 for website write

find uid and gid
id -i www-data
id -g www-data

chmod -R 1777 /file_name

sudo s3fs ot-cdn /var/www/ot/cdn -o uid=1000,gid=33,use_rrs=1,allow_other,default_acl=public-read,umask=002,use_cache=/home/ubuntu/cdn


how to unmount s3fs mount point

sudo fusermount -u /var/

setup s3fs fuse on amazon ec2 machine

apt-get install build-essential git libfuse-dev libcurl4-openssl-dev libxml2-dev mime-support automake libtool
apt-get install pkg-config libssl-dev # See (*3)
apt-get lib-xml2 lib-xmlv2
git clone https://github.com/s3fs-fuse/s3fs-fuse
cd s3fs-fuse/
./autogen.sh
./configure --prefix=/usr --with-openssl # See (*1)
make
sudo make install
create ~/.passwd_s3fs
chmod 600 ~/.passwd_s3fs
keys in <k1>:</k2> format
s3fs <b> /mnt

Friday, January 30, 2015

Wednesday, January 28, 2015

display last 5 modified files

ls -lt | head -n 5

how to install amazon CLI

sudo apt-add-repository ppa:awstools-dev/awstools
sudo apt-get update
sudo apt-get install ec2-api-tools

$ curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"
$ unzip awscli-bundle.zip
$ sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws
$aws configure

Monday, January 26, 2015

How to use PhpMyadmin for RDS management

use below code in /etc/phpmyadmin/config.inc.php

$cfg['Servers'][$i]['host'] = 'path';
$cfg['Servers'][$i]['port'] = '3306';
$cfg['Servers'][$i]['socket'] = '';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['compress'] = TRUE;
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';

creating database on AWS RDS platform

Below is how to create database directly using mysql command line......

1. CREATE DATABASE testdb2 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci