5th November 2009 at 2:55 pm

Running Wordpress on OS X 10.6 Snow Leopard Server

I previously ran my Wordpress blog on an OS X client operating system. I’ve just bought a new Mac Mini running Snow Leopard Server to replace the old Mac Mini.

In theory it should be a lot more straight forward on the Server version of the operating system as everything you need is pre-installed. In practice, once you know what you need to do, it’s quite simple – but finding these things out is not so simple. In the hope this will help others here is my 4 step plan for getting Snow Leopard Server ready for Wordpress.

Server Admin

Step 1 – Enable Short Open tags in PHP – otherwise you will likely see blank screens in your Web browser and errors like this in your Apache log: “Parse Error: syntax error, unexpected $end in …..”. Search for “short_open_tag” in /private/etc/php.ini and change it so it reads “short_open_tag = On”

Step 2 – Enable MySQL – Although it’s pre-installed, it’s not running by default and it’s not necessarily obvious if you are new to Snow Leopard Server, what to do to enable it. Open Server Admin and make sure your server is selected. Then click on the [+] icon in the bottom left corner and choose “Add Service”. Find “MySQL” and select the check box then press [Save]. After this if you click on the triangle next to the sever name it should expand to show a list of services including MySQL. Select MySQL then the Settings Icon. Here you can enable network access, set the Root password and finally click on the [Start MySQL] button at the bottom of the window.

Step 3 – Enable re-writes – required for Permalinks to work. Still in Server Manager – click on “Web” in the list of services and then click on Sites. if you are not using Virtual Hosts – just select the default site, otherwise create your virtual host and keep that selected. Next, click on the “Options” button for your site and check the box next to “Allow All Overrides”, then press [Save].

Step 4 – Enable PHP5 – Still on the Web Service in Server Manager, select “Settings” and then click on the [Modules] button. Scroll down and find “php_5_module” and click on the check box to enable it. Press [Save] and then stop and start the Web service using the button at the bottom of the window.

And that’s it – your server should have everything it needs to install a working Wordpress Blog

Notes:

This will allow you to get Wordpress running on your server but there are other things that you should consider that are out of scope of this post, like NOT using your root user in MySQL for the Wordpress database.

if you didn’t enable the Web service or SMTP mail as part of the install – you can enable them in the same manner you enabled MySQL.

  • Sorry, i didnt ment to use you as a OSX Server support guy but i am having some minor problem with running Wordpress on OS X Server:

    If i login on my Wordpress site i get redirected to the Wordpress Admin section as usual, but when i go back to my homepage i am not logged in, its only when i refresh my browserwindow i am logged in, i dont think it is a cookie problem on my computer since a couple of my other websites that is running on Ubuntu is doing fine!

    I wonder if OS X Server is caching in a wrong way, i have removed the caching modules in Server Admin but it behaves the same!

    Have you encountered this problem or have any suggestions of what could be wrong?

    Thank you
  • I was using this post to try to set up my Mac Mini Server and yes this guide works but i am a complete beginner when it comes to MySQL on Snow Leopard Server, i want to connect to use Sequel Pro on my Desktop to connect to the server but i get this message when trying to do so:

    "MySQL said: Host ´192.168.0.199´ is not allowed to connect to this MySQL server"

    Anyone know what i should do?
  • I suspect it's all about privileges. The default setup on my server is that you can only administer from the localhost, e.g. the server. To allow you to administer from your desktop, you are going to have to grant the necessary privileges, something like:
    GRANT ALL ON database TO username@'host' IDENTIFIED BY 'password'; (Don't try this, it is not a real example.)

    I am by no means an expert on MySQL and I prefer to use phpmyadmin rather than the command line. There is a Wordpress plugin for this and once you have it installed you can use a web browser to configure the privileges.

    http://wordpress.designpraxis.at/plugins/wp-php...
  • Yeah you where right, i had to grant user privileges to be able to remotely connect to MySQL!

    Thank you for your help and this guide is really great for setting up Wordpress on OSX SL Server
  • Jeff, You won't see /private/etc/php.ini in Finder, I assume this is what you mean?

    You will need to use Terminal (In Utilities) and a command line editor. I would use vi but if you are unfamiliar with command line editors, you might find pico easier to use.

    Launch Terminal

    Make a backup copy of the file before you change it

    sudo cp /private/etc/php.ini /private/etc/php.ini.bak
    (you will need to enter your password.)

    Then open the file in pico:

    sudo pico /private/etc/php.ini

    Scroll down until you get to the line you need to change and make the necessary changes.

    Then press
    [CTRL]o
    [Enter]
    [CTRL]x
  • Jeff
    where do you find step 1
blog comments powered by Disqus