Skip to content

Instantly share code, notes, and snippets.

@miya0001 miya0001/wp-setup.sh
Last active Nov 27, 2015

Embed
What would you like to do?
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
You can’t perform that action at this time.