Instance ID: i-9ba4e4a3
ec2-54-222-135-157.cn-north-1.compute.amazonaws.com.cn
54.222.135.157
ssh -i "~/.ssh/fuel-staging.pem" [email protected]
sudo adduser deployer
cat ~/.ssh/id_rsa.pub
And then copy the key you see
sudo su - deployer
mkdir .ssh
Change the file permissions of the .ssh directory to 700 (this means only the file owner can read, write, or open the directory).
chmod 700 .ssh
touch .ssh/authorized_keys
Change the file permissions of the authorized_keys file to 600 (this means only the file owner can read or write to the file).
Important
This step is very important; without these exact file permissions, you will not be able to log into this account using SSH.
chmod 600 .ssh/authorized_keys
Edit the authorized_keys file with your favorite text editor and paste the public key for your key pair into the file, for example:
nano ~/.ssh/authorized_keys
ssh-keygen -t rsa -C "nykfuel-staging-server"
yum groupinstall "Development Tools"
yum install git pcre pcre-devel
yum install postgresql94-devel
yum install -y openssl-devel readline-devel zlib-devel
sudo yum update
sudo yum install zsh
exit
wget --no-check-certificate http://install.ohmyz.sh -O - | sh
chsh -s /bin/zsh
exit
git clone git://github.com/sstephenson/rbenv.git /home/deployer/.rbenv
nano /etc/profile.d/rbenv.sh
export RBENV_ROOT=/home/deployer/.rbenv
export PATH="${RBENV_ROOT}/bin:$PATH"
eval "$(rbenv init -)"
. /etc/profile
git clone https://github.com/sstephenson/ruby-build.git /home/deployer/.rbenv/plugins/ruby-build
rbenv install 2.2.3
rbenv global 2.2.3
rbenv rehash
gem sources --add https://ruby.taobao.org/ --remove https://rubygems.org/
gem sources -l
*** CURRENT SOURCES ***
https://ruby.taobao.org
####Install bundler
gem update --system
gem install bundler
And...
bundle config mirror.https://rubygems.org https://ruby.taobao.org
- If CentOS
yum install -y epel-release
yum install nodejs npm --enablerepo=epel
- If Linux
yum install nodejs npm
yum install nginx
sudo service nginx start
/etc/sysconfig/nginx
/etc/init.d/nginx
sudo nano /etc/init.d/nykfuel-staging
sudo chown deployer:deployer /etc/init.d/nykfuel-staging
sudo chmod 755 /etc/init.d/nykfuel-staging
sudo mkdir /var/www
sudo chown -R ec2-user:ec2-user /var/www/
PATH=$PATH:$HOME/bin:/usr/pgsql-9.4/bin
which pg_config
/usr/pgsql-9.4/bin/pg_config
bundle config build.pg --with-pg-config=/usr/pgsql-9.4/bin/pg_config
yum install libicu-devel