Last active
August 29, 2015 14:06
-
-
Save kazuph/38dc05c89116cf4a7546 to your computer and use it in GitHub Desktop.
Wordpressの初回設定をサクッと済ませるスクリプト ref: http://qiita.com/kazuph/items/c95f6e90238fceed2674
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pwd | |
/var/www/html | |
# ls | |
wordpress |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# sh setup-wp.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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