Setting up SVN for MegaPress ============================ (Rather over-dramatically I'm referring to WordPress Mu + bbPress + BuddyPress as MegaPress.) You will need one Apache VirtualHost per install. I would *not* recommend trying to install multiple copies in subdirectories of one site. I do this with a local install of Apache on my Mac, if you're on Windows then you will probably need a separate development box running something *nixy (of course several people will be able to develop on the one box). 1. Setup Database ----------------- We'll need a database for the installation, and for ease we'll have bbPress and WordPress Mu share the same database. (Otherwise we'd have a more complex integration between the two, we can always split this out later if we need to.) So, create a database in MySQL and grant some user all privileges over it. 2. Run build script ------------------- e.g.: `$ sh build.sh` 3. Install WordPress Mu ----------------------- Browse to your dev host to complete installation of WPMu. The first screen will tell you that you need to chmod some directories, go ahead. Once you refresh, after chmoding, the next screen will ask you how you want to handle blog addresses. Choose "Sub-domains", as this will give us the greatest flexibility. From there you can follow your nose... You should end up with a working WPMu install. I make it a habit to login with the "admin" account that's created initially, create a new admin user with a different login (check it works), then delete the initial admin account. That way when someone wants to hack my install, they don't just have to guess the administrator password... they also have to guess the administrator login - no point making it easy for the little blighters. When you first go to add a new user, as explained above, you'll be taken to the settings page which allows you to do this. While we're here we might as well set a few things: * **Allow new registrations:** Only user account can be created * **Add new users:** Yes The "Update Options". Everything else can be left as it is for the moment, but now you can add your new user, if you like, as mentioned above. **Before** you delete your old user, you need to set them up as a Site Admin. Site admins are unlike different user roles in that they aren't set on the Users screen, but in "Site Admin" > "Options" > "Site Admins"; just tack your new username onto the end there. Once you've logged in as your new user, and you're sure it all works, you can delete the "admin" username from this screen for extra safety. N.B. I have come across what might be a bug with manually adding users in WPMu (see [ticket 911](http://trac.mu.wordpress.org/ticket/911) for details). To avoid this bug, if it is a bug, you need to use a different email address for each new user registered. [See also](http://wpmututorials.com/installation/installing-wordpressmu-the-e-book/) 4. Turn on BuddyPress --------------------- Initially we'll use the standard BuddyPress themes, later we will need to develop and use our own. Enable the home theme for use by logging in as the WordPress MU site administrator and heading to “Site Admin > Themes” in the wp-admin area. Activate the theme “BuddyPress Home” theme via the Design or Appearance Menu (set "active" to "yes", then select "Update Themes"). Head to: “Site Admin > Profiles” in the wp-admin area. Set up profile groups and fields for users to fill in. We're probably going to end up with this stuff in the DB, so add whatever you want for now. [See also](http://codex.buddypress.org/getting-started/installing-buddypres-from-combo/) 5. Install bbPress ------------------ This is the fun bit. Basically bbPress will use the WPMu user accounts for logins, and cookies names will be synchonised across both apps so they recognise logged in users from each other. Browse to http://whatever-your-dev-site-is.thing/forums and you'll see the bbPress installation screen, click through to stage 1. Enter your DB details. Follow your nose until you get to the "WordPress integration" stage. * Add integration settings * Add cookie integration settings * *add your WordPress settings here as requested* * Add user database integration settings * *usually nothing to change here beyond checking that first checkbox* Then you can follow your nose again through to the end of the installation. Probably, unless you've made your bb-config.php file writeable, you'll now need to make some changes to your `bb-config.php` file. Basically, copy all the lines from `wp-config.php` that look like this (except your keys and salts will be different) and paste them into your `bb-config.php` file: ` define('AUTH_KEY', 'cf867d49801d8e33390e0f0ba7f692caaa1a111839d030bbf0a639647058cceb'); define('SECURE_AUTH_KEY', '39c16fb7937170516c29676645c5543ff4d8ebf98342c571d2dcec471398d1ce'); define('LOGGED_IN_KEY', 'ebd41e80701471cf9b3d5acabac13f346824c316ccd3c9045206e70e2f3360da'); define('NONCE_KEY', 'e1eba8784bbf672a3f9129f014ec976aeb94d847fe9038bb3ca4152a9e422962'); define('AUTH_SALT', '09eb7a0953ddafad2ddfef869cb8ee2931d4a82128664a17d08c41b9d25f2649'); define('LOGGED_IN_SALT', 'b23f1910682f801ef3a19cf7517827d331a213a66e12416249555f4b96016773'); define('SECURE_AUTH_SALT', 'f75071ad470fc37138da78beb269e21b929e33fbff6ae7883a335f36c1706497'); ` Rename the constants so they look like this: ` define('BB_AUTH_KEY', 'cf867d49801d8e33390e0f0ba7f692caaa1a111839d030bbf0a639647058cceb'); define('BB_SECURE_AUTH_KEY', '39c16fb7937170516c29676645c5543ff4d8ebf98342c571d2dcec471398d1ce'); define('BB_LOGGED_IN_KEY', 'ebd41e80701471cf9b3d5acabac13f346824c316ccd3c9045206e70e2f3360da'); define('BB_NONCE_KEY', 'e1eba8784bbf672a3f9129f014ec976aeb94d847fe9038bb3ca4152a9e422962'); define('BB_AUTH_SALT', '09eb7a0953ddafad2ddfef869cb8ee2931d4a82128664a17d08c41b9d25f2649'); define('BB_LOGGED_IN_SALT', 'b23f1910682f801ef3a19cf7517827d331a213a66e12416249555f4b96016773'); define('BB_SECURE_AUTH_SALT', 'f75071ad470fc37138da78beb269e21b929e33fbff6ae7883a335f36c1706497'); ` Now login to the bbPress admin area, and navigate to "Settings" > "WordPress Integration". Set the following for the moment: * WordPress Administrator : bbPress Key Master * *everything else* : bbPress Member Then "Save User Role Map". (Possibly later we'll make editors on WP have more privileges on bbPress, or something.) Add the following lines to `bb-config.php` and `wp-config.php`: ` define('COOKIE_DOMAIN', ''); define('COOKIEPATH', '/'); ` WordPress varies the cookie names with each installation of WordPress, this makes it difficult for bbPress to know which cookies to look for. Luckily we can force WordPress to use a particular cookie hash using the COOKIEHASH constant so that the WP cookie names are the same as the bbPress cookie names. So clear your cookies, then log into bbPress. Now go and look at your cookies, there should be one called something like `wordpress_3f0bbe4bd45efc56c79945ab386af966`. Copy everything after `wordpress_` and use it in a constant define like the following (except your hash will be different) in your `wp-config.php` file (not needed in `bb-config.php`): ` define('COOKIEHASH', '3f0bbe4bd45efc56c79945ab386af966'); ` What we've done here is ensure that WP users the same cookie names as bbPress, Clear all domain and session cookies. Test everything. You should now be able to log in on bbPress, then move to WPMu remaining logged in, and vice versa. 6. Reward Time -------------- Well done! Time for a biscuit or perhaps a slice of cake, and a nice hot cuppa.