Forums / Install & configuration / SiteAccessSettings and ForceVirtualHost Configuration

SiteAccessSettings and ForceVirtualHost Configuration

Author Message

kracker (the)

Friday 27 May 2005 1:46:29 am

Greetings eZ publish Familiars,

<b>Knowing Is Half The Battle</b>

As I think about my use of eZ publish, I have always known that the proper way to use eZ publish in a production site is to use the <b>ForceVirtualHost=true</b> and <b>MatchOrder=host</b> settings configuration ( in <i>settings/override/site.ini.append</i> ) and use <b>ezroot</b> instead of <b>ezurl</b> in <b>all</b> of the templates in the <i>design/</i> folder.

After the first time of configuring eZ publish in this way you will never look back. It's simply gorgeous to the users who see nice urls ( just like the ones on ez.no! ) all without the <i>index.php</i> or <i>index.php/news</i> or <i>index.php/news_admin</i>

In my opinion it is the only way to use eZ publish, but it does require an investment of time to configure eZ publish to use these supported settings options.

<b>The Introduction, to my self destruction</b>

I'm <i>finally</i> writing to you today to tell you about a very serious problem that one day one of you will be affected by which you may or may not ever realize. I question not your capacity to find the problem only your tensity as I have spent the better half of today to trace it down for the second time. It's these kinds of experiences that can send you quickly through several waves of feeling really confused, frustrated, angry and then finally dumb. I hope these can be a lesson to another.

The first time was over 2 months ago, in another state and city. I spent the better half of a night tracing this problem down. I realized, after discovering this very same problem, yet again that I had resolved and documented the problem locally but failed to write publicly about it. I breath eZ publish and so its no sunrise that I forget more about eZ publish than some ever realize themselves ;) (re: ezurl and w3 xml validation *cough*). Well, I'm sure you can all relate to being so pressured by deadlines, requirements, life in general; that when your <i>exhausted</i> and have a good build, often follow up documentation on a problem can be <i>the last thing you think about</i> after you arise from a coma.

<b>The Problem</b>

I could not get any of my pages to load proper body content, in some cases loading the root node, in other cases nothing at all.

The issue resides with a single setting which if configured, used, expected must be set properly set.

<b>File:</b> <i>override/site.ini.append.php</i>
<b>Section:</b> <i>[SiteAccessSettings]</i>
<b>The Setting:</b> <i>ForceVirtualHost=true</i>

If the option <i>ForceVirtualHost=true</i> is not the set (ie: missing) or set to false in your <i>[SiteAccessSettings]</i> section / line <b>and</b> your using the <i>ezroot</i> template operator. Your eZ publish installation will fail in several very unpredictable ways.

The first and most prominent negative reaction to a mistake in this regard will be your site will appear to fail to find any design templates for the outputting of the <i>{$module_result.content}</i> output. In effect making all of your site's body ( produced by <i>{$module_result.content}</i> ) appear to have no content when the page is rendered (yes, even with all cache settings disabled and all debugging enabled).

<i>Don't make the same mistake I have several times over! Learn from my mistakes while you still can ... You have been warned!</i>

This problem affects every know version of eZ publish 3 ( that I've ever used ), specifically <i>v3.4 -> 3.5.2</i> running on Apache 2.0.x, php v4.3.4

<b>The Solution</b>

If your using <i>ezroot</i> for nice urls without the index.php and site design you <b>must</b> have <i>ForceVirtualHost=true</i>

your vigilant vigilante,
//kracker

<i>KoRn - Here To Stay</i>

Member since: 2001.07.13 || http://ezpedia.se7enx.com/

Gene Snider

Friday 27 May 2005 7:37:09 am

Kracker,

Thanks for the tip, I will check this out today. I also agree that host configuration is the only way to have professional looking URLs such as www.foo.com and admin.foo.com. I actually never got a chance to look back since when I started with ezpublish that was the only way to configure sites.

The site wizard on 3.5.2 does not seem to set this up properly I was going to investigate this and whine about it today. You may have saved me a great deal of time and trouble. Although if your fix works I'll still whine...

The need for an index.php designation can also be eliminated ( at least with Apache on Linux ) by tuning the Apache configuration. Add this line to the php.conf in http/conf.d/php.conf ( or add index.php to the DirectorIndex value base httpd.conf file for older versions ).

DirectoryIndex index.php

This will cause apache to load index.php if it exists. Note that if you have multiple entries for DirectoryIndex it will look for them in order so if you directory is cluttered with manually created index files they might be selected first.