Boilerplate code used to kick-start WordPress projects.
This repo will eventually contain an updated version of my Bueller repo/workflow.
Using cURL
and tar
on a unix system:
# Create your WordPress site folder:
$ mkdir my-wordpress-site && cd my-wordpress-site
# Grab the relevant folders/files from this repo:
$ curl -#L https://github.com/mhulse/wp-stub/tarball/master | tar -xzv --strip-components 1 --exclude=*/{.git*,.editor*,README.*,LICENSE}
# Grab and setup the latest WordPress:
$ wget http://wordpress.org/latest.tar.gz && tar xfz latest.tar.gz && rm -f latest.tar.gz && mv wordpress wp
# Setup fresh database:
$ mysql -u username -p
At the mysql
prompt (replace {...}
with valid strings):
mysql> CREATE DATABASE {DBNAME};
mysql> GRANT USAGE ON *.* TO {USER}@localhost IDENTIFIED BY '{PASSWORD}';
mysql> GRANT SELECT, INSERT, UPDATE, DELETE, ALTER, CREATE, DROP, INDEX, EXECUTE ON {DBNAME}.* TO {USER}@localhost;
mysql> exit
In case you want separate user for each database you need to create a new user to access that database. Once created, run all other commands with this username.
mysql> create user {USER}@localhost identified by '{PASSWORD}';
You can test whether your database creation was successful by running this command:
mysql> USE {DBNAME};
Next, open wp-config.php
and edit (replace {...}
with valid strings):
define('DB_NAME', '{DBNAME}');
define('DB_USER', '{USER}');
define('DB_PASSWORD', '{PASSWORD}');
Replace the below lines with the output of this page.
define('AUTH_KEY', '');
define('SECURE_AUTH_KEY', '');
define('LOGGED_IN_KEY', '');
define('NONCE_KEY', '');
define('AUTH_SALT', '');
define('SECURE_AUTH_SALT', '');
define('LOGGED_IN_SALT', '');
define('NONCE_SALT', '');
Save and close the file.
A this point, you may need to change file/folder permissions:
find ./ -type d -exec chmod 755 {} \;
find ./ -type f -exec chmod 644 {} \;
Things like your uploads/
and plugins/
directories may need to have looser permissions. You’ll just have to test and find out what works best for your server.
Visit /wp
url and install WP …
Virtual hosts:
<VirtualHost *:80>
DocumentRoot "/Users/xxx/wordpress"
ServerName wp.local
ServerAlias www.wp.local
ErrorLog "logs/wp.local-error.log"
CustomLog "logs/wp.local-access.log" combined
#DirectoryIndex index.html
<Directory "/Users/xxx/wordpress">
IndexOptions +FancyIndexing NameWidth=*
Options -Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
More information coming soon.
- Coming soon.