Skip to content

Instantly share code, notes, and snippets.

@nishinoshake
Last active January 8, 2017 07:36
Show Gist options
  • Save nishinoshake/d85dcd95d8a27d3efc7d7013214f6301 to your computer and use it in GitHub Desktop.
Save nishinoshake/d85dcd95d8a27d3efc7d7013214f6301 to your computer and use it in GitHub Desktop.
AWSにCentOS7のインスタンスを生成した後にやること

Elastic IPの割り当て

CentOSに限った話じゃないけど。
Elastic IPから新しく割り当てを選択。
生成したインスタンスを選択すると割り当て完了。

sshコンフィグの設定

vi ~/.ssh/config

Host hoge
  HostName hostname
  User user
  Port 22
  IdentifyFile path/to/pem

ssh接続

ssh hoge

ユーザ作成

adduser -g wheel hogehoge
passwd hogehoge

とりあえずyumを最新に

sudo yum update

ApacheとGitをいれる

sudo yum install httpd
sudo yum install git

PHP5.6をいれる

# 公式は5.4なので
sudo rpm -Uvh http://ftp.iij.ad.jp/pub/linux/fedora/epel/7/x86_64/e/epel-release-7-5.noarch.rpm  
sudo rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
sudo yum install --enablerepo=remi,remi-php56 php php-devel php-mbstring php-pdo php-gd php-mysql

Apacheの起動と自動起動

sudo yum systemctl start httpd
sudo yum enable httpd
sudo yum is-enabled httpd

ロケールとキーマップの設定

localectl status
localectl list-locales | grep ja
sudo localectl set-locale LANG=ja_JP.utf8
localectl list-keymaps | grep jp
sudo localectl set-keymap jp106

タイムゾーンをTOKYOに設定

timedatectl status
timedatectl list-timezones | grep Tokyo
sudo timedatectl set-timezone Asia/Tokyo

SELINUXの無効化

getenforce
sudo vi /etc/selinux/config

# 編集する
SELINUX=disabled

サーバを再起動

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment