Zucchini

 view release on metacpan or  search on metacpan

lib/Zucchini/Manual/Tutorial.pod  view on Meta::CPAN

# PODNAME: Zucchini::Manual::Tutorial
# ABSTRACT: simple website example

__END__

=pod

=encoding UTF-8

=head1 NAME

Zucchini::Manual::Tutorial - simple website example

=head1 VERSION

version 0.0.21

=head1 DESCRIPTION

This tutorial will guide you through the process of setting up a simple
website using Zucchini.

=head1 NAME

Zucchini::Manual::Tutorial - simple website example

=head1 ASSUMPTIONS

For the purposes of this tutorial it is assumed that you have a user on your
system with the username C<zuke>.

C<zuke> is assumed to have never run C<zucchini> before.

C<zuke> should have sudo super-powers for the initial directory configuration.

=head1 SETTING UP

=head2 Local Website Source

Firstly we will create the area in which the website templates are created.

  mkdir -p $HOME/sites/zuke/{templates,includes}

=head2 Local Website Output

We also require somewhere for the generated output to live. We'll keep our
(local) website sources somewhere easy to find, rather than hidden away in
C<zuke>'s home directory.

  sudo mkdir -p /var/www/zuke/{html,log}
  sudo chown -R zuke:www-data /var/www/zuke

=head2 Adding an apache2 virtualhost

This step is optional, but provides a convenient way to view and verify the
site before uploading it to the remote (live) server.

Configuring apache2 is beyond the scope of this tutorial.  In a nutshell, make
sure you are configured to use C<< <VirtualHost> >>s and add the following
block to your configuration:

  <VirtualHost www_zuke.private.somedomain.co.uk>
    ServerAdmin     zuke@localhost
    ServerName      www_zuke.private.somedomain.co.uk

    DocumentRoot    /var/www/zuke/html
    ErrorLog        /var/www/log/error_log
    CustomLog       /var/www/log/access_log common

    <Directory /var/www/zuke/html>
      Options Indexes FollowSymLinks MultiViews
      AllowOverride None
      Order allow,deny
      allow from all
    </Directory>
  </VirtualHost>

You'll also require a tweak to your local hosts file to recognise the hostname
used:

  sudo sh -c \
    'echo "127.0.1.77 www_zuke.private.somedomain.co.uk www_zuke" \
        >> /etc/hosts'

You should now restart apache2 for the changes to take effect.

=head3 Debian/Ubuntu

Debian/Ubuntu users can paste the VirtualHost block above into a new file in
/etc/apache2/sites-enabled/ and use C<a2ensite>:

  sudo $EDITOR /etc/apache2/sites-available/zuke
  # paste in VirtualHost block
  sudo a2ensite zuke
  sudo /etc/init.d/apache2 restart

=head2 Configuring Zucchini

It's possible to build a C<.zucchini> configuration file from scratch. Most
people find it easier to have a working example to copy and modify.

We'll start by creating a default configuration file, and ammend it to process
the new site we're building.

  zucchini --create-config

If all goes well, you will see no output on your screen. A new file should
have been written to your home directory:

  $ ls -l $HOME/.zucchini
  -rw-r--r-- 1 zuke zuke 1956 2008-05-20 08:39 /home/zuke/.zucchini



( run in 1.308 second using v1.01-cache-2.11-cpan-5511b514fd6 )