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.
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.










Amazon Wishlist
Ebay
Facebook
Flickr
LinkedIn
Technorati
Twitter
YouTube


where do you find step 1
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
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 expect on MySQL and I prefer to use phpmyadmin rather than the command line. There is a WordPress plugin for this and once you have in 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
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'm having the same issue than you! Snow Leopard is caching in a wrong way. Did you solved the problem?
Regads,
Javier
Yes i maybe have the solution for you, just maybe!
This one took a long time to figure out, alot of late nights and hairpulling and so on!
I have narrowed it down to be the way that OS X Server handles HTTP Header caching, it is totally fine and works really good on static content and alot of dynamic content to but for some reason WordPress doesnt play so well with it!
Go to your Sites folder in /etc/apache2/sites and open the text file that corresponds to your WordPress domain (make sure you have write permissions in that folder)
Once you open the file you will se the <directory “folder”></directory> directive
Inside the <directory> directive simply add these lines:
Header Set Cache-Control “max-age=0″
<FilesMatch “.(ico|pdf|flv|jpg|jpeg|png|gif|swf|mp3|mp4)$”>
Header set Cache-Control “public”
Header set Expires “Thu, 15 Apr 2011 20:00:00 GMT”
Header unset Last-Modified
</FilesMatch>
<FilesMatch “.(js|css)$”>
Header set Cache-Control “public”
Header set Expires “Thu, 15 Apr 2011 20:00:00 GMT”
Header unset Last-Modified
</FilesMatch>
The first line will remove the OS X Server Header caching and the FilesMatch function will then add back Header Caching to files that you want to cach directly, if you dont use the FileMatch function nothing will be cached!
So if you wanna use caching for your PHP files just install wp-super-cache and now EVERYTHING will be cached right, atleast for me it does!
So if this works for you, please reply back so i can start using this workaround in a bigger scale!
JesperA
I've installed wp-super-cache and it seems to work now.
Thanks for your help!
Javier