問題: 使用Bitnami一鍵安裝redmine後能夠正常使用,可是在整合「版本庫」功能與git整合後,頁面報404錯誤:
The entry or revision was not found in the repository.
版本庫中不存在該條目和(或)其修訂版本。
解決: 找到
/opt/redmine-3.1.2-0/apache2/conf/bitnami/
passenger.conf文件,修改:
PassengerUser daemon
PassengerGroup
daemon
中的用戶與組改成建立git倉庫所使用的用戶和組,如gerrit2
解決過程描述:
1. 查看日誌文件
/opt/redmine-3.1.2-0/apache2/logs/
error_log 看到
App 10292 stderr: fatal: Not a git repository: '/home/gerrit2/review_site/git/xxx.git' 提示
2. 根據頁面提示 baidu 和 google 相關問題,初步定位是文件權限問題。
3. 使用
[root@xxxx/opt/redmine-3.1.2-0/apps/redmine/htdocs]$ ../../../ruby/bin/ruby bin/rails server webrick -b 192.168.0.1 -e
production 啓動redmine,
登陸後發現功能正常。
4. 從新使用
/opt/redmine-3.1.2-0/
ctlscript.sh啓動後問題依舊。
5.
[root@xxxx/opt/redmine-3.1.2-0/apps/redmine/htdocs]$ ../../../ruby/bin/ruby bin/rails server webrick -b 192.168.0.1 -e
development 功能正常,
注意修改
database.yml配置文件中
development
的相關配置,查看打印信息:
=> Booting WEBrick
=> Rails 4.2.4 application starting in development on http://
192.168.0.1
:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
[2015-12-14 22:50:04] INFO WEBrick 1.3.1
[2015-12-14 22:50:04] INFO ruby 2.0.0 (2015-08-18) [x86_64-linux]
[2015-12-14 22:50:04] INFO WEBrick::HTTPServer#start: pid=16108 port=3000
Started GET "/projects/server_dev/repository" for 116.231.135.105 at 2015-12-14 22:50:07 +0800
Processing by RepositoriesController#show as HTML
Parameters: {"id"=>"server_dev"}
Setting Load (0.3ms) SELECT `settings`.* FROM `settings` WHERE `settings`.`name` = 'session_lifetime' ORDER BY `settings`.`id` DESC LIMIT 1
......
Repository Load (0.3ms) SELECT `repositories`.* FROM `repositories` WHERE `repositories`.`project_id` = 9 AND (is_default = 1) LIMIT 1
Shelling out: 'git' --version --no-color
Shelling out: 'git' '--git-dir' '/home/gerrit2/review_site/git/xxx.git' '-c' 'core.quotepath=false' '-c' 'log.decorate=no' 'branch' '--no-color' '--verbose' '--no-abbrev'
(0.3ms) SELECT `enabled_modules`.`name` FROM `enabled_modules` WHERE `enabled_modules`.`project_id` = 9
Setting Load (0.3ms) SELECT `settings`.* FROM `settings` WHERE `settings`.`name` = 'autofetch_changesets' ORDER BY `settings`.`id` DESC LIMIT 1
將【
'git' '--git-dir' '/home/gerrit2/review_site/git/xxx.git' '-c' 'core.quotepath=false' '-c' 'log.decorate=no' 'branch' '--no-color' '--verbose' '--no-abbrev'】
使用非git
賬號執行報的錯誤和
/opt/redmine-3.1.2-0/apache2/logs/
error_log 裏面的信息同樣,使用建立git倉庫的賬號如gerrit2執行能獲得git分支信息,因此可確定是哪裏的賬號出錯了。
6. 首先想到的是apache的賬號,將
/opt/redmine-3.1.2-0/apache2/conf/httpd.conf裏面的
User
daemon
Group
daemon
daemon 改爲 gerrit2 仍是同樣。
7. 終於看到
/opt/redmine-3.1.2-0/apache2/conf/bitnami/
passenger.conf 裏面的用戶與組設定,忽然就明白了,試着改爲gerrit2,的確是這裏的問題。