Post on 08-May-2015
description
Pete Mall@petemall
pete@jointforcestech.com
WordPress MU 101
What is WordPress MU
• Underlying software for wordpress.com• Multi-user version of WordPress• Unlimited users and blogs• Scalable• Independent permissions, themes & plugins• Powerful CMS• WordPress and WordPress MU to be merged
Who is WPMU for?
• Newspapers and Magazines• Universities• Blog Networks• Niche-specific blog hosts• You?
Why use WordPress MU?
• Supports multiple blogs and bloggers• Easily switch between blogs• Single install – easy to update• Easy to manage plugins and themes• Content Management System
WordPress MU Requirements
• PHP version 4.3 or greater• MySQL version 4.0 or greater• Apache mod_rewrite (Linux Hosting
Recommended)• Wildcard CNAME record for subdomain• Avoid Shared Hosting
Configure Apache
• Add the following to httpd.conf/usr/lib/apache2/modules/mod_rewrite.so
• Virtual Host <Directory> directiveReplace “AllowOverride None” with
“AllowOverride FileInfo Options”
Installing WordPress MU
• Create database for WordPress MU• Download and extract• Set permission to / and /wp-content to 777• Run WordPress MU installation script• Wait for the Magic!• Reset the permission to / and /wp-content to
755
Configuration
Sub-domain vs Sub-directory
• Sub-domain: blog.domain.com• Sub-directory: domain.com/blog
Configuration: Sub-domains
• DNS Wildcard Record*.domain.com. 14400 IN A 76.74.254.126
• Add the following to httpd.conf under <VirtualHost>ServerAlias *.domain.com
Plugins
• Regular Plugins: wp-content/plugins• MU Plugins: wp-content/mu-plugins• Site-wide plugins• Blog specific plugins
Installing Regular Plugins
/wp-content/plugins
• Enable plugin access:Site Admin > Options > Menus > Plugins
• Download and extract to wp-content/plugins• Activate plugins sitewide• Activate plugins on a per-blog basis
Installing MU Plugins
/wp-content/mu-plugins
• Not recommended for WordPress plugins• Download and extract to wp-content/mu-plugins• Plugins are automatically activated sitewide• Plugins don’t appear wp-admin > plugins• Blogs owners have no control over plugins• Core site plugins
Installing Themes
• Download and extract to wp-content/themes/• Activate themes before they can be used• Activate themes sitewide:
Site Admin > Themes > “yes under activate”• Blog specific themes:
Site Admin > Blogs > Edit > Blog Themes
Site Options
Site Admin > Options• Allow blog owners to add new users• Allow new registrations * • Banned Names• Restrict new registrations to certain domains • Limit blog upload space• Limit upload file types• Limit upload file size
Caching
• MU caching framework allows third party caching engines
• Two types of caching frameworks:– Object Cache: • Store commonly accessed data in a rapid access
container (RAM / filesystem)
– Full Page Cache: • Store complete web pages • Generally faster, less flexible
Spam
• Spam Comments– Akismet– Hashcash
• Spam Signups– CAPTCHA– .htaccess hack
Code Backup
backup: tar czf backup_html_$(date +%Y_%m_%d-%H_%M).tar.gz html/
exec ./backup
backup_html_2009_10_10-11_43.tar.gz
Database Backup
backupdb: mysqldump -h <hostname> -qp --all-databases | gzip > all-databases_$(date +%Y_%m_%d-%H_%M).sql.gz
exec ./backupdb
all-databases_2009_10_10-11_45.sql.gz
Domain Mapping
• Allow users to map their blog to a domainmyblog.com vs myblog.domain.com
• User points A record to MU site• Domain Mapping plugin maps their domain to
their blog
Multi-DB Plugin
• Standard MU installation requires only one db• Multi-DB plugin splits single db into multiples• Easy to manage• Performance boost
PHP Settings
• Don’t display error messages on productionphp_flag display_errors 0 (.htaccess)register_globals = Off (php.ini)
• Increase memory limit to 32MB or 64MB• Turn GLOBAL variables off
php_flag register_globals 0 (.htaccess)display_errors = Of
• Turn error logging on
Questions?
pete@jointforcestech.com@petemall
developersmind.com