LoginSignup
6
6

More than 3 years have passed since last update.

AWS Linux 環境構築(Amazon Linux / Redhat7)

Last updated at Posted at 2015-09-14

AWSでよくやる初期構築まとめ。

設定周り

SWAP作成

エフェメラルを全部SWAP化

/etc/rc.d/rc.local に以下を記載※rc.local に実行権限を与えておくこと
mkswap /dev/xvdb
swapon -a

SELinuxの停止

# setenforce 0
で一時的に停止
# vi /etc/selinux/config で
SELINUX=enforcing
     ↓
SELINUX=disable
にしてサーバ再起動

周りのサーバに接続

Fromのサーバでssh鍵作成

ssh-keygen -t rsa -b 4096
(鍵の保存場所とパスフレーズは堅めなPassを入力してEnter)

Toのサーバに入って生成した鍵(id_rsa.pub)をauthorized_keysに追記

$HOME/.ssh/authorized_keys あたりのやつ

作業ユーザ作成

グループの作成

groupadd -g 1001 hoge

ユーザの作成

useradd -u 1001 -g 1001 -m -d /home/hoge -s /bin/bash hoge

Wheelについか

usermod -G wheel hoge

インストール周り

jqインストール

curl -o /usr/bin/jq http://stedolan.github.io/jq/download/linux64/jq
chmod +x /usr/bin/jq

psql インストール

yum install postgresql

RedhatにAWS CLIインストール

easy_install pip
pip install awscli
■タブ補完有効化
echo 'complete -C /usr/bin/aws_completer aws' > /etc/profile.d/aws-cli.sh

Redhat のロケール変更

ロケールの設定確認

localectl status

ロケールの設定変更

localectl set-locale LANG=ja_JP.utf8

Redhat のTimezone変更

タイムゾーン設定確認

timedatectl status

タイムゾーンを日本に変更

timedatectl set-timezone Asia/Tokyo

6
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
6