I set up a WordPress test environment on a machine running Ubuntu 10.04 so that I can implement and preview all changes prior to rolling them out live. There are a lot of instructions, notes, and other items related to installing the WP Super Cache plugin, however nothing seemed to work for my particular configuration. I ended up having to do quite a bit of searching around to figure out how to get everything to work and so I decided to document what I found to work on my system. My server config:
Ubuntu 10.04STEP 1 - Download WP Super Cache plugin
WordPress 3.1.1
Apache2 (standard install via synaptic)
New install of WP Super Cache plugin (I did not have the WP Cache plugin)
You can download it here, or within the WordPress management console.
STEP 2 - Extract plugin files to WordPress Plugin directory and set permissions
The WordPress plugin directory is located in
../wordpress_root/wp-content/plugins
Set permissions via the command line:
user@host:$ cd ../wordpress_root/wp-content/plugins user@host:$ sudo chmod -R 0755 wp-super-cache
STEP 3 - Install required modules for Apache
rewriteThe command to install these modules is
mime (this was already installed on my system)
headers
expires
user@host:$ sudo a2enmod rewrite
After installing all required modules you will need to restart Apache, however wait until after the following tasks to do this, as otherwise you'll have to do it twice.
STEP 4 - Add configuration entries for Apache
Edit the following files located in /etc/apache2/sites-available:
wordpressI just executed the following command to edit in gedit:
default* - Make sure you edit this file as well as the wordpress file, I failed to do so initially and it took me quite a bit of troubleshooting before I made the same changes to default and got things to work.
user@host:$ sudo gedit /etc/apache2/sites-available/wordpress
Here's what I have at the top of the wordpress file:
<virtualhost *:80=""> ServerAdmin webmaster@localhost DocumentRoot /var/www/wordpress <directory> Options FollowSymLinks AllowOverride All </directory> <directory var="" www=""> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </directory>
Here's what I have at the top of the default file:
<virtualhost *:80=""> ServerAdmin webmaster@localhost DocumentRoot /var/www <directory> Options FollowSymLinks AllowOverride All </directory> <directory var="" www=""> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </directory> </virtualhost>
Now restart apache:
user@host:$ sudo /etc/init.d/apache2 restart
STEP 5 - Activate Permalinks within WordPress
The WP Super Cache plugin requires that "pretty links" be enabled in order to function. This is of course also beneficial for aesthetic reasons, as well as SEO, but is also a necessary step here. All you have to do is select something other than the default. You can either use one of the available options such as Day and Name or Month and Name. If you don't like any of the available options, see the WordPress Permalink documentation for some of the other variables to construct you own structure and put it into the custom field.
Permalink Settings in WordPress Admin Console |
STEP 6 - Activate WP Super Cache plugin within WordPress and configure
Once you've completed all of the steps above, you should be able to activate the WP Super Cache plugin within the Plugin screen of the WordPress Admin Console and then enable caching.
Once you've activated the WP Super Cache plugin go to the WP Super Cache Control Panel under Settings in the WordPress Admin Console. Select the radio button next to Caching On (Recommended)
Enable Caching in WP Super Cache Settings |
Once you do this, if you scroll down the settings page, you will probably see a notification about needing to update the .htaccess file in the WordPress directory. Provided the permissions are correctly set in your root WordPress directory, WordPress should have generated an .htaccess file for you and inserted the appropriate entries when you changed your Permalinks setting to a custom definition. If you get error messages about .htaccess make sure that the following permissions are set on your WordPress directory:
user@host:$ sudo chown -R user:www-data [wordpress_root_directory_location]/wordpress user@host:$ sudo chmod -R 0755 [wordpress_root_directory_location]/wordpress
Once that is done, WordPress should be able to update your .htaccess file without issue. Scroll down the settings page and look for a notification that your Mod Rewrite rules are out of sync and need to be updated. Click on the Update Rewrite Rules button and you should see a screen similar to that below.
Apache mod rewrite rules updated successfully by WordPress |
I also enabled a few options under the Advanced tab, which I can confirm work fine on GoDaddy.com
Advanced tab under WP Super Cache Settings |
Good luck, hopefully this works for you too.
How Do I Chose The Best WordPress SEO Plugin For My Website?
ReplyDeleteHow Do I choose A Good WordPress Hosting Solution?
Can Free WordPress Themes Hurt My SEO?
What’s better for SEO — Installing WordPress On A New Domain, Subdomain Or Subfolder?
Fix WordPress lost posts “404 Error Found” Problem
How to fix Error in database connection
Fix WordPress lost posts “404 Error Found” Problem
11 Best eCommerce wordpress themes
How to fix wordpress Parse Error: syntax error
15 very basic wordpress errors
9 Important Steps to Increase WordPress Loading Speed
Where can I find help with the CSS problems I'm having?
Why does the password emailed to me look weird?
Why do I get an error message about Sending Referrers?
Are there are any problems with using MySQL 4.1.7 for WordPress?
Error Establishing Database Connection
Pretty Permalinks 404 and Images not Working
Do I need to know PHP to use WordPress?
I’ve Heard That WordPress Is Search Engine Optimized (Out-Of-The-Box). Is That True?
I’ve Installed A WordPress SEO Plugin. That Means I Don’t Need An SEO Consultant, Right?
Will Adding A Post To Many WordPress Categories Be Good For My SEO?
ReplyDeleteHello,
we provide affordable and result-oriented SEO services, please give a chance to serve you.
Thanks
Admin: E07.net