Learn / eZ Publish / Install eZ Publish 4.3 on Apple Snow Leopard Server

Install eZ Publish 4.3 on Apple Snow Leopard Server

 

Introduction

The combined availability of the iPad, OS X Server, and eZ Publish presents unique opportunities for delivering a great content experience throughout enterprises of all sizes. Apple OS X is a unix styled Operating System. While not as widely used or renowned as others, it provides undeniable advantages for installation and deployment simplicity, as well as controlled cost.

While iTunes, iPhone, and iPad make the headlines, the server systems powering the billions of downloads of multimedia and binary content have risen to meet the challenge in relative silence. Silence is a good thing in the server world, where "being noticed" means a problem has occurred.

Apple provides excellent documentation and tools to allow practically anyone to set up and configure OS X Server for Web services. MySQL and PHP are not enabled in a default configuration. The purpose of this document is to describe how to enable MySQL and PHP, then install eZ Publish in the simplest possible way.

While the Server version is not strictly required, and there are other options like the MAMP project, this document specifically focuses on how to deploy eZ Publish on the Snow Leopard Server Version of OS X.

 

Pre-requisites and target population

Requisite knowledge

Know how to use Finder for navigating file structure, Safari for downloading files.

Hardware/Software Requirements

OS X Snow Leopard Server

Get it here for ~$500USD and install on any hardware that meets the requirements : http://store.apple.com/us/product/MC190Z/A

Here, choose the server version, get a 1 terabyte appliance, for about ~$1000 USD :
http://store.apple.com/us/browse/home/shop_mac/family/mac_mini

Or here to balance power required to available budget : http://store.apple.com/us/browse/home/shop_mac/family/xserve

eZ Publish

Download eZ Publish here : http://ez.no/download.

Available support options here : http://ez.no/support_and_services

The following presumes Snow Leopard Server is installed and configured, with Web services enabled. Also that an admin account user is logged in to perform the eZ install.

 

Preparing for eZ Publish

Login as admin on the Snow Leopard Server to begin. Then :

  • Launch Safari and download eZ, zip or tar.gz, does not matter. The "Downloads" folder will do it's little dance when the download is complete, open the download folder, double-click the downloaded file to extract it to a folder named same as the download file.
  • With the Downloads folder still open, open a second Finder window and browse from ServerHD or whatever the server primary disk is named, to Library->Webserver->Documents.
  • Drag the extracted folder from Downloads Folder into the Documents folder.
  • A couple of slow clicks on the text of the folder name will allow editing the name from ezpublish-4.3.xxx to ez43 or something short and descriptive to you.
 

Server Admin

Launch the Server Admin tool, it is the globe looking icon located on the dock in Snow Leopard Server. The Server Admin tool can also be installed on any Snow Leopard Mac for remote administration for use with headless servers or remote administration needs. It is the same tool and works the same way regardless of where it is installed.

There will be what Apple terms a "flippy triangle" to the left of the server you are administrating.
Click the flippy triangle to drop down a list of available services. The "Web" service is at the bottom of the service listings and should already be enabled. If not, open Server Preferences from the dock, then "Web", slide the switch to "On", and reload the services list.

Open a browser to the server address and verify the Mac OS X Server splash page displays.

 

MAMP Stack

The Mac-Apache-Mysql-PHP stack is included in every copy of Snow Leopard Server. Diehard linux-unix will be pleased to know that these, and other popular open source command line tools, are pre-installed and configured in Snow Leopard Server. PHP and MySQL must be enabled and started to complete the functionality.

The Apple documentation for working with the stack on SL Server http://www.apple.com/server/macosx/resources/documentation.html then select the "Web Technologies Administration" pdf download.

Current versions as of March 2010:

  • Apache 2.2.13 (prefork mode)
  • MySQL 5.0.5
  • PHP 5.3.0

Power users need not settle for the default shipping versions of any of these, or wait on Apple to update versions. With Xcode tools installed, OS X Server can compile and run any POSIX compliant unix code. More http://www.apple.com/opensource/ and http://opensource.apple.com/

Enable MySQL

  • Click the server name to the right of the flippy triangle for the server in question
  • Click the Settings icon at the top
  • Checkmark the box for the MySQL service

This adds MySQL to the services list under the flippy triangle, but notice that it is not started, the ball grayed rather than green like the other active services. That means a little more work is required.

 
  • Click on the MySQL text in the list of services
  • Click the Settings icon at the top
  • Click the big button that says "Set MySQL Root Password" and enter a good password.
  • Click the Button at lower left that says "Start MySQL" This is a toggle button, it will change to "Stop MySQL" when MySQL starts.

To verify MySQL is working,

  • Start the "Terminal" application in the dock to get a unix command line
  • Enter "mysql -uroot -p<password-just-entered-here>" at the command line interface (cli) prompt, substituting the password just entered and leaving out the <> characters.
  • A mysql> prompt should display.
  • At this prompt enter :
    "CREATE DATABASE `ez43` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;" 
    
  • The utf8_general_ci is required, latin1_swedish_ci is the default collation and will not work.
  • "show databases;" to verify creation.
  • "quit;" to exit mysql.
  • Leave the Terminal application open, it will be used again shortly.

Power users are not stuck with the default shipping version of MySQL. See "Upgrading MySQL" in the MAMP stack documentation referenced earlier.

 

