Mailing List Archive

Integrating Bricolage with an existing Apache installation
Dear all,

I have successfully installed the current Bricolage version. I need to integrate it with an existing
Apache 2 instllation, which uses vhosts. I have added a new vhost (below), which has enabled me to
log in to Bricolage. The vhost definition came from setting manual apache config in the bricolage
config file, and copying the vhost created by Bricolage.

I am left a little confused as to how I am expecting content to be served. I know the burner will
write the HTML files and put them on the filesystem, which would imply static serving. But the vhost
specifies a bricolage directory full of code as the document root, which would imply dynamic serving.

Q: What directory should I be using as the Document Root of the Server in the Destination in Bricolage?
Q: How am I expecting Apache to know where to find it?

I have a bunch of other questions, but hopefully knowing the answer to these two should help me work
out the others. Thanks for the help!

vhost definition:

1 PerlModule Bric::App::ApacheConfig
2 <VirtualHost 80.68.91.57:80>
3 DocumentRoot /usr/local/bricolage/comp
4 ServerName www.gibbs-family.org.uk
5 DefaultType "text/html; charset=utf-8"
6 AddDefaultCharset utf-8
7 SetHandler modperl
8 PerlResponseHandler Bric::App::Handler
9 PerlAccessHandler Bric::App::AccessHandler
10 PerlCleanupHandler Bric::App::CleanupHandler
11 PerlOptions +GlobalRequest
12 RedirectMatch permanent .*\/favicon\.ico$
http://www.gibbs-family.org.uk/media/images/bricicon.ico
13 TraceEnable off
14 PerlTransHandler Bric::App::PreviewHandler::uri_handler
15 <Location /logout>
16 PerlAccessHandler Bric::App::AccessHandler::logout_handler
17 PerlCleanupHandler Bric::App::CleanupHandler
18 </Location>
19 <Location /login>
20 SetHandler modperl
21 PerlAccessHandler Bric::App::AccessHandler::okay
22 PerlResponseHandler Bric::App::Handler
23 PerlCleanupHandler Bric::App::CleanupHandler
24 </Location>
25 <Location /media>
26 SetHandler default-handler
27 PerlAccessHandler Apache2::Const::OK
28 PerlCleanupHandler Apache2::Const::OK
29 </Location>
30 <Location /media/js>
31 ForceType "text/javascript; charset=utf-8"
32 </Location>
33 <Location /media/css>
34 ForceType "text/css"
35 </Location>
36 <Location /data>
37 SetHandler default-handler
38 </Location>
39 <Location /soap>
40 SetHandler modperl
41 PerlResponseHandler Bric::SOAP::Handler
42 PerlAccessHandler Apache2::Const::OK
43 </Location>
44 <Location /dist>
45 SetHandler modperl
46 PerlResponseHandler Bric::Dist::Handler
47 </Location>
48 <Location /data/preview>
49 ExpiresActive On
50 ExpiresDefault "now plus 0 seconds"
51 PerlFixupHandler Apache2::Const::OK
52 </Location>
53 ErrorLog /var/log/apache2/gforguk-error.log
54
55 # Possible values include: debug, info, notice, warn, error, crit,
56 # alert, emerg.
57 LogLevel warn
58
59 CustomLog /var/log/apache2/gforguk-access.log combined
60 ServerSignature On
61 </VirtualHost>

--
Regards,
--
Ian Gibbs
ian@flash.org.uk
Mon - Wed: +31 (0) 629 202752
Thu - Sun: +44 (0) 7815 142001
Re: Integrating Bricolage with an existing Apache installation [ In reply to ]
Hi Ian,

Bricolage is all about managing and publishing the content, not serving it. So you're right, it expects to put the finished files (HTML, PHP, etc.) either locally on the filesystem or on a remote server.

> Q: What directory should I be using as the Document Root of the Server in the Destination in Bricolage?

If the burner is writing files locally, put in a path (e.g. /usr/local/www/mypublishedsite.com).

You can then point an Apache vhost's document root to this same path (see next question)

> Q: How am I expecting Apache to know where to find it?

