Skip to content

Instantly share code, notes, and snippets.

@ariofrio
Created May 18, 2013 09:16
Show Gist options
  • Save ariofrio/5603825 to your computer and use it in GitHub Desktop.
Save ariofrio/5603825 to your computer and use it in GitHub Desktop.
Script that installs Wordpress on NearlyFreeSpeech.net. Takes care of safe_mode permissions, temporary folder, and automatic installation of plugins, etc.
#!/bin/sh
set -ex
cd /home/public
# Download Wordpress
wget http://wordpress.org/latest.tar.gz
tar -xf latest.tar.gz
rm latest.tar.gz
mv wordpress/* .
rmdir wordpress
# Set up safe_mode permissions
chgrp -R web .
chmod -R g+w .
echo "Visit http://$(hostname)/ to setup the database and site info."
echo "You'll need a MySQL database (https://members.nearlyfreespeech.net/mysql)."
echo
REPLY=
while [ "$REPLY" != "done" ]; do
echo -n "Once you are ready, type done: "
read
done
# Set up temporary folder and enable Automatic Installs
mkdir ../tmp/wordpress; chgrp web ../tmp/wordpress; chmod g+w ../tmp/wordpress
echo "define('WP_TEMP_DIR', ABSPATH.'../tmp/wordpress');" >> wp-config.php
echo "define('FS_METHOD', 'direct');" >> wp-config.php
echo
echo "All files have been left writable by the web process. Please consider reading"
echo "http://codex.wordpress.org/Hardening_WordPress."
echo
@ariofrio
Copy link
Author

Instructions: Create a site, ssh into it and run:

curl https://gist.github.com/ariofrio/5603825/raw/install-wp-nfshost.sh | bash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment