WordPress as CMS
Introduction
This is a simple HOWTO on installing WordPress 3.0 on a Linux box running
a high-performance web server and the MySQL database server with the
bbPress (forum) and BuddyPress (social n/w) modules.
Setup
SMTP server
So WordPress can send forgotten passwords.
MySQL
- apt-get install mysql-server mysql-client
- Provide password for user root@localhost
- Create user specifically for WordPress database and grand all privileges:
- mysql> CREATE DATABASE wordpressdb;
- mysql> CREATE USER 'wordpress'@'localhost' IDENTIFIED BY 'test123';
- mysql> GRANT ALL PRIVILEGES ON wordpressdb.* TO 'wordpress'@'localhost'
WITH GRANT OPTION;
- mysql> SHOW GRANTS FOR 'wordpress'@'localhost';
- mysql> EXIT
- # mysql -u wordpress -p
- mysql> EXIT
If you need to start over, remove the WordPress database in MySQL:
- DROP DATABASE wordpressdb;
- DROP USER 'wordpress'@'localhost';
Web server
WordPress
- Download and unzip the WordPress application:
cd /tmp
wget
-c http://wordpress.org/latest.tar.gz
tar -xzvf latest.tar.gz
- mv ./wordpress /var/www/
Or if the web
server is on a remote host:
apt-get install ncftp
ncftpput –R
–v –u "username" ftp.server.com /remotedir /localdir
- chown /var/www/wordpress? www-data.www-data by default
- cd /var/www/wordpress, cp wp-config-sample.php wp-config.php
- vi wp-config.php (instructions)
- Remove wp-config.php for security reason?
- Aim your browser at http://wp-server/wp-admin/install.php
- Write down admin password
Use suPHP so that WordPress runs with
a user's username instead of the server's default shared username.
FAQ Installation
FAQ Troubleshooting
bbPress
- In MySQL, it's easier to just re-use the database + user/password that
is used by WordPress. WordPress and bbPress use different tables with different
prefixes, so data don't get mixed.
- cd /tmp
- wget -c http://bbpress.org/latest.tar.gz
-O bbpress.latest.tar.gz
- tar xzvf bbpress.latest.tar.gz
- mv bbpress /var/www/wordpress/ (ie. bbPress must be underneath WordPress.
Some documents say it's OK to install bbPress in the same directory as WordPress,
although I don't know if it's safe)
- http://mysrv/wordpress/bbpress/
- Follow the instructions to have a working bbPress site.
If you want to start over:
- rm /wordpress/bbpress/bb-config.php
- In MySQL: drop table bb_ tables?
Integrating WordPress and bbPress
Based on Integration
with WordPress and WP to BBP/Integration,
here's how to integrate WordPress and bbPress:
- vi /wordpress/wp-config.php, comment out everything between lines
45-48 and paste the following (in "vi": 45G -> go to line 45):
/*
define('AUTH_KEY',
'put your unique phrase
here');
define('SECURE_AUTH_KEY', 'put your unique phrase here');
define('LOGGED_IN_KEY',
'put your unique phrase here');
define('NONCE_KEY',
'put your unique phrase here');
define('AUTH_SALT',
'put your unique phrase here');
define('SECURE_AUTH_SALT',
'put your unique phrase here');
define('LOGGED_IN_SALT', 'put
your unique phrase here');
define('NONCE_SALT', 'put
your unique phrase here');
*/
define('AUTH_KEY', '+O=v1]Bg7Ka=2-#?y
T=e1-?U-+6lhDvBsbo;|Acb4diI0R}eH`n0oZ+?~Ll!>0(');
define('SECURE_AUTH_KEY',
'V]PGk-ZD>.6j~qO~G2s@WVJJ^*EZn:V{ggTlsN=R F#8(Cfz(-%gk6,/C52dvBNc');
define('LOGGED_IN_KEY',
'&ZO~DvB=hx1&MBYVM`N(+ufW$^b0K8hM+YsMtK!8)la-iNe-zKQ1RQr.rQbMVF76');
define('NONCE_KEY',
'|&*&@*)Q1#h^it0M* 6]c-Kp@J1}S?sG{|pbj#flZ[)VU]xc*wX2-~RXY{^7SBzg');
define('AUTH_SALT',
'_Q*x[os|9hE)8B|Cg`K?wZmf,]kkkXHe{>Ym*42P;:%ktJ3:Wx+:MqI4THO,FNUg');
define('SECURE_AUTH_SALT',
'Sd=;;.iBJ,C0?c@[7t*K0?3-P)xp(ig]4Z; H1%6|)V`G|TRRBd^J)G?!`UqOB#}');
define('LOGGED_IN_SALT',
':.c@V4{WJiIacp{VSIq?/eEk3nc;)`mKv&rny}t^e;*NT`;8JjBgHMbJB,9R1N=<');
define('NONCE_SALT',
'btp5*CFP2:=k9Z(B[_FBO4p5w+y|+t,[Q:qIk)R:5>PBzVR-E;]?BW/%n(B~T]6r');
Save
wp-config.php but leave it open.
- In another terminal window, vi /wordpress/bbpress/bb-config.php,
and 41G: Comment out the lines between BB_AUTH_KEY and BB_NONCE_KEY, paste
the same instructions and prepend each line with BB_:
define('BB_AUTH_KEY',
'+O=v1]Bg7Ka=2-#?y T=e1-?U-+6lhDvBsbo;|Acb4diI0R}eH`n0oZ+?~Ll!>0(');
define('BB_SECURE_AUTH_KEY',
'V]PGk-ZD>.6j~qO~G2s@WVJJ^*EZn:V{ggTlsN=R F#8(Cfz(-%gk6,/C52dvBNc');
define('BB_LOGGED_IN_KEY',
'&ZO~DvB=hx1&MBYVM`N(+ufW$^b0K8hM+YsMtK!8)la-iNe-zKQ1RQr.rQbMVF76');
define('BB_NONCE_KEY',
'|&*&@*)Q1#h^it0M* 6]c-Kp@J1}S?sG{|pbj#flZ[)VU]xc*wX2-~RXY{^7SBzg');
define('BB_AUTH_SALT',
'_Q*x[os|9hE)8B|Cg`K?wZmf,]kkkXHe{>Ym*42P;:%ktJ3:Wx+:MqI4THO,FNUg');
define('BB_SECURE_AUTH_SALT',
'Sd=;;.iBJ,C0?c@[7t*K0?3-P)xp(ig]4Z; H1%6|)V`G|TRRBd^J)G?!`UqOB#}');
define('BB_LOGGED_IN_SALT',
':.c@V4{WJiIacp{VSIq?/eEk3nc;)`mKv&rny}t^e;*NT`;8JjBgHMbJB,9R1N=<');
define('BB_NONCE_SALT',
'btp5*CFP2:=k9Z(B[_FBO4p5w+y|+t,[Q:qIk)R:5>PBzVR-E;]?BW/%n(B~T]6r');
/*
define(
'BB_AUTH_KEY', 'blah' );
define( 'BB_SECURE_AUTH_KEY', 'blah' );
define(
'BB_LOGGED_IN_KEY', 'blah' );
define( 'BB_NONCE_KEY', 'put your unique
phrase here' );
*/
Save bb-config.php but leave it open.
- Log out of WordPress and bbPress, and clear the cache of your web browser
(CTRL-SHIFT-Del in Google Chrome)
- Log into WP as admin (/wordpress/wp-admin/). In the Dashboard section
on the left, select Plugins > Add New
- Search for "bbpress", and select "bbPress Integration":
Install and activate the plugin.
- In the Settings section on the left, select bbPress Integration.
- Fill out the information:
bbPress URL = http://192.168.0.8:8787/wordpress/bbpress
Select
"WordPress MU" > Save Changes
- From the grey box at the bottom of the page
("COOKIEHASH", etc.), copy information into the clipboard
- Go back to wp-config.php that you left open above, go to line
16 (before it says "// ** MySQL settings"), and paste clipboard.
Save and close file.
- Go back to bb-config.php, and paste the same data at line 13
(before it says "// ** MySQL settings"). Save and close file.
- The bbPress plugin is no longer needed: In the WP Dashboard, go back
to the Plugins section, deactivate and delete bbPress Integration plugin.
- Clear cache in your web browser
- Log into bbPress (/wordpress/bbpress/) as admin, click on Admin at the
top. In the Dashboard section on the left, open Settings > WordPress
Integration: For "WordPress Administrator", pick "bbPress
Key Master". Until you're comfortable with WordPress/bbPress, other
items should be set to "bbPress Member". Click "Save Changes".
- Scroll down and make sure the "auth" cookie salt, "secure
auth" cookie salt, and "logged in" cookie salt are not editable
and have an icon of lock. If OK, continue to the next step; If NOK, go through
this whole procedure again...
Deep Integration: Optional. Used so that bbPress will have access to WordPress'
functions. In bb-config.php:
- At the very end of the file, right before ?>, add include_once('/your/absolute/path/to/wordpress/wp-load.php');
- Add require_once(dirname(__FILE__) . '/path/to/wp-load.php');
- Clear browser cache
- Log into your WP Dashboard and navigate to Plugins
- Delete the plugin "bbPress Integration"
More information:
Customizing
Now that the default site is up and running, here's the major things you
might want to customize:
Adding favicon.ico
Adding icon left of title bar in homepage
Add bbPress for forums
Add BuddyPress for social networking
Disable comments on blog entries
Solid anti-troll solution for forums
Q&A
Can WP scale out?
Can the homepage be statically generated to reduce accesses to DB?
How to change the admin password?
Log on through /wp-login.php,
choose Users in the left-hand menu > Users > admin > Scroll down to
"New Password"
How to use FluxBB for forum?
http://www.develophp.org/2010/05/23/integrate-fluxbb-1-4-with-a-wordpress-site-part-1/
How to get the list of most popular plugins?
- http://wordpress.org/extend/plugins/
- "Highest Rated"
- "Search Plugins"
- "No results found." :-/
Resources
Books
Sites