The vhost you have set up (with all the Bricolage code in it) is for serving up the CMS itself. You'll need to set up a separate vhost for the "real" public site with all the content Bricolage is churning out.

After coming from Wordpress/Movable Type, I remember this being a confusing point when I started with Bricolage. The CMS is its own site and whatever it publishes is its own site.

Hope this helps,
--Greg


===
Greg Heo
web and software developer
416.826.7630
http://node79.com
Re: Integrating Bricolage with an existing Apache installation [ In reply to ]
Thanks Greg. That makes sense.

Two follow-on questions, then:

(1) I'd like to serve the content using the same vhost as bricolage (using a different one will
require me to consume another domain name. I see the /login location in the vhost. If I change the
document root for the vhost to be that for the site, will that break Bric in any way?

If I take out

DocumentRoot /usr/local/bricolage/comp

is that a problem? I can foresee the Perl*Handler directives giving me some problems integrating
with other perl content on the site. I imagine I would have to replace it with an Alias directive in
each Location

(2) What strategies do users have for automatically linking the static content from new stories? If
a create a new page, I want it to be linked somewhere automatically. I understand that this is where
we blur the line between blogging and CMS, but I can't imagine the Bric admins everywhere are
manually linking new pages. It would somewhat ruin the CMS approach.

Regards,
--
Ian Gibbs
ian@flash.org.uk
Mon - Wed: +31 (0) 629 202752
Thu - Sun: +44 (0) 7815 142001

On 11/03/11 14:17, Greg Heo wrote:
> Hi Ian,
>
> Bricolage is all about managing and publishing the content, not serving it. So you're right, it expects to put the finished files (HTML, PHP, etc.) either locally on the filesystem or on a remote server.
>
>> Q: What directory should I be using as the Document Root of the Server in the Destination in Bricolage?
>
> If the burner is writing files locally, put in a path (e.g. /usr/local/www/mypublishedsite.com).
>
> You can then point an Apache vhost's document root to this same path (see next question)
>
>> Q: How am I expecting Apache to know where to find it?
>
> The vhost you have set up (with all the Bricolage code in it) is for serving up the CMS itself. You'll need to set up a separate vhost for the "real" public site with all the content Bricolage is churning out.
>
> After coming from Wordpress/Movable Type, I remember this being a confusing point when I started with Bricolage. The CMS is its own site and whatever it publishes is its own site.
>
> Hope this helps,
> --Greg
>
>
> ===
> Greg Heo
> web and software developer
> 416.826.7630
> http://node79.com
>
Re: Integrating Bricolage with an existing Apache installation [ In reply to ]
Actually - skip question 1. I'll point a different name in the domain other than www to Bric, and
then use www for the site.

Regards,
--
Ian Gibbs
ian@flash.org.uk
Mon - Wed: +31 (0) 629 202752
Thu - Sun: +44 (0) 7815 142001

On 11/03/11 15:06, Ian Gibbs wrote:
> Thanks Greg. That makes sense.
>
> Two follow-on questions, then:
>
> (1) I'd like to serve the content using the same vhost as bricolage (using a different one will
> require me to consume another domain name. I see the /login location in the vhost. If I change the
> document root for the vhost to be that for the site, will that break Bric in any way?
>
> If I take out
>
> DocumentRoot /usr/local/bricolage/comp
>
> is that a problem? I can foresee the Perl*Handler directives giving me some problems integrating
> with other perl content on the site. I imagine I would have to replace it with an Alias directive in
> each Location
>
> (2) What strategies do users have for automatically linking the static content from new stories? If
> a create a new page, I want it to be linked somewhere automatically. I understand that this is where
> we blur the line between blogging and CMS, but I can't imagine the Bric admins everywhere are
> manually linking new pages. It would somewhat ruin the CMS approach.
>
> Regards,
> --
> Ian Gibbs
> ian@flash.org.uk
> Mon - Wed: +31 (0) 629 202752
> Thu - Sun: +44 (0) 7815 142001
>
> On 11/03/11 14:17, Greg Heo wrote:
>> Hi Ian,
>>
>> Bricolage is all about managing and publishing the content, not serving it. So you're right, it
>> expects to put the finished files (HTML, PHP, etc.) either locally on the filesystem or on a
>> remote server.
>>
>>> Q: What directory should I be using as the Document Root of the Server in the Destination in
>>> Bricolage?
>>
>> If the burner is writing files locally, put in a path (e.g. /usr/local/www/mypublishedsite.com).
>>
>> You can then point an Apache vhost's document root to this same path (see next question)
>>
>>> Q: How am I expecting Apache to know where to find it?
>>
>> The vhost you have set up (with all the Bricolage code in it) is for serving up the CMS itself.
>> You'll need to set up a separate vhost for the "real" public site with all the content Bricolage
>> is churning out.
>>
>> After coming from Wordpress/Movable Type, I remember this being a confusing point when I started
>> with Bricolage. The CMS is its own site and whatever it publishes is its own site.
>>
>> Hope this helps,
>> --Greg
>>
>>
>> ===
>> Greg Heo
>> web and software developer
>> 416.826.7630
>> http://node79.com
>>
Re: Integrating Bricolage with an existing Apache installation [ In reply to ]
> Actually - skip question 1. I'll point a different name in the domain other than www to Bric, and then use www for the site.

That's the way to do it; otherwise you would have set off all kinds of "don't do it!" emails from the list :)

> (2) What strategies do users have for automatically linking the static content from new stories? If a create a new page, I want it to be linked somewhere automatically. I understand that this is where we blur the line between blogging and CMS, but I can't imagine the Bric admins everywhere are manually linking new pages. It would somewhat ruin the CMS approach.

If you're thinking automated index pages (showing all blog posts, the three most recent posts, etc.) that would probably be best handled in a separate story type and template. It would generally work like this:

- Someone posts a new blog entry
- When the blog entry template is finished publishing, it triggers a publish job on the blog index
- The blog index republishes both an HTML page and a HTML snippet that gets included (PHP/SSI include or something like that) on a bunch of existing pages

The blog index is now updated with the latest entry. Many other pages on your site also get updated with links to the new content thanks to the include.

I thought there's some more sample template code somewhere either in the wiki or in the documentation but I can't seem to find it. Here's a helpful page on templates and elements if you haven't seen it already:

http://bricolagecms.org/docs/current/api/Bric::Templates


===
Greg Heo
web and software developer
416.826.7630
http://node79.com
Re: Integrating Bricolage with an existing Apache installation [ In reply to ]
OK thanks. I'll get the basics working first and then look into that subsequently.

Regards,
--
Ian Gibbs
ian@flash.org.uk
Mon - Wed: +31 (0) 629 202752
Thu - Sun: +44 (0) 7815 142001

On 11/03/11 16:30, Greg Heo wrote:
>> Actually - skip question 1. I'll point a different name in the domain other than www to Bric, and then use www for the site.
>
> That's the way to do it; otherwise you would have set off all kinds of "don't do it!" emails from the list :)
>
>> (2) What strategies do users have for automatically linking the static content from new stories? If a create a new page, I want it to be linked somewhere automatically. I understand that this is where we blur the line between blogging and CMS, but I can't imagine the Bric admins everywhere are manually linking new pages. It would somewhat ruin the CMS approach.
>
> If you're thinking automated index pages (showing all blog posts, the three most recent posts, etc.) that would probably be best handled in a separate story type and template. It would generally work like this:
>
> - Someone posts a new blog entry
> - When the blog entry template is finished publishing, it triggers a publish job on the blog index
> - The blog index republishes both an HTML page and a HTML snippet that gets included (PHP/SSI include or something like that) on a bunch of existing pages
>
> The blog index is now updated with the latest entry. Many other pages on your site also get updated with links to the new content thanks to the include.
>
> I thought there's some more sample template code somewhere either in the wiki or in the documentation but I can't seem to find it. Here's a helpful page on templates and elements if you haven't seen it already:
>
> http://bricolagecms.org/docs/current/api/Bric::Templates
>
>
> ===
> Greg Heo
> web and software developer
> 416.826.7630
> http://node79.com
>