在windows下安装redmine及相关问题

本文详细介绍了使用bitmami一键安装包部署Redmine的过程,并提供了解决安装过程中遇到的问题的方法,包括端口冲突、服务安装错误和数据库初始化等。通过手动配置数据库和修复配置文件,最终成功实现了Redmine的正常运行。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

转载注明出处,adousen的博客http://blog.youkuaiyun.com/adousen


redmine是一个ticket驱动项目管理工具,与trac等工具相比,它最大特色是可以在一个实例中同时管理多个项目。

安装和使用

  • 下载安装文件
    为了省去下载和配置的麻烦,没有选择redmine官方的安装文件,而是下载bitmami的一键安装包bitnami-redmine-2.6.0-1https://bitnami.com/stack/redmine,它的主要特色有:
    • 一键安装,无需配置数据库和初始化
    • 部署在apache上,更加灵活。
    • 集成了版本控制工具,git或subversion。
    • 将redmine注册为windows服务,可以自动启动。
    • 提供了一个简单的服务管理工具,方便启动和暂停服务。
    • 提供了一键卸载
  • 安装操作。根据项目情况,可以去掉以下组件:

    • 由于本机已经安装有mysql workbench,故不需要采用PhpMyAdmin的方式进行数据管理。因此,安装时去掉了PhpMyAdmin。
    • 由于项目打算采用git或mercury作为版本控制系统,因此去掉了Subversion。
  • 如果整个安装过程无异常,那么安装结束就已经启动了redmine,因此可以从http://localhost/redmine/访问。

安装过程中的问题

  • 问题1. 安装过程会提示端口3306被占用,原因是本机已经安装有mysql。因此,改为3305端口。
  • 问题2. 由于该版本的bitmami中的mysql安装脚本存在的BUG:scripts目录下的serviceinstall.bat中的有关安装Mysql服务的配置脚本处有一个不应该有的换行。因此,会导致"redmineMySQL" 的服务安装不成功。所以,后续的初始化等数据库相关操作等会报错。
    注:如果打算在本机上同时启动两个mysql服务,可以在mysql的scripts目录下找到serviceinstall.bat,修正这个BUG。当然这需要在安装报错之前。但是,对于没有经验的人来说,很难确保自己已经改对了,可以尝试复制下面的代码到serviceinstall.bat,并手动执行serviceinstall.bat INSTALL

(注意修改C:\Bitnami\redmine-2.6.0-1为你的安装路径):

<div class="linenums" style="margin: 0px; padding-left: 0px; color: rgb(30, 52, 123);"><div class="L0" style="margin: 0px; color: rgb(190, 190, 197); line-height: 18px; padding-left: 0px; list-style-type: none;"><code style="margin: 0px; padding: 0px; border: none; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; word-wrap: break-word; max-width: 100%; background-color: transparent;"><span class="lit" style="color: rgb(25, 95, 145); margin-top: 0px;">@echo</span><span class="pln" style="color: rgb(72, 72, 76);"> off</span></code></div><div class="L1" style="margin: 0px; color: rgb(190, 190, 197); line-height: 18px; padding-left: 0px; list-style-type: none;"><code style="margin: 0px; padding: 0px; border: none; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; word-wrap: break-word; max-width: 100%; background-color: transparent;"><span class="pln" style="color: rgb(72, 72, 76); margin-top: 0px;">rem </span><span class="pun" style="color: rgb(147, 161, 161);">--</span><span class="pln" style="color: rgb(72, 72, 76);"> </span><span class="typ" style="color: teal;">Check</span><span class="pln" style="color: rgb(72, 72, 76);"> </span><span class="kwd" style="color: rgb(30, 52, 123);">if</span><span class="pln" style="color: rgb(72, 72, 76);"> argument </span><span class="kwd" style="color: rgb(30, 52, 123);">is</span><span class="pln" style="color: rgb(72, 72, 76);"> INSTALL </span><span class="kwd" style="color: rgb(30, 52, 123);">or</span><span class="pln" style="color: rgb(72, 72, 76);"> REMOVE</span></code></div><div class="L2" style="margin: 0px; color: rgb(190, 190, 197); line-height: 18px; padding-left: 0px; list-style-type: none;"><code style="margin: 0px; padding: 0px; border: none; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; word-wrap: break-word; max-width: 100%; background-color: transparent;"></code></div><div class="L3" style="margin: 0px; color: rgb(190, 190, 197); line-height: 18px; padding-left: 0px; list-style-type: none;"><code style="margin: 0px; padding: 0px; border: none; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; word-wrap: break-word; max-width: 100%; background-color: transparent;"><span class="kwd" style="color: rgb(30, 52, 123); margin-top: 0px;">if</span><span class="pln" style="color: rgb(72, 72, 76);"> </span><span class="kwd" style="color: rgb(30, 52, 123);">not</span><span class="pln" style="color: rgb(72, 72, 76);"> </span><span class="str" style="color: rgb(221, 17, 68);">""</span><span class="pun" style="color: rgb(147, 161, 161);">%</span><span class="lit" style="color: rgb(25, 95, 145);">1</span><span class="str" style="color: rgb(221, 17, 68);">""</span><span class="pln" style="color: rgb(72, 72, 76);"> </span><span class="pun" style="color: rgb(147, 161, 161);">==</span><span class="pln" style="color: rgb(72, 72, 76);"> </span><span class="str" style="color: rgb(221, 17, 68);">""</span><span class="pln" style="color: rgb(72, 72, 76);">INSTALL</span><span class="str" style="color: rgb(221, 17, 68);">""</span><span class="pln" style="color: rgb(72, 72, 76);"> </span><span class="kwd" style="color: rgb(30, 52, 123);">goto</span><span class="pln" style="color: rgb(72, 72, 76);"> remove</span></code></div><div class="L4" style="margin: 0px; color: rgb(190, 190, 197); line-height: 18px; padding-left: 0px; list-style-type: none;"><code style="margin: 0px; padding: 0px; border: none; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; word-wrap: break-word; max-width: 100%; background-color: transparent;"></code></div><div class="L5" style="margin: 0px; color: rgb(190, 190, 197); line-height: 18px; padding-left: 0px; list-style-type: none;"><code style="margin: 0px; padding: 0px; border: none; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; word-wrap: break-word; max-width: 100%; background-color: transparent;"><span class="str" style="color: rgb(221, 17, 68); margin-top: 0px;">"C:\Bitnami\redmine-2.6.0-1\mysql\bin\mysqld.exe"</span><span class="pln" style="color: rgb(72, 72, 76);"> </span><span class="pun" style="color: rgb(147, 161, 161);">--</span><span class="pln" style="color: rgb(72, 72, 76);">install </span><span class="str" style="color: rgb(221, 17, 68);">"redmineMySQL"</span><span class="pln" style="color: rgb(72, 72, 76);"> </span><span class="pun" style="color: rgb(147, 161, 161);">--</span><span class="pln" style="color: rgb(72, 72, 76);">defaults</span><span class="pun" style="color: rgb(147, 161, 161);">-</span><span class="pln" style="color: rgb(72, 72, 76);">file</span><span class="pun" style="color: rgb(147, 161, 161);">=</span><span class="str" style="color: rgb(221, 17, 68);">"C:\Bitnami\redmine-2.6.0-1/mysql\my.ini"</span></code></div><div class="L6" style="margin: 0px; color: rgb(190, 190, 197); line-height: 18px; padding-left: 0px; list-style-type: none;"><code style="margin: 0px; padding: 0px; border: none; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; word-wrap: break-word; max-width: 100%; background-color: transparent;"></code></div><div class="L7" style="margin: 0px; color: rgb(190, 190, 197); line-height: 18px; padding-left: 0px; list-style-type: none;"><code style="margin: 0px; padding: 0px; border: none; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; word-wrap: break-word; max-width: 100%; background-color: transparent;"><span class="pln" style="color: rgb(72, 72, 76); margin-top: 0px;">net start </span><span class="str" style="color: rgb(221, 17, 68);">"redmineMySQL"</span><span class="pln" style="color: rgb(72, 72, 76);"> </span><span class="pun" style="color: rgb(147, 161, 161);">></span><span class="pln" style="color: rgb(72, 72, 76);">NUL</span></code></div><div class="L8" style="margin: 0px; color: rgb(190, 190, 197); line-height: 18px; padding-left: 0px; list-style-type: none;"><code style="margin: 0px; padding: 0px; border: none; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; word-wrap: break-word; max-width: 100%; background-color: transparent;"><span class="kwd" style="color: rgb(30, 52, 123); margin-top: 0px;">goto</span><span class="pln" style="color: rgb(72, 72, 76);"> </span><span class="kwd" style="color: rgb(30, 52, 123);">end</span></code></div><div class="L9" style="margin: 0px; color: rgb(190, 190, 197); line-height: 18px; padding-left: 0px; list-style-type: none;"><code style="margin: 0px; padding: 0px; border: none; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; word-wrap: break-word; max-width: 100%; background-color: transparent;"></code></div><div class="L0" style="margin: 0px; color: rgb(190, 190, 197); line-height: 18px; padding-left: 0px; list-style-type: none;"><code style="margin: 0px; padding: 0px; border: none; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; word-wrap: break-word; max-width: 100%; background-color: transparent;"><span class="pun" style="color: rgb(147, 161, 161); margin-top: 0px;">:</span><span class="pln" style="color: rgb(72, 72, 76);">remove</span></code></div><div class="L1" style="margin: 0px; color: rgb(190, 190, 197); line-height: 18px; padding-left: 0px; list-style-type: none;"><code style="margin: 0px; padding: 0px; border: none; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; word-wrap: break-word; max-width: 100%; background-color: transparent;"><span class="pln" style="color: rgb(72, 72, 76); margin-top: 0px;">rem </span><span class="pun" style="color: rgb(147, 161, 161);">--</span><span class="pln" style="color: rgb(72, 72, 76);"> STOP SERVICES BEFORE REMOVING</span></code></div><div class="L2" style="margin: 0px; color: rgb(190, 190, 197); line-height: 18px; padding-left: 0px; list-style-type: none;"><code style="margin: 0px; padding: 0px; border: none; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; word-wrap: break-word; max-width: 100%; background-color: transparent;"></code></div><div class="L3" style="margin: 0px; color: rgb(190, 190, 197); line-height: 18px; padding-left: 0px; list-style-type: none;"><code style="margin: 0px; padding: 0px; border: none; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; word-wrap: break-word; max-width: 100%; background-color: transparent;"><span class="pln" style="color: rgb(72, 72, 76); margin-top: 0px;">net stop </span><span class="str" style="color: rgb(221, 17, 68);">"redmineMySQL"</span><span class="pln" style="color: rgb(72, 72, 76);"> </span><span class="pun" style="color: rgb(147, 161, 161);">></span><span class="pln" style="color: rgb(72, 72, 76);">NUL</span></code></div><div class="L4" style="margin: 0px; color: rgb(190, 190, 197); line-height: 18px; padding-left: 0px; list-style-type: none;"><code style="margin: 0px; padding: 0px; border: none; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; word-wrap: break-word; max-width: 100%; background-color: transparent;"><span class="str" style="color: rgb(221, 17, 68); margin-top: 0px;">"C:\Bitnami\redmine-2.6.0-1\mysql\bin\mysqld.exe"</span><span class="pln" style="color: rgb(72, 72, 76);"> </span><span class="pun" style="color: rgb(147, 161, 161);">--</span><span class="pln" style="color: rgb(72, 72, 76);">remove </span><span class="str" style="color: rgb(221, 17, 68);">"redmineMySQL"</span></code></div><div class="L5" style="margin: 0px; color: rgb(190, 190, 197); line-height: 18px; padding-left: 0px; list-style-type: none;"><code style="margin: 0px; padding: 0px; border: none; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; word-wrap: break-word; max-width: 100%; background-color: transparent;"></code></div><div class="L6" style="margin: 0px; color: rgb(190, 190, 197); line-height: 18px; padding-left: 0px; list-style-type: none;"><code style="margin: 0px; padding: 0px; border: none; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; word-wrap: break-word; max-width: 100%; background-color: transparent;"><span class="pun" style="color: rgb(147, 161, 161); margin-top: 0px;">:</span><span class="kwd" style="color: rgb(30, 52, 123);">end</span></code></div><div class="L7" style="margin: 0px; color: rgb(190, 190, 197); line-height: 18px; padding-left: 0px; list-style-type: none;"><code style="margin: 0px; padding: 0px; border: none; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; word-wrap: break-word; max-width: 100%; background-color: transparent;"><span class="kwd" style="color: rgb(30, 52, 123); margin-top: 0px;">exit</span></code></div></div>

实际上,安装出错可以让我们有了比较好的机会在本机原来的mysql上安装redmine数据库,虽然多了后续的手动配置。当然,成功安装后也可以参照下面的步骤将redmine的数据库改本机现有的数据库。

后续问题解决方案

  • 手动完成初始化3306端口的Mysql管理帐号及redmine数据库。
    出问题的原因:上面提到的Mysql服务安装不成功,以及C:\Bitnami\redmine-2.6.0-1\apps\redmine\scriptsredmineini.bat脚本未被执行(实际上安装程序都没有拷贝这个脚本至目录下)。这个脚本的内容如下(拷贝自已成功安装的机器):

    <div class="linenums" style="margin: 0px; padding-left: 0px; color: rgb(30, 52, 123);"><div class="L0" style="margin: 0px; color: rgb(190, 190, 197); line-height: 18px; padding-left: 0px; list-style-type: none;"><code style="margin: 0px; padding: 0px; border: none; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; word-wrap: break-word; max-width: 100%; background-color: transparent;"><span class="lit" style="color: rgb(25, 95, 145); margin-top: 0px;">@echo</span><span class="pln" style="color: rgb(72, 72, 76);"> off</span></code></div><div class="L1" style="margin: 0px; color: rgb(190, 190, 197); line-height: 18px; padding-left: 0px; list-style-type: none;"><code style="margin: 0px; padding: 0px; border: none; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; word-wrap: break-word; max-width: 100%; background-color: transparent;"><span class="pln" style="color: rgb(72, 72, 76); margin-top: 0px;">rem </span><span class="typ" style="color: teal;">Populate</span><span class="pln" style="color: rgb(72, 72, 76);"> databases </span><span class="kwd" style="color: rgb(30, 52, 123);">and</span><span class="pln" style="color: rgb(72, 72, 76);"> load </span><span class="kwd" style="color: rgb(30, 52, 123);">default</span><span class="pln" style="color: rgb(72, 72, 76);"> data</span></code></div><div class="L2" style="margin: 0px; color: rgb(190, 190, 197); line-height: 18px; padding-left: 0px; list-style-type: none;"><code style="margin: 0px; padding: 0px; border: none; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; word-wrap: break-word; max-width: 100%; background-color: transparent;"><span class="pln" style="color: rgb(72, 72, 76); margin-top: 0px;">CALL C</span><span class="pun" style="color: rgb(147, 161, 161);">:</span><span class="pln" style="color: rgb(72, 72, 76);">\Bitnami\REDMIN</span><span class="pun" style="color: rgb(147, 161, 161);">~</span><span class="lit" style="color: rgb(25, 95, 145);">1.0</span><span class="pun" style="color: rgb(147, 161, 161);">-</span><span class="lit" style="color: rgb(25, 95, 145);">1</span><span class="pln" style="color: rgb(72, 72, 76);">\scripts\setenv</span><span class="pun" style="color: rgb(147, 161, 161);">.</span><span class="pln" style="color: rgb(72, 72, 76);">bat</span></code></div><div class="L3" style="margin: 0px; color: rgb(190, 190, 197); line-height: 18px; padding-left: 0px; list-style-type: none;"><code style="margin: 0px; padding: 0px; border: none; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; word-wrap: break-word; max-width: 100%; background-color: transparent;"><span class="pln" style="color: rgb(72, 72, 76); margin-top: 0px;">cd C</span><span class="pun" style="color: rgb(147, 161, 161);">:</span><span class="pln" style="color: rgb(72, 72, 76);">\Bitnami\redmine</span><span class="pun" style="color: rgb(147, 161, 161);">-</span><span class="lit" style="color: rgb(25, 95, 145);">2.6</span><span class="pun" style="color: rgb(147, 161, 161);">.</span><span class="lit" style="color: rgb(25, 95, 145);">0</span><span class="pun" style="color: rgb(147, 161, 161);">-</span><span class="lit" style="color: rgb(25, 95, 145);">1</span><span class="pun" style="color: rgb(147, 161, 161);">/</span><span class="pln" style="color: rgb(72, 72, 76);">apps</span><span class="pun" style="color: rgb(147, 161, 161);">/</span><span class="pln" style="color: rgb(72, 72, 76);">redmine\htdocs</span></code></div><div class="L4" style="margin: 0px; color: rgb(190, 190, 197); line-height: 18px; padding-left: 0px; list-style-type: none;"><code style="margin: 0px; padding: 0px; border: none; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; word-wrap: break-word; max-width: 100%; background-color: transparent;"><span class="pln" style="color: rgb(72, 72, 76); margin-top: 0px;">cmd </span><span class="pun" style="color: rgb(147, 161, 161);">/</span><span class="pln" style="color: rgb(72, 72, 76);">C bundle install </span><span class="pun" style="color: rgb(147, 161, 161);">--</span><span class="kwd" style="color: rgb(30, 52, 123);">local</span><span class="pln" style="color: rgb(72, 72, 76);"> </span><span class="pun" style="color: rgb(147, 161, 161);">--</span><span class="pln" style="color: rgb(72, 72, 76);">without development test sqlite </span><span class="pun" style="color: rgb(147, 161, 161);">--</span><span class="pln" style="color: rgb(72, 72, 76);">binstubs </span><span class="pun" style="color: rgb(147, 161, 161);">--</span><span class="pln" style="color: rgb(72, 72, 76);">deployment</span></code></div><div class="L5" style="margin: 0px; color: rgb(190, 190, 197); line-height: 18px; padding-left: 0px; list-style-type: none;"><code style="margin: 0px; padding: 0px; border: none; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; word-wrap: break-word; max-width: 100%; background-color: transparent;"><span class="pln" style="color: rgb(72, 72, 76); margin-top: 0px;">C</span><span class="pun" style="color: rgb(147, 161, 161);">:</span><span class="pln" style="color: rgb(72, 72, 76);">\Bitnami\redmine</span><span class="pun" style="color: rgb(147, 161, 161);">-</span><span class="lit" style="color: rgb(25, 95, 145);">2.6</span><span class="pun" style="color: rgb(147, 161, 161);">.</span><span class="lit" style="color: rgb(25, 95, 145);">0</span><span class="pun" style="color: rgb(147, 161, 161);">-</span><span class="lit" style="color: rgb(25, 95, 145);">1</span><span class="pun" style="color: rgb(147, 161, 161);">/</span><span class="pln" style="color: rgb(72, 72, 76);">ruby\b</span><span class="kwd" style="color: rgb(30, 52, 123);">in</span><span class="pln" style="color: rgb(72, 72, 76);">\ruby</span><span class="pun" style="color: rgb(147, 161, 161);">.</span><span class="pln" style="color: rgb(72, 72, 76);">exe bin\rake generate_secret_token</span></code></div><div class="L6" style="margin: 0px; color: rgb(190, 190, 197); line-height: 18px; padding-left: 0px; list-style-type: none;"><code style="margin: 0px; padding: 0px; border: none; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; word-wrap: break-word; max-width: 100%; background-color: transparent;"><span class="pln" style="color: rgb(72, 72, 76); margin-top: 0px;">C</span><span class="pun" style="color: rgb(147, 161, 161);">:</span><span class="pln" style="color: rgb(72, 72, 76);">\Bitnami\redmine</span><span class="pun" style="color: rgb(147, 161, 161);">-</span><span class="lit" style="color: rgb(25, 95, 145);">2.6</span><span class="pun" style="color: rgb(147, 161, 161);">.</span><span class="lit" style="color: rgb(25, 95, 145);">0</span><span class="pun" style="color: rgb(147, 161, 161);">-</span><span class="lit" style="color: rgb(25, 95, 145);">1</span><span class="pun" style="color: rgb(147, 161, 161);">/</span><span class="pln" style="color: rgb(72, 72, 76);">ruby\b</span><span class="kwd" style="color: rgb(30, 52, 123);">in</span><span class="pln" style="color: rgb(72, 72, 76);">\ruby</span><span class="pun" style="color: rgb(147, 161, 161);">.</span><span class="pln" style="color: rgb(72, 72, 76);">exe bin\rake db</span><span class="pun" style="color: rgb(147, 161, 161);">:</span><span class="pln" style="color: rgb(72, 72, 76);">migrate RAILS_ENV</span><span class="pun" style="color: rgb(147, 161, 161);">=</span><span class="str" style="color: rgb(221, 17, 68);">"production"</span></code></div><div class="L7" style="margin: 0px; color: rgb(190, 190, 197); line-height: 18px; padding-left: 0px; list-style-type: none;"><code style="margin: 0px; padding: 0px; border: none; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; word-wrap: break-word; max-width: 100%; background-color: transparent;"><span class="pln" style="color: rgb(72, 72, 76); margin-top: 0px;">C</span><span class="pun" style="color: rgb(147, 161, 161);">:</span><span class="pln" style="color: rgb(72, 72, 76);">\Bitnami\redmine</span><span class="pun" style="color: rgb(147, 161, 161);">-</span><span class="lit" style="color: rgb(25, 95, 145);">2.6</span><span class="pun" style="color: rgb(147, 161, 161);">.</span><span class="lit" style="color: rgb(25, 95, 145);">0</span><span class="pun" style="color: rgb(147, 161, 161);">-</span><span class="lit" style="color: rgb(25, 95, 145);">1</span><span class="pun" style="color: rgb(147, 161, 161);">/</span><span class="pln" style="color: rgb(72, 72, 76);">ruby\b</span><span class="kwd" style="color: rgb(30, 52, 123);">in</span><span class="pln" style="color: rgb(72, 72, 76);">\ruby</span><span class="pun" style="color: rgb(147, 161, 161);">.</span><span class="pln" style="color: rgb(72, 72, 76);">exe bin\rake redmine</span><span class="pun" style="color: rgb(147, 161, 161);">:</span><span class="pln" style="color: rgb(72, 72, 76);">load_default_data RAILS_ENV</span><span class="pun" style="color: rgb(147, 161, 161);">=</span><span class="str" style="color: rgb(221, 17, 68);">"production"</span><span class="pln" style="color: rgb(72, 72, 76);"> </span><span class="pun" style="color: rgb(147, 161, 161);"><</span><span class="pln" style="color: rgb(72, 72, 76);"> lng</span><span class="pun" style="color: rgb(147, 161, 161);">.</span><span class="pln" style="color: rgb(72, 72, 76);">txt</span></code></div></div>

    我们这里采用的是以下步骤手动完成

    1. 创建redmine 数据库。连接至3306端口的Mysql,执行以下MySQL命令:
      <div class="linenums" style="margin: 0px; padding-left: 0px; color: rgb(30, 52, 123);"><div class="L0" style="margin: 0px; color: rgb(190, 190, 197); line-height: 18px; padding-left: 0px; list-style-type: none;"><code style="margin: 0px; padding: 0px; border: none; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; word-wrap: break-word; max-width: 100%; background-color: transparent;"><span class="pln" style="color: rgb(72, 72, 76); margin-top: 0px;">create database redmine character </span><span class="kwd" style="color: rgb(30, 52, 123);">set</span><span class="pln" style="color: rgb(72, 72, 76);"> utf8</span><span class="pun" style="color: rgb(147, 161, 161);">;</span></code></div><div class="L1" style="margin: 0px; color: rgb(190, 190, 197); line-height: 18px; padding-left: 0px; list-style-type: none;"><code style="margin: 0px; padding: 0px; border: none; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; word-wrap: break-word; max-width: 100%; background-color: transparent;"><span class="pln" style="color: rgb(72, 72, 76); margin-top: 0px;">create user </span><span class="str" style="color: rgb(221, 17, 68);">'bitnami'</span><span class="pun" style="color: rgb(147, 161, 161);">@</span><span class="str" style="color: rgb(221, 17, 68);">'localhost'</span><span class="pln" style="color: rgb(72, 72, 76);"> identified </span><span class="kwd" style="color: rgb(30, 52, 123);">by</span><span class="pln" style="color: rgb(72, 72, 76);"> </span><span class="str" style="color: rgb(221, 17, 68);">'60760284c1'</span><span class="pun" style="color: rgb(147, 161, 161);">;</span></code></div><div class="L2" style="margin: 0px; color: rgb(190, 190, 197); line-height: 18px; padding-left: 0px; list-style-type: none;"><code style="margin: 0px; padding: 0px; border: none; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; word-wrap: break-word; max-width: 100%; background-color: transparent;"><span class="pln" style="color: rgb(72, 72, 76); margin-top: 0px;">grant all privileges on bitnami_redmine</span><span class="pun" style="color: rgb(147, 161, 161);">.*</span><span class="pln" style="color: rgb(72, 72, 76);"> to </span><span class="str" style="color: rgb(221, 17, 68);">'bitnami'</span><span class="pun" style="color: rgb(147, 161, 161);">@</span><span class="str" style="color: rgb(221, 17, 68);">'localhost'</span><span class="pun" style="color: rgb(147, 161, 161);">;</span></code></div></div>
      修改..\redmine-2.6.0-1\apps\redmine\htdocs\config\database.yml中的[production]的设置,并将port设为3306
    2. 初始化redmine 数据库结构
      将命令模式的当前目录切换至redmine的安装目录(我的是C:\Bitnami\redmine-2.6.0-1\apps\redmine\htdocs),执行命令:

      <div class="linenums" style="margin: 0px; padding-left: 0px; color: rgb(30, 52, 123);"><div class="L0" style="margin: 0px; color: rgb(190, 190, 197); line-height: 18px; padding-left: 0px; list-style-type: none;"><code style="margin: 0px; padding: 0px; border: none; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; word-wrap: break-word; max-width: 100%; background-color: transparent;"><span class="pln" style="color: rgb(72, 72, 76); margin-top: 0px;">rake db</span><span class="pun" style="color: rgb(147, 161, 161);">:</span><span class="pln" style="color: rgb(72, 72, 76);">migrate RAILS_ENV</span><span class="pun" style="color: rgb(147, 161, 161);">=</span><span class="str" style="color: rgb(221, 17, 68);">"production"</span></code></div></div>

      可能会报错:Could not find eventmachine-1.0.3 in any of the sources
      原因: ruby缺少依赖的gemfile。
      解决办法:执行bundle install解决版本依赖问题后,再执行:

      <div class="linenums" style="margin: 0px; padding-left: 0px; color: rgb(30, 52, 123);"><div class="L0" style="margin: 0px; color: rgb(190, 190, 197); line-height: 18px; padding-left: 0px; list-style-type: none;"><code style="margin: 0px; padding: 0px; border: none; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; word-wrap: break-word; max-width: 100%; background-color: transparent;"><span class="pln" style="color: rgb(72, 72, 76); margin-top: 0px;">bundle </span><span class="kwd" style="color: rgb(30, 52, 123);">exec</span><span class="pln" style="color: rgb(72, 72, 76);"> rake db</span><span class="pun" style="color: rgb(147, 161, 161);">:</span><span class="pln" style="color: rgb(72, 72, 76);">migrate RAILS</span></code></div></div>
    3. 配置redmine数据库
      继续在命令模式下执行如下命令,填充redmine数据库中关于默认配置的数据。执行过程中选择语言时输入"zh":

      <div class="linenums" style="margin: 0px; padding-left: 0px; color: rgb(30, 52, 123);"><div class="L0" style="margin: 0px; color: rgb(190, 190, 197); line-height: 18px; padding-left: 0px; list-style-type: none;"><code style="margin: 0px; padding: 0px; border: none; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; word-wrap: break-word; max-width: 100%; background-color: transparent;"><span class="pln" style="color: rgb(72, 72, 76); margin-top: 0px;">bundle </span><span class="kwd" style="color: rgb(30, 52, 123);">exec</span><span class="pln" style="color: rgb(72, 72, 76);"> rake redmine</span><span class="pun" style="color: rgb(147, 161, 161);">:</span><span class="pln" style="color: rgb(72, 72, 76);">load_default_data RAILS_ENV</span><span class="pun" style="color: rgb(147, 161, 161);">=</span><span class="str" style="color: rgb(221, 17, 68);">"production"</span></code></div></div>
    4. 执行下面的语句,创建session密锁:

      <div class="linenums" style="margin: 0px; padding-left: 0px; color: rgb(30, 52, 123);"><div class="L0" style="margin: 0px; color: rgb(190, 190, 197); line-height: 18px; padding-left: 0px; list-style-type: none;"><code style="margin: 0px; padding: 0px; border: none; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; word-wrap: break-word; max-width: 100%; background-color: transparent;"><span class="pln" style="color: rgb(72, 72, 76); margin-top: 0px;">C</span><span class="pun" style="color: rgb(147, 161, 161);">:</span><span class="pln" style="color: rgb(72, 72, 76);">\Bitnami\redmine</span><span class="pun" style="color: rgb(147, 161, 161);">-</span><span class="lit" style="color: rgb(25, 95, 145);">2.6</span><span class="pun" style="color: rgb(147, 161, 161);">.</span><span class="lit" style="color: rgb(25, 95, 145);">0</span><span class="pun" style="color: rgb(147, 161, 161);">-</span><span class="lit" style="color: rgb(25, 95, 145);">1</span><span class="pun" style="color: rgb(147, 161, 161);">/</span><span class="pln" style="color: rgb(72, 72, 76);">ruby\b</span><span class="kwd" style="color: rgb(30, 52, 123);">in</span><span class="pln" style="color: rgb(72, 72, 76);">\ruby</span><span class="pun" style="color: rgb(147, 161, 161);">.</span><span class="pln" style="color: rgb(72, 72, 76);">exe bin\rake generate_secret_token</span></code></div></div>
  • 启动redmine。

    1. 启动windows服务redmineThin2。如果没有这个服务,执行以下命令。

      <div class="linenums" style="margin: 0px; padding-left: 0px; color: rgb(30, 52, 123);"><div class="L0" style="margin: 0px; color: rgb(190, 190, 197); line-height: 18px; padding-left: 0px; list-style-type: none;"><code style="margin: 0px; padding: 0px; border: none; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; word-wrap: break-word; max-width: 100%; background-color: transparent;"><span class="pln" style="color: rgb(72, 72, 76); margin-top: 0px;">C</span><span class="pun" style="color: rgb(147, 161, 161);">:</span><span class="pln" style="color: rgb(72, 72, 76);">\Bitnami\redmine</span><span class="pun" style="color: rgb(147, 161, 161);">-</span><span class="lit" style="color: rgb(25, 95, 145);">2.6</span><span class="pun" style="color: rgb(147, 161, 161);">.</span><span class="lit" style="color: rgb(25, 95, 145);">0</span><span class="pun" style="color: rgb(147, 161, 161);">-</span><span class="lit" style="color: rgb(25, 95, 145);">1</span><span class="pln" style="color: rgb(72, 72, 76);">\apps\redmine\scripts\serviceinstall</span><span class="pun" style="color: rgb(147, 161, 161);">.</span><span class="pln" style="color: rgb(72, 72, 76);">bat INSTALL</span></code></div><div class="L1" style="margin: 0px; color: rgb(190, 190, 197); line-height: 18px; padding-left: 0px; list-style-type: none;"><code style="margin: 0px; padding: 0px; border: none; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; word-wrap: break-word; max-width: 100%; background-color: transparent;"><span class="pln" style="color: rgb(72, 72, 76); margin-top: 0px;">net start redmineThin2</span></code></div></div>

      可以通过http://localhost:3002/redmine/查看是否启动成功。

    2. 修复apache的配置文件,使redmine可以从http://localhost/redmine/访问。
      出问题的原因:安装过程中发生异常,apache2的conf文件夹下bitmami中的bitnami-apps-vhosts.conf未正确配置。
      打开该文件输入:

      <div class="linenums" style="margin: 0px; padding-left: 0px; color: rgb(30, 52, 123);"><div class="L0" style="margin: 0px; color: rgb(190, 190, 197); line-height: 18px; padding-left: 0px; list-style-type: none;"><code style="margin: 0px; padding: 0px; border: none; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; word-wrap: break-word; max-width: 100%; background-color: transparent;"><span class="com" style="color: rgb(147, 161, 161); margin-top: 0px;"># Bitnami applications installed in a prefix URL</span></code></div><div class="L1" style="margin: 0px; color: rgb(190, 190, 197); line-height: 18px; padding-left: 0px; list-style-type: none;"><code style="margin: 0px; padding: 0px; border: none; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; word-wrap: break-word; max-width: 100%; background-color: transparent;"><span class="typ" style="color: teal; margin-top: 0px;">Include</span><span class="pln" style="color: rgb(72, 72, 76);"> </span><span class="str" style="color: rgb(221, 17, 68);">"C:\Bitnami\redmine-2.6.0-1/apps/redmine/conf/httpd-prefix.conf"</span></code></div></div>

完成以上修复后,redmine就可以正常的从http://localhost/redmine/访问了

总结

总体上讲,bitmami提供的一键安装包质量是非常高的。

参考
  1. redmine部署手册以及安装包
  2. 在Windows上安装Redmine
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值