Um, he's sick. My best friend's sister's boyfriend's brother's girlfriend heard from this guy who knows this kid who's going with the girl who saw Ferris pass out at 31 Flavors last night. I guess it's pretty serious.
This is a simple starting point for WordPress installs.
Inspired by:
- David Winter: Install and manage WordPress with Git
- markjaquith / WordPress-Skeleton: Basic layout of a WordPress Git repository. I use this as a base when creating a new repo.
Discussion:
On my Mac (10.8.x
), I use XAMPP for local Apache/PHP/MySQL testing (see also: XAMPP: Mac).
Edits to /Applications/XAMPP/xamppfiles/etc/httpd.conf
:
-
Uncomment the
httpd-vhosts.conf
line:# Virtual hosts Include /Applications/XAMPP/etc/extra/httpd-vhosts.conf
-
Change
User
/Group
toYOUR-LOGIN-USER
/staff
.
Edits to /Applications/XAMPP/xamppfiles/etc/extra/httpd-vhosts.conf
:
-
See here for more detailed information on my particular setup, but here's the VirtualHost setup I'm using:
<VirtualHost *:80> DocumentRoot "/xxx/USERNAME/development" ServerName dev.local ServerAlias www.dev.local ErrorLog "logs/dev.local-error.log" CustomLog "logs/dev.local-access.log" combined #DirectoryIndex index.html <Directory "/xxx/USERNAME/development"> IndexOptions +FancyIndexing NameWidth=* Options Includes FollowSymLinks Indexes AllowOverride All Order allow,deny Allow from all </Directory> </VirtualHost>
I use Hosts for Mac to "allow for easy hosts file editing". Once installed, navigate to your System Preferences
>> Other
: Hosts
. Add 127.0.0.1
as an "ip" and dev.local
as your "hostname". Now, start-up (or restart) Apache via XAMPP control panel, open a browser and visit: http://dev.local
.
Open terminal, navigate to your home directory (or, wherever you want to clone this repo) and run:
$ git clone --recursive https://github.com/mhulse/bueller.git development
The above command clones this repo, and its submodules, into a root directory named development
.
…OR:
Clone this repository using GitHub for Mac or GitHub for Windows.
Simply, go to http://localhost/phpmyadmin
, login, and create a new database for your WordPress install.
Duplicate wp-config-sample.php
, rename it to wp-config.php
, and fill-in the database connection information.
If you don't do anything, one of the stock themes, from the WP core, will get used by default.
If you want to use your own theme, you can put it in /content/themes
.
I've opted to use a symbolic link to a theme that has been cloned elsewhere on my computer.
$ cd ~/development/content/themes/
$ ln -s ~/path/to/theme/theme-name theme-name
The above commands will create a symbolic link in the content/themes/
folder that's pointing to the theme-name
repository.
Now, in your wp-config.php
file, uncomment the below line and add the name of your theme:
define('WP_DEFAULT_THEME', 'theme-name');
Visit http://dev.local/wp-admin/install.php
and follow instructions.
My host is WebFaction (I highly recommend).
Once you've setup a WordPress install (quick overview):
- Log in to the Webfaction control panel.
- Create a domain.
- Create a WordPress application (I called mine "blog")
- Create/add a website.
The above will create a ~/webapps/blog/
directory; navigate to this directory and:
-
Delete all files.
-
Clone the
bueller
repo into/blog
:$ git clone --recursive https://github.com/mhulse/bueller.git ./blog
... or, if you've forked this repo and you want the ability to push/pull:
$ git clone --recursive git@github.com:USERNAME/bueller.git ./blog
See the tips section for more information.
-
Create a
wp-config.php
with all the proper settings. -
Install your custom theme:
$ cd ~/webapps/content/themes/ $ git clone git@github.com:USERNAME/theme-name.git
Visit http://foo.com/wp-admin/install.php
and follow instructions.
-
Update WordPress using the terminal;
cd
towp
folder and run:# View local tag: $ git describe --tags # Get tags from remote: $ git fetch --tags # View them: $ git tag -n # If local isn't latest, get the latest: $ git checkout x.x.x # Go back to parent directory: $ cd .. # Commit new version: $ git commit -a -m "Update Wordpress to version x.x.x" # Push commits: $ git push
… where
x.x.x
is the version of WordPress you want to upgrade to. -
If you've forked the repo and cloned it using SSH, then you'll probably need to setup a ssh key on WebFaction.
Here's a quick overview:
# Navigate to your .ssh folder (create one if it's not there): $ cd ~/.ssh # List the contents of the .ssh directory: $ ls -la # Check to see if you already have a id_rsa.pub or id_dsa.pub; if yes, skip to step 3 below.
Step 2: Generate a new SSH key:
$ ssh-keygen -t rsa -C "you@site.com" # … and follow the on-screen instructions. # Once this is done, open the file and copy the contents.
Step 3: Add your SSH key to GitHub:
- Go to your Account Settings.
- Click "SSH Keys" in the left sidebar.
- Click "Add SSH key".
- Paste your key into the "Key" field.
- Click "Add key".
- Confirm the action by entering your GitHub password.
- v1.0.1
- 2013/11/17
- Reorganized
wp-config-sample.php
. - New debug settings (#8)
- Minor tweaks to
README.md
.
- Reorganized
- 2013/11/17
- v1.0.0
- 2013/07/10
- Added version number to
wp-config-sample.php
. - Cleaned up
README.md
.
- Added version number to
- 2013/07/10
- Pre-v1.0.0
- Just getting things organized.
Copyright © 2013 Micky Hulse
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License in the LICENSE file, or at:
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.