eZ publish 3 安装指南
---------------------
这个文档包括如何安装eZ publish 3到windows,Linux和freeBSD的快速安装指南。

请吧有关这个安装文件的反馈和有关eZ publish 3的反馈发送到 beta@ez.no

要得到更多的eZ publish 3文档:
http://ez.no/sdk
http://ez.no/manual

离线的文档请参看:
http://yourhost/index.php/sdk
http://yourhost/index.php/manual

http://yourhost/sdk
http://yourhost/manual


内容
----
1. eZ publish 3 需求
2. eZ publish 在Linux和FreeBSD上安装
2.1 数据库设置
2.1.1 MySQL
2.1.2 PostgeSQL
2.2 演示数据
2.3 配置eZ publish
2.4 虚拟主机设置
3. eZ publish 在Windows上安装
3.1 数据库设置
3.1.1 MySQL
3.2 演示数据
3.3 配置eZ publish
3.4 虚拟主机安装



1. eZ publish 3 需求
--------------------
- PHP >= 4.2.3 版本
http://www.php.net
- Apache 1.3 (apache 2.0 可/不可运行)
http://www.apache.org
- MySQL或PostgreSQL数据库
http://www.mysql.org
http://www.postgresql.org
- ImageMagick 和/或 GD编译的PHP版本用于图像转换(不需要)
http://www.imagemagick.org

这些程序的安装在他们各自的主页上都有详细的文档,因此我这里将不介绍。



2. 在Linux和FreeBSD安装eZ publish
---------------------------------
1. 解压缩文件ezpublish-xxx.tar.gz到<httproot>目录
$ tar xvfz ezpublish-xxx -C <httproot>
2. $ cd <httproot>/ezpublish-xxx/
3. $ bin/modfix.sh


2.1 数据库设置
--------------
2.1.1 MySQL
我们需要登录,建立一个新数据库,赋予用户权限并加入一个数据库。

1. $ mysql -u root -p <password>
2. 你现在应该在mysql> 提示符下
mysql> create database <name_of_database>;
3. mysql> grant all on <name_of_database>.* to <user>@localhost identified by '<password>';
(这个命令将同样建立制定的用户并附加相关的权限。)
4. 如果你不想演示数据:
$ 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

如果你想要演示数据:
$ 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/demodata.sql

2.1.2 PosgreSQL
我们需要登录,建立一个新数据库,赋予用户权限并加入一个数据库。

1. $ su <postgres_super_user>
2. $ createuser <user>
3. $ createdb <name_of_database>
4. 如果你不想演示数据:
4. $ 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

如果你想要演示数据:
现在PostgreSQL没有演示数据。


2.2 演示数据
-------------
演示数据仅仅在MySQL数据库中有,在你处理前,请确认你已经安装了demodata.sql文件
要安装所有的演示数据,你还要打开var.tgz数据包:

1. $ cd <httproot>/ezpublish-xxx/
2. $ tar xfvz var.tgz
3. $ bin/modfix.sh


2.3 配置eZ publish
------------------
用你喜欢的编辑器打开<httproot>/ezpublish-xxx/settings/site.ini,设置正确的[DatabaseSettings]段落.
(除了直接使用这个文件,你可以建立一个文件名叫<httproot>/ezpublish-xxx/settings/override.site.ini.append
Here you can override settings in site.ini,仅仅添加你需要的部分.)你需要选择你想用的数据库参数,数据库主机名字,用户名,口令和数据库名字等。

[DatabaseSettings]
# 使用ezmysql 或者 ezpostgresql
DatabaseImplementation=ezpostgresql
# 需要连接的数据库服务器名字
Server=localhost
# 数据库用户名字
User=<user>
# 数据库用户口令
Password=<password>
# 在以前步骤中你建立的数据库名字
Database=<name_of_database>


2.4 虚拟主机设置
----------------
你可使用虚拟主机设置的方式使用eZ publish。当使用虚拟主机的时候,你不需要特别指定URL中的index.php。下边就是一个虚拟主机设置的例子。把这些放置到apache的配置文件中,然后重新启动apache即可。

<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. 在Windows上安装eZ publish
----------------------------
1. 解压缩ezpublish-xxx.tar.gz到<httproot>目录
使用一个支持文件类型.tar.gz程序,比如Winzip。
2. 到目录<httproot>/ezpublish-xxx
3. 确认目录var/cache/ini存在,如果不存在建立它!


3.1 数据库设置
--------------
3.1.1 MySQL
我们需要登录,建立一个新数据库,然后赋予一个用户权限并插入数据库

1. 打开windows的控制台(根据你的windows版本,选择:开始->运行->cmd.exe 或 开始->运行->command.exe)
2. 到你的mysql目录找到mysql.exe文件(应该在bin/目录下)
2. 运行: mysql.exe -u root -p <mysql口令>
3. 你现在应该在mysql>提示符下,输入下面的语句:
mysql> create database <name_of_database>;
4. mysql> grant all on <name_of_database>.* to <user>@localhost identified by '<口令>';
(这个命令将同样建立制定的用户并附加相关的权限。)
5. 如果你不需要演示数据:
$ 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
如果你需要演示数据:
$ 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/demodata.sql

译者注:可选择phpmyadim工具,这是一个更方便的管理mysql的PHP工具。

3.2 演示数据
-------------
演示数据仅仅对于mysql数据库有,在你处理下面的步骤之前,你需要确认你安装的数据库是安装的demodata.sql而不是cleandata.sql文件。
要安装所有的演示数据,你还需要做最后一个步骤:
1. 到<httproot>/ezpublish-xxx目录
2. 解压缩var.tgz到<httproot>/ezpublish-xxx


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