OpenERP服务器安装

The OpenERP Server 6.0 installation works with disks formatted in NTFS (not a FAT or FAT32 partition). The following installation procedure has been well-tested on Windows 7.

注解

Windows 版本

OpenERP服务器不行运行于Windows 98或者ME;原因很显然,这些版本不能用NTFS格式化。

你需要一个运行的PostgreSQL服务器。如果没有,你可以阅读PostgreSQL服务器安装和配置部分 PostgreSQL 数据库安装与配置

下载 OpenERP 服务器

OpenERP服务器可以从OpenERP网站下载页面下载 [http://www.openerp.com/downloads](http://www.openerp.com/downloads)\`_.

Under Windows Auto-Installer, choose Server to download the OpenERP Server standalone.

安装 OpenERP 服务器

执行已下载的安装文件,其包含以下步骤:

    1. 选择安装语言

      默认是 English。其它选项有 French。

    1. 欢迎信息

      仔细遵循这步给出的的建议。

    1. 许可协议

      你要接受GNU公共许可证才能进行安装,这很重要。

    1. 选择安装目录

      By default, OpenERP Server is installed in C:\Program Files\OpenERP 6.0\Server. To install in a different folder, browse for a different location(folder) in this step.

    1. 配置 PostgreSQL 连接

      安装包将建议默认参数,完成你的PostgreSQL链接配置。你可以接受默认配置或者按照你的需要变更。

  1. [![/doc_static/6.0/_images/s5_config_postgres.png](/projects/openerp-developer-6.0-zh/88cc920d94e3286dbc5393fefddaec3c.png)](https://doc.odoo.com/doc_static/6.0/_images/s5_config_postgres.png)
  2. *PostgreSQL 配置*
    1. 生成快捷

      在’开始’ 菜单选择你要创建的程序快捷链接的目录

  1. [![/doc_static/6.0/_images/s6_shortcuts.png](/projects/openerp-developer-6.0-zh/665a059f6933cb0bd689a15b0d6c19cf.png)](https://doc.odoo.com/doc_static/6.0/_images/s6_shortcuts.png)
  2. *生成开始菜单快捷*
    1. 安装

      在自动安装开始后,你可以查看他的进程。

    1. 完成

      OpenERP Server安装成功后,你会看到确认界面,点击”结束(Finish)”关闭安装向导。

  1. [![/doc_static/6.0/_images/Openerp_server_finish_install.png](/projects/openerp-developer-6.0-zh/56219eb5e183f6b22f722d0f9986ea24.png)](https://doc.odoo.com/doc_static/6.0/_images/Openerp_server_finish_install.png)
  2. *结束安装向导*

OpenERP Server会安装作为Windows的服务。也就是说你不需要在每次电脑启动后再去启动OpenERP Server服务,它会自动运行而不用占用一个用户会话。

定制配置

为了初始化新的配置,必须在命令提示符下用你期望的选项覆盖默认值来执行。

Navigate to the installation directory in C:\Program Files\OpenERP 6.0\Server\ and type this command but do not execute it yet:

  1. openerp-server.exe -d <db_name> -r <db_user> -w <db_password>
  2. --db_host=<postgresql_server_address>
  3. --db_port=<port_no> --logfile="<logfile>"

安装OpenERP Server 要提供必须的信息以连接PostgreSQL数据库。下面是这些选项的说明:

  • -d : 为OpenERP Server创建的数据库名称。

  • -r : PostgreSQL的用户(角色)名。

  • -w `` : PostgreSQL用户的密码。

  • --db_host= : PostgreSQL 服务器的地址。如果你在OpenERP Server的同一台电脑安装了PostgreSQL,你可以输入``localhost``,否则就输入网络上安装PostgreSQL的服务器IP地址或者服务器名称。

  • --db_port= :PostgreSQL 监听的端口号。默认是5432。

  • --stop-after-init :这个选项会在安装后停止服务。

  • --logfile=”“ : specify an alternate logfile where all the output of server will be saved. The default is C:\Program Files\OpenERP 6.0\Server\openerp-server.log.

在执行此命令前,你应当确定决定该数据库在OpenERP中的目的(用途)。

命令举例:

  1. openerp-server.exe -d openerpdemo -r openpg -w openpgpwd
  2. --db_host=localhost --logfile="C:\Users\tiny\Desktop\demo_db.log"
  3. --db_port=5430 --stop-after-init

当安装OpenERP服务器时,您必须输入在PostgreSQL连接配置中指定的用户名和密码。

在执行初始化命令的时候,如果您指定了一个日志文件,服务器运行时信息会写入到这个日志文件,您不会在提示窗口看到任何服务输出。您只有等到命令提示符再次出现。

决定数据库目的

您可以初始化OpenERP服务数据库用于:

  1. 看一下安装过的模块及其加载的演示数据。

  2. 创建一个最小化的帐套(不载入演示数据)

  3. 升级一个已存在的版本

指定安装模块及示例数据

如果你执行了上述相同的命令,你将得到一个只安装了基本模块并加载了演示数据的数据库。要用更多的模块及其演示数据初始化OpenERP服务,您需要增加这些选项到上面的命令中::

  1. -i <module name>

命令举例:

  1. openerp-server.exe -d openerpdemo --stop-after-init -i sale

这行名利将用 销售 及其相关联(依赖)的模块初始化OpenERP服务,并将他们相关的演示数据填入PostgreSQL数据库中。就像可以看到的那样,你必须指定安装这些模块的目标数据库。

要安装多个模块,可以在命令行中用逗号分隔的模块列表指定。

不带示例数据

以不包含演示数据的选项执行命令:

  1. --without-demo=all

该操作将载入基础模块(如果指定了 -i 选项的话,也会加载其他模块),但是不会加载演示数据。

实例命令用法:

  1. openerp-server.exe -d openerpdemo --stop-after-init --without-demo=all

如果你已经使用演示数据初始化了数据库,你可以新建一个数据库再执行上面的命令。

更新数据库

执行带选项的命令,更新数据结构:

  1. --update=all

实例命令用法:

  1. openerp-server.exe -d openerpdemo --stop-after-init --update=all

监控 OpenERP 服务器

服务和运行时信息可以通过管理工具中的计算机管理控制台查看。

/doc_static/6.0/_images/Openerp_service_mmc_terp_service.png

OpenERP Server 6.0 in the Services list

Here, you can define how the service should act in case of server failure. Access the service’s properties by double-clicking OpenERP Server 6.0 in the list.

/doc_static/6.0/_images/Openerp_service_mmc_control_actions.png

Recovery tab to set service failure response

计算机管理日志服务,提供了更多的OpenERP服务执行中的信息,例如,服务的启动或停止信息。

/doc_static/6.0/_images/Openerp_service_mmc_logs.png

Windows服务信息日志列表

OpenERP Server runtime output can be found in the default logfile. Given that the server is now running as a Windows service, it does not output any runtime messages. For this, the logfile is the only option. Access it from the Start menu, through the View log link in the group of shortcuts for OpenERP Server 6.0. Alternatively, use the path C:\Program Files\OpenERP 6.0\Server\openerp-server.log.

/doc_static/6.0/_images/log_file.png

OpenERP服务器日志文件

You can find out whether OpenERP Server is running by invoking Windows Task Manager. When you look at the Processes tab, you will see OpenERPServerService.exe and openerp-server.exe, both having SYSTEM as their user (to see these, Show processes from all users must be enabled in the Task Manager).

/doc_static/6.0/_images/Openerp_service_running.png

Windows任务管理器中的服务

恭喜,您的OpenERP Server已经安装成功啦!

更多信息,请参见 更多安装信息与问题解决。那里能够找到一些问题解决的实例。