Skip to content

Instantly share code, notes, and snippets.

@takumiio
Last active June 28, 2016 08:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save takumiio/dc5d89346c10a42d80b692b31cdbe245 to your computer and use it in GitHub Desktop.
Save takumiio/dc5d89346c10a42d80b692b31cdbe245 to your computer and use it in GitHub Desktop.
WordPressをワンライナーでインストールするためのシェル。まだまだ改良できそうなので、そのうちやる。
#!/bin/bash
# Get WordPress
curl -LO https://ja.wordpress.org/wordpress-4.5.2-ja.tar.gz
tar xzf wordpress-4.5.2-ja.tar.gz
mv wordpress html
# Install to need packages
sudo yum install -y httpd mysql-server php php-mysql
# Move public directory in wordpress
sudo rm -rf /var/www/html
sudo mv html /var/www/html
# Change permission for apache reading
sudo chown apache /var/www/html
# Lunch MySQL and Apache
sudo service mysqld start
sudo service httpd start
# Initial Secure MySQL
mysql_secure_installation
# Initial Database
mysql -uroot -p -e 'CREATE DATABASE wordpress DEFAULT CHARACTER SET utf8'
mysql -uroot -p -e "GRANT ALL ON wordpress.* TO 'dev'@'localhost' IDENTIFIED BY 'devdevdev'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment