Article

eZ publish 3.1: Take It For A Spin

Page: 1 2 3 4 5 Next

Building The Site

Let's get started. I'm going to assume that, like me, you don't know much PHP, but that you aren't afraid to code from scratch, nor to modify existing code. I'm also going to assume that you’ll try out eZ publish on your own computer (self-hosting), under Windows NT/2000/XP, as this is the system I used. If you're running 95/98/Me, the process is similar.

I’ll also assume you're not running any other Web server, such as IIS, on your machine. If you are, you should disable it. If you’re not sure, open a browser and visit http://localhost -- if you get a network error, then you don’t have a local Web server running.

Thankfully, the folks at eZ Systems have provided an installer that automates the setup and install processes associated with eZ publish and the various open source technologies that support it, including Apache, MySQL, and PHP. This is a godsend -- you can get going very quickly. And if you screw anything up royally, you can always uninstall and reinstall the product quickly and easily.

Note also that I've provided for your use a code archive that contains all the files we'll work on in this tutorial.

Installing eZ publish 3.1 for Local Hosting

  1. Go to the eZ publish 3 release page. Click "Windows 2000/NT/XP Installer" under "eZ publish 3.1 installers" and download the .EXE that's there. Note that it's 20+ mg.

  2. Run the EXE that you downloaded. A fairly standard setup will run, with fairly standard questions. This setup will install the Apache Web Server, PHP 4, and eZ publish.

  3. Open a Web browser and enter the link http://localhost/index.php. You should see the default demo site generated by eZ publish.

  4. If you want Apache to automatically serve the root of your eZ publish site without the "/index.php" part, open the "httpd.conf" files under the "C:\Program Files\eZ systems\apache\conf” directory (assuming you accepted the default installation directory). Now change the "DirectoryIndex" line entry to "DirectoryIndex index.html index.php". Lastly, stop and start the "Apache" service, or reboot your system.

  5. eZ publish is now up and running. You can access the page by visiting http://localhost/index.php or access the administration page at http://localhost/index.php/admin. The administrative user is "admin" and the password is "publish" (no quotes).

Essentially, every browser is supported, as the system produces straight, dynamically generated HTML.

Check out the example from the content side (http://localhost/index.php), and you’ll quickly get an idea of how powerful this tool is. There's a nice three-column news headline page (note that "news," "corporate," "intranet," are essentially the same), the online shop, a gallery, and a forum section. If you don't like the layout, organization, or color choices, of the sample site, don't panic -- you can change almost everything.

I'm not going to spend too much time on organizing content; instead, we're going to focus on making the Website look the way you want. Check out the eZ publish users' guide for details on how to add, modify, and delete content.

A Quick Directory Tour

It's important to understand the directory structure of eZ publish. Under the directory where you installed eZ publish (typically "C:\Program Files\eZ systems\ezpublish”), you’ll find a number of directories. The ones that you'll be working in are "design" and "settings" -- keep out of the others.

The "design" directory is the most important -- most of you work goes on in here. This directory contains the files that specify how your Website looks.

The "settings" directory contains the files that control the behavior of eZ publish. You'll make occasional visits to this area.

Turn off the Cache

eZ publish generates pages dynamically. In other words, when you ask for a page, it does a bunch of database queries and generates the HTML Web page when the visitor requests it. This is one of the reasons that eZ publish Web pages take longer to load -- the system needs to figure out what to show you. In order to speed this up, eZ publish "caches" pages that it has made recently, in case somebody else asks for them. After all, it doesn't make much sense to dynamically render the same front page over and over and over again. Essentially, eZ publish takes a snapshot of the page it generates, and when somebody asks for it next, it just sends the snapshot.

Normally, this works just great -- Websites really don't change all that quickly, and caching greatly enhances performance. However, as you build the site, you're going to be changing it a lot. So it’s best to disable this cache thing until you're happy with your site.

Turning Off the View Cache

  1. Go to the directory where eZ publish was installed. Typically, this is "C:\Program Files\eZ systems" if you went with the default installation. Look in the "ezpublish\settings" subdirectory for a file called "site.ini" For future reference, in this article, I'll give the path to this file as "[Install]\ezpublish\settings\site.ini”

  2. Open this file in a text editor, and search for an entry "ViewCaching=enabled" -- change it to "ViewCaching=disabled" (no quotes).

  3. Verify that caching is off. Go to the admin interface at http://localhost/index.php/admin . Log in as user "admin" password "publish" (no quotes). Click on the "Set Up" tab at the top of the admin interface, and then "Cache" on the left hand side. You should see "View cache is disabled." under "Content view cache.”

If you liked this article, share the love:
Print-Friendly Version Suggest an Article

Sponsored Links