Skip to content

Instantly share code, notes, and snippets.

@kazuph kazuph/file0.txt
Last active Aug 29, 2015

Embed
What would you like to do?
Wordpressの初回設定をサクッと済ませるスクリプト ref: http://qiita.com/kazuph/items/c95f6e90238fceed2674
# pwd
/var/www/html
# ls
wordpress
# sh setup-wp.sh
yum update -y
yum groupinstall -y "Development Tools"
yum -y install gcc make gcc-c++ kernel-devel-`uname -r` zlib-devel openssl-devel readline-devel sqlite-devel perl wget
yum -y install curl bind-utils file git mailx man ntp openssh-clients patch rsync screen sysstat dstat htop iotop traceroute vim-enhanced
yum -y install httpd mysql-server php php-mysql php-mbstring
cd /var/www/html
curl -LO http://ja.wordpress.org/latest-ja.tar.gz
tar xvzf latest-ja.tar.gz
#!/bin/bash -eu
## 以下の設定情報を編集して使ってください。
DATABASE_NAME_HERE=oreore-wp-lp
USERNAME_HERE=oreore-lp-user
PASSWORD_HERE=oreore-super-password
## ここより下は編集しなくていいです(バグってなければ)
cd wordpress
cp wp-config-sample.php wp-config.php
echo 変更前
cat wp-config.php | grep -E "DB_NAME|DB_USER|DB_PASSWORD"
perl -p -i.org -e "s/database_name_here/${DATABASE_NAME_HERE}/" wp-config.php
perl -p -i.org -e "s/username_here/${USERNAME_HERE}/" wp-config.php
perl -p -i.org -e "s/password_here/${PASSWORD_HERE}/" wp-config.php
echo
echo 変更後
cat wp-config.php | grep -E "DB_NAME|DB_USER|DB_PASSWORD"
chown -R apache:apache ../wordpress
ls -l ../
mysql -uroot -e "create database ${DATABASE_NAME_HERE};"
mysql -uroot -e "grant all privileges on ${DATABASE_NAME_HERE}.* to ${USERNAME_HERE}@localhost identified by "\""${PASSWORD_HERE}"\"";"
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.