eZ publish 3 installation guide
-------------------------------

This document contains a quick guide on how to install
eZ publish 3 on Windows, Linux and FreeBSD.

Please send feedback on this installation document
and on eZ publish 3 to beta@ez.no


For more eZ publish 3 docmentation see:
http://ez.no/sdk
http://ez.no/manual

The documentation is also available offline, try:
http://yourhost/index.php/sdk
http://yourhost/index.php/manual
or
http://yourhost/sdk
http://yourhost/manual


Contents
--------
1. eZ publish 3 requirements
2. eZ publish installation on Linux and FreeBSD
   2.1 Database setup
     2.1.1 MySQL
     2.1.2 PostgeSQL
   2.2 Demo data
   2.3 Configure eZ publish
   2.4 Virtualhost setup
3. eZ publish installation on Windows
   3.1 Database setup
     3.1.1 MySQL
   3.2 Demo data
   3.3 Configure eZ publish
   3.4 Virtualhost setup



1. eZ publish 3 requirements
----------------------------
- PHP >= 4.2.3
  http://www.php.net
- Apache 1.3 (apache 2.0 might/might not work)
  http://www.apache.org
- Either MySQL or PostgreSQL
  http://www.mysql.org
  http://www.postgresql.org
- ImageMagick and/or GD compiled in PHP for image conversion (not required)
  http://www.imagemagick.org

The installation process for the above programs are very well documented
on their homepage, so I will not include that here.



2. eZ publish installation on Linux and FreeBSD
-----------------------------------------------
1. Unpack ezpublish-xxx.tar.gz into the <httproot> folder
   $ tar xvfz ezpublish-xxx -C <httproot>
2. $ cd <httproot>/ezpublish-xxx/
3. $ bin/modfix.sh


2.1 Database setup
------------------
2.1.1 MySQL
We need to login, create a new database, grant permissions to a user and
insert a database.

1. $ mysql -u root -p <password>
2. You should now have have a mysql> prompt
   mysql> create database <name_of_database>;
3. mysql> grant all on <name_of_database>.* to <user>@localhost identified by '<password>';
   (This command will also create the specified user, in addition to granting permissions.)
4. Install the definitions and basic data.
   $ mysql -u<user> -p<password> <name_of_database> < <httproot>/ezpublish-xxx/kernel/sql/mysql/kernel_schema.sql
   $ mysql -u<user> -p<password> <name_of_database> < <httproot>/ezpublish-xxx/kernel/sql/mysql/cleandata.sql

2.1.2 PosgreSQL
We need to login, create a new database, grant permissions to a user and
insert a database.

1. $ su <postgres_super_user>
2. $ createuser <user>
3. $ createdb <name_of_database>
4.
   To be able to run ezpubish on postgresql you need to have "digest" function from pgcrypto contribution
   from postgresql-contrib pakage.If you don't have it you need to install postgresql-contrib rpm pakage and to
   run command on your database:

   psql -U<user> <name_of_database> < /usr/share/pgsql/contrib/pgcrypto.sql

5. Install the definitions and basic data.
   $ psql -U<user> <name_of_database> < <httproot>/ezpublish-xxx/kernel/sql/postgresql/kernel_schema.sql
   $ psql -U<user> <name_of_database> < <httproot>/ezpublish-xxx/kernel/sql/postgresql/cleandata.sql


2.2 Demo data
-------------
The demo data is no longer available as an SQL file, the reason for
this is that it has been split up into several packages each with
it own set of settings. Currently you have use the web based setup
to get these packages.


2.3 Configure eZ publish
------------------------
Open <httproot>/ezpublish-xxx/settings/site.ini with your favourite editor
and set the correct setting in the [DatabaseSettings] section.
(Instead of using this file, you can create a file called
<httproot>/ezpublish-xxx/settings/override/site.ini.append
Here you can override settings in site.ini. Add only the parts you need.)
You need to select what database implementation you would like to use,
hostname of database server to connect to, username, password
and database name.

[DatabaseSettings]
# Use either ezmysql or ezpostgresql
DatabaseImplementation=ezpostgresql
# Name of server to connect to
Server=localhost
# DB user name
User=<user>
# DB Password
Password=<password>
# database name you have created on previous step
Database=<name_of_database>


2.4 Virtualhost setup
---------------------
You can use eZ publish with a virtualhost setup. When using
a virtualhost you don't need to specify the index.php in the URL.
Below is a sample configuration for virtualhost setup. Include this in
your apache config file and restart apache when you are done.

<VirtualHost 10.0.0.1>
 <Directory <httproot>/ezpublish-xxx/>
       Options FollowSymLinks Indexes ExecCGI
       AllowOverride None
  </Directory>

  RewriteEngine On
  RewriteRule !\.(gif|css|jpg|png)$ <httproot>/ezpublish-xxx/index.php

  ServerAdmin root@localhost
  DocumentRoot <httproot>/ezpublish-xxx/
  ServerName 10.0.0.1
</VirtualHost>



3. eZ publish installation on Windows
-------------------------------------
1. Unpack ezpublish-xxx.tar.gz into the <httproot> folder.
Use a program that supports .tar.gz files, like Winzip.
2. goto <httproot>\ezpublish-xxx
3. Make sure the directory var\cache\ini exists, if not, create it.


3.1 Database setup
------------------
3.1.1 MySQL
We need to login, create a new database, grant permissions to a user
and insert a database.

1. Open a console window (start->run->cmd.exe or start->run->command.exe depending on the windows version)
2. Goto your the location of mysql and find the mysql.exe file (should be under bin\)
2. Run: mysql.exe -u root -p <your_mysql_password>
3. You should now have have a mysql> prompt. Type these to mysql statements:
   mysql> create database <name_of_database>;
4. mysql> grant all on <name_of_database>.* to <user>@localhost identified by '<password>';
   (This command will also create the specified user, in addition to granting permissions.)
5. Install the definitions and basic data.
   $ mysql.exe -u<user> -p<password> <name_of_database> < <httproot>\ezpublish-xxx\kernel\sql\mysql\kernel_schema.sql
   $ mysql.exe -u<user> -p<password> <name_of_database> < <httproot>\ezpublish-xxx\kernel\sql\mysql\cleandata.sql

3.2 Demo data
-------------
The demo data is no longer available as an SQL file, the reason for
this is that it has been split up into several packages each with
it own set of settings. Currently you have use the web based setup
to get these packages.


3.3 Configure eZ publish
------------------------
Open <httproot>/ezpublish-xxx/settings/site.ini in notepad and set
the correct settings in the [DatabaseSettings] section.
You need to set what database implementation you use, hostname of database
server to connect to, user name, password, database name.
(Instead of using this file, you can create a file called
<httproot>/ezpublish-xxx/settings/override/site.ini.append
Here you can override settings in site.ini. Add only the parts you need.)

[DatabaseSettings]
# Use either ezmysql or ezpostgresql
DatabaseImplementation=ezpostgresql
# Name of server to connect to
Server=localhost
# DB user name
User=<user>
# DB Password
Password=<password>
# database name you have created on previous step
Database=<name_of_database>


3.4 Virtualhost setup
---------------------
You can use eZ publish with a virtualhost setup. When using
a virtualhost you don't need to specify the index.php in the URL.

Make sure these lines exists in your apache configfile and is not commented out:
 LoadModule rewrite_module modules/mod_rewrite.so
 AddModule mod_rewrite.c

Below is a sample configuration for virtualhost setup. Include this in
your apache config file and restart apache when you are done.

<VirtualHost <your_ip_adress>>
 <Directory <httproot>/ezpublish-xxx/>
       Options FollowSymLinks Indexes ExecCGI
       AllowOverride None
  </Directory>

   RewriteEngine On
   RewriteRule !\.(gif|css|jpg|png|jar)$ <httproot>ezpublish-xxx/index.php

  ServerAdmin root@localhost
  DocumentRoot <httproot>/ezpublish-xxx/
  ServerName <your_ip_adress>
</VirtualHost>



That's it,

Enjoy!

- eZ publish team

