Installing LAMP and WordPress on Slicehost (or elsewhere) Redux

[Disclaimer: I am not responsible for any mishaps that may occur by following these steps or advice because you follow them out of your own free will.] — I figure I better put that up-front, again.
:)

My original post on installing a LAMP (Linux, Apache, MySQL and PHP) server with WordPress seems to have helped at least a few people.

I have since come up with a few more random, but I think helpful, tidbits since writing that post. I will list them here.

Basic Commands

‘ls -alR’ for a recursive look at all owners and groups, etc.

Transferring your Blog to WordPress.org

If you are importing your blog from somewhere else and the upload doesn’t seem to be working (e.g., when you click the “Import” button you see no screen changes and/or you the browser is just “spinning”):

  • create uploads directory in wp-content
  • you may have to set wp-content to chmod 777 permissions for import
    - first try 755 on uploads. If it doesn’t work, then
    - then try 777 on uploads. If it doesn’t work, then
    - then try 777 on wp-content
  • revert everything back to 755, or what you had it before

If you are moving from wordpress.com to wordpress.org and you need your blogroll, you need to export this separately (it is not included as part of the normal export from wordpress.com). You go to http://your-wordpressDOTcom-domain.com/wp-links-opml.php and save the XML you see and then import via the blogroll/import capability (or you can just enter the link to the opml I mentioned before right in the blogroll import). Note the export only seems to work in Firefox and IE. Safari gave me a blank page.

SSL

If you want SSL for Apache – sudo a2enmod SSL (see article)

If you want SSL for your WordPress administration areas, enable SSL for wp-admin (See documentation)

For SSL resolution — if you are only using SSL on one site and you have other sites, see this forum post.

Final Setup Steps for WordPress

Make sure www-data has write access to the following — Do a ‘chmod -R g+w’ on wp-content/themes,wp-content/uploads

For final permissions:

  • find public -type d | xargs chmod 0755
  • find public -type f | xargs chmod 0644 (files)
  • find public -type d | xargs chown username:www-data
  • find public -type f | xargs chown username:www-data

If testing your wordpress.org somewhere besides the live domain, make sure to remember this article before going live.

If you find images to be funky after going live — like still pointing to your old domain or testbed site, you can manually do a search and replace in the database or use a plug in from here.

If file types should be working that aren’t working (xsl, html), maybe add to the sites-available vhost the allowed file types for the certain directory in question. For example, I added xsl because of Google Sitemaps and wanting to view my sitemaps in the browser.

Google Analytics

Google Analytics code goes above the tag in the footer file of your WordPress theme (see article)

WP Super Cache

If you are looking for a plugin that might speed up your blog by serving static, cached HTML instead of processing PHP constantly, then look to WP Super Cache. If you set up your LAMP server with Worpdress like I explained in my original post, then instead of using .htaccess, you will be putting any rules in the vhost — especially in steps 7 and 8 in the installation instructions.

Exim

Maybe replace exim with an external smtp server.

‘sudo /usr/sbin/exim4′ to get access to exim commands (like seeing message queue — exim4 -bp)

If exim4 is not working for Google Apps for some reason, check this out.


One thought on “Installing LAMP and WordPress on Slicehost (or elsewhere) Redux

Leave a Reply