Skip to content

Instantly share code, notes, and snippets.

@miya0001
Last active November 27, 2015 16:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miya0001/6b5a41ee555ea81d56e6 to your computer and use it in GitHub Desktop.
Save miya0001/6b5a41ee555ea81d56e6 to your computer and use it in GitHub Desktop.
AMIMOTO Automated Setup
#!/usr/bin/env bash
set -ex;
# WordPressをec2-user権限で動かすように設定を変更
curl -L https://raw.githubusercontent.com/amimoto-ami/run-httpd-as-ec2-user/master/run-httpd-as-ec2-user.sh | sudo bash
# WordPressのセットアップ
wp --path=/var/www/vhosts/$(curl -L http://169.254.169.254/latest/meta-data/instance-id) \
core install \
--url=http://$(curl -L http://169.254.169.254/latest/meta-data/public-ipv4) \
--title="Welcome to the WordPress powered by AMIMOTO" \
--admin_user="admin" \
--admin_password="$(curl -L http://169.254.169.254/latest/meta-data/instance-id)" \
--admin_email="admin@example.com"
# WordPressプラグインのインストール
wp --path=/var/www/vhosts/$(curl -L http://169.254.169.254/latest/meta-data/instance-id) \
plugin install contact-form-7 --activate
# WordPressテーマのセットアップ
wp --path=/var/www/vhosts/$(curl -L http://169.254.169.254/latest/meta-data/instance-id) \
theme install twentyfifteen --activate
# パーマリンク設定の変更
wp --path=/var/www/vhosts/$(curl -L http://169.254.169.254/latest/meta-data/instance-id) \
rewrite structure "/archives/%post_id%"
# オプションを変更
wp --path=/var/www/vhosts/$(curl -L http://169.254.169.254/latest/meta-data/instance-id) \
option update blogdescription "Powered by AMIMOTO!"
# 最後にインスタンスIDを入力するUIを削除
sudo rm -f /opt/local/amimoto/wp-admin/install.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment