WordPress needs to access your webserver

The error you may get when trying to install a WordPress plugin running natively on Mac OSxI have been working with WordPress for a few months now, and have been developing my sites on my MacBook Pro whilst traveling to work on the train.

I have apache running and using a combination of host file entries and apaches virtual hosts file I can have a number of sites running from my laptop for development purposes.  My main issue has been installing plugins and upgrading wordpress, when ever I tried to do this I found I got prompted for FTP details.  I was never quite sure why it need my ftp details as I was sure my live installations have no record of the actual ftp security credentials, yet they work fine.  So after several sessions on Google I found the excellent article by Chris Abernethy explaining why wordpress needs this.  It turns out the fileowner of the WordPress website files need to be the same as the account that apache is running under.  In the case of Mac OSx 10.6.7 this user is _www

So by opening a terminal window and navigating to my ‘Sites’ folder I could set the owner for the specific website concerned.

sudo chown -R _www websiteFolder

Now my plugin’s install via the GUI in the same way they do on my live production servers.

Posted in Uncategorized | Tagged , , | Leave a comment

Useful files on a MAC

I have added this blog entry as a reference for my self.  I occasionally need to add an host file entry or change a setting in apache and always end up Googling to remember where the files are located.  So here is a simple list along with some commands I may run when I get there.  I have a Mac Book Pro running OSx 10.6.6

host file

Use textwrangler or similar edit and Open Hidden file

/private/etc/hosts

apache

httpd.conf

The main configuration file for apache is located at:

/private/etc/apache2/httpd.conf

In this file there a number of configurations you can amend including the site location.  However if you want to run multiple sites on multiple host headers you need to enable vhosts in the httpd.config, this will be probably commented out so just remove the #

# Virtual Hosts
#include /private/etc/apache2/extra/httpd-vhosts.conf

httpd-vhosts.conf

The main virtual file for apache is located at:

/private/etc/apache2/extra/httpd-vhosts.conf

php.ini

/private/etc/php.ini
Posted in Uncategorized | Tagged , | Leave a comment

Continuous Integration on a Budget

This is the first in a series of blogs that will describe how I have created cost efficient Continuous Integration environments for web development environments, with automated testing for two of my clients.  For both these clients they could see the advantages of continuous integration, but with small development teams (some members off shore) and a small budget an expensive infrastructure was out of the question.

I would suggest the following solution is ideal for teams of up to 5 developers and costs less than $100 / month.

The key components are listed below

  • Source Control: SVN
  • Continuous Integration: Teamcity
  • Automated Testing: Selenium
  • Server hosting: Amazon

In order to keep costs down, servers will only powered up when required and auto shutdown after a period of inactivity.  This is ideal for Amazons cost model where you only billed on an hourly basis.

Developers are provided with a simple a custom control panel to start the SVN source control server in order to check in their code.  Though these equally could done by a command line using the Amazon Command Line tools or even the Web interface provided by Amazon

The SVN server also hosts Teamcity, which monitors the SVN repository, the process is as follows

  • Developer starts SVN / Continuous Integration Server
  • Teamcity detects the checkin and builds the latest code.
  • After a successful build Teamcity starts the test server and deploys code.
  • After a successful deploy Teamcity runs the Selenium test and reports the successes and fails back to Teamcity
  • Failures are reported back to the developer completing the loop.

The forthcoming blogs will go into each of these stages in a little more detail.

Posted in Uncategorized | Tagged , | Leave a comment