Enable PHP

  • Click on Web in the service list
  • Then Settings
  • Modules
  • Put a checkmark in the php5_module box
  • Click Save which will restart Apache to effect the change. A little rotating gear will appear, then disappear to signal that Apache has re-started successfully. There will be no problems if simply enabling the default shipped version of PHP.
  • In cases of customized php versions or extensions that fail to load, the "Stop Web" button will change to "Start Web" and the Web service ball will turn from green to gray or orange to signal a problem starting Apache.

Custom php versions and extensions work much the same on OS X as on any linux-unix. See appendix below or go to php.net for more info.

 

The Server is Ready, Start the eZ Publish Install

Launch Safari Web browser and test run an install. Be sure to use fully qualified domain name so it will be visible on lan/wan.

Click Finetune and receive a permissions error with 3 lines of commands in the top box.

Select all three lines and copy to the clipboard (Cmd-C). Click the Terminal application to make it active again. Switch to root user using su command. Unlike the standard version, su is enabled by default in the Server version of OS X. The password is the same as the original admin password unless it was forcibly changed after setup.

 

eZ Publish Installation, continued

Paste from the clipboard into command window. The first two lines of command will run automatically. Pressing the enter key is required to invoke the final line. Should end with a clear prompt.

ImageMagick, Postgres, and Text Creation functions warnings remain, and can be safely ignored for now. OS X Server uses imageGD, eZ will notify you of that near the end of the install. See the Appendix for more regarding custom php extensions.

Make a choice of eZ extensions. The Website Interface with Demo content is my choice, any others should work.

 

eZ Publish Installation, further continued

Verify the database just created for this install is selected in the drop down selector.

Next appears a site security warning, which in my reasonably well researched opinion may be safely ignored. Don't take my word for it, do your own study. You may find reason to believe that OS X has tweaks in place on top of the virtual server system that make it secure enough for your use.

You have shell access with su, so creating an .htaccess file is not a problem. The problem with custom .htaccess on OS X Server is that Apache AllowOverride is set to None which means .htaccess files will be ignored. This is a server wide security setting, so do not change that setting wholesale for the server. Change it only on a per directory basis. If you feel .htaccess is necessary, and know what you are doing:

/etc/apache2/httpd.conf is the apache configuration file, then something like the below into the Directory listings.

<Directory "/Library/Webserver/Documents/ez43">
   AllowOverride All
</Directory>
 

Finished eZ Publish Installation

Congratulations, that is it. Nice job by the eZ team to make such an easy install on OS X Snow Leopard Server. I have done it many times, on many servers, it is just this simple.

 

Conclusion

The steps outlined above provide a fast, high tech, high PR value way to roll out community portals and social networking sites. Simplicity is retained as the primary feature for the entire system. Simplicity-removing complexity, is gaining mindset as the key to systems of the future that will serve users first. Apple understands the power of simple, eZ Publish too. Beyond understanding the problem, both continue innovating, doing something about it! Combining the technologies builds powerful information systems that push the envelope of innovation forward. Rock solid stability, simple administration, easy updates, pick the three you need for your project, and add long term commitment and sound business models.

This article and more regarding how to use eZ Publish and Apple technologies to deliver the best possible Web content experience here :
http://webportalmaster.com/index.php/eng/osx/HowTo/Install-eZ-4.3-on-Snow-Leopard-Server

There are millions of webmasters, only one webportalmaster.com, where the quest to define the best Web communications models continues, daily.

Additional information links:

 

Appendix - PHP on OS X

Customize PHP - Not Required for basic eZ Publish Functionality

Working close to the metal, OS X is not much different than any other unix-linux. Like any distro, the paths are the biggest difference. Apple adds "user friendly" for their own users on top. They do this without taking anything away from "user friendly" for cli types.

If custom php versions are needed to meet requirements, http://ez.no/ezpublish/requirements, install Xcode tools from the install DVD for OS X Server, then start here.. http://www.opensource.apple.com/source/apache_mod_php/

Also, Marc Liyanage at Entropy.ch packages a compiled php for OS X which includes many popular extensions not included in a default install. http://www.entropy.ch/software/macosx/php/

For testing compiles, particularly as php transitions to version 6, OS X Server provides a nice interface for switching.

Essentially a pretty face wrapping Dynamic Shared Objects Support in httpd.conf.

To use custom php extensions without re-compiling php, Apache 2.2 on OS X (like most distro's) supports dynamic loading of php extensions via php.ini.

  • Find or compile the binary for the extension, make, make install. The gcc tools are included with Xcode.
  • Put the binary in the php extensions directory.
  • Edit /etc/php.ini to load the extension automatically, the instructions for this are in the heavily commented php.ini file
  • Restart the Web Service using the "Stop Web", "Start Web" toggle in Server Admin

Or cli, "apachectl restart" will do the trick. No need to load the Server Admin tool just to restart apache if you are already at the command line. Use what you know.

Thanks for reading.

This article is available in PDF for offline reading : Install eZ Publish 4.3 on Apple Snow Leopard Server - PDF Version

 

About the author : Doug Brethower

Doug is Apple ACTC Server certified, blogs at http://www.ipliance.com. Experienced in 3gl and open source. Believes CMS, the Web, and mobile devices are key to 5gl interfaces.