Redmine, Apache, git integration encountered difficulties

Source: Internet
Author: User
Tags apache error log chmod connection reset unix domain socket file permissions redmine

Remine, Apache, and Git, the three software, which is easy to install, configure, and use alone, is not easy to combine. Here is a record of all the problems that have been encountered this week. First, Redmine + Apache fcgi configuration

Reference articles:

Http://www.redmine.org/projects/redmine/wiki/RedmineInstall

Http://www.redmine.org/projects/redmine/wiki/HowTo_configure_Apache_to_run_Redmine

The default installation is in the article with CGI, and Redmine 2.0.0 installed, in the public directory only a dispatch.fcgi.example, so it means only to use fcgi to say the two together. Usually used to the Apache virtual Host + proxy and Tomcat common mode of operation, fcgi some unfamiliar. In accordance with the mod_fastcgi in the second half of the way after a half-day, only to find that the original Apache and the official mod_fcgi, since there is the official release of the version, there is no doubt replaced by the mod_fcgi. The installation is relatively simple, a few simple configuration: 1, in/etc/httpd/conf.d/a new file mod_fcgi.conf, the contents are as follows:

<virtualhost *:80>

  defaultinitenv rails_env production
  documentroot/var/lib/redmine/public

  < Directory "/var/lib/redmine/public/" >
    Options Indexes execcgi followsymlinks
    allowoverride all
    order Deny,allow
    allow from all
  </Directory>
  <location/>
    AddHandler fcgid-script. fcgi
    Fcgiwrapper "/usr/local/bin/ruby/var/lib/redmine/public/dispatch.fcgi". fcgi
  </Location>

</ Virtualhost>

2, modify the directory permissions under Redmine:

Cd/var/lib
chown-r apache.apache redmine
chmod-r 775

3, modify the/etc/httpd/logs directory permissions:

If this directory does not specify the appropriate permissions, you may receive an error similar to the following:

[Mon May 21 14:52:38 2012] [ERROR] (13) Permission denied:mod_fcgid:couldn ' t bind Unix domain socket/etc/httpd/logs/fcgidsock/10989.0
[Mon May 21 14:52:38 2012] [Warn] (13) Permission Denied:mod_fcgid:spawn Process/usr/bin/ruby Error

Also increase access to read and write and execute

cd/var/httpd/
chmod-r 775 Logs

4, a problem that has not been solved.

Following the configuration above, the Redmine access path is the root directory, that is, http://localhost/.  And I installed the server there are some other services, want to change the address to http://localhost/redmine, but always can not succeed. Tried Google to all methods, including translating Japanese into English, and there was no solution.

Also hope that the students have solved the problem, I am grateful:-)

Second, Redmine + Git

While Git is now the mainstream of the open source community, it is undeniable that third-party software integration with SVN is super handy. Only need to specify repository address as well as user name, password, after saving can be seen in Redmine resository below all submit records, the user also get. But git is not that simple. 1. Add hooks to git repository

Redmine will not proactively go to Git's code base to fetch submissions, so you have to add a hook for git, notify Redmine after each submission, and then redmine to fetch the submission record. Git's code base location:/home/git/respoistory/myapp.git/, go to the Hooks directory, change post-receive.sample to Post-receive, and then add the following:

#!/bin/sh
Curl "Http://localhost/sys/fetch_changesets?key=XegbKj4EarU1YMor5S1N&id=myapp"
The following ID is the ID of project in Redmine.

After the completion of the configuration, the MyApp made several changes, but in Redmine or 404, what reason? 2, permissions, permissions , or Permissions

Check out the Apache error log and see the following:

Fatal:not a git repository: '/home/git/repositories/myapp.git '
Fatal:not a valid object name:
The process of tossing back and forth is no longer to repeat, since the determination of the permissions caused, then the solution to the problem is very simple. First of all, you can't change these to only Apache:apache can access, code base operations need to use GIT account. Then add Apache to Git's group, open/etc/group, find git, and modify it to:

Git:x:1638:apache
Then modify the directory permissions for Myapp.git:

Chmod-r G+r Myapp.git
For certain permissions that need to be executed, add X.


Look back and think, these changes seem to be self-evident, especially file permissions, is not it.

"PostScript" after breaking through the various problems mentioned above, in the last Friday to celebrate the victory, only to discover the backlogs plug-in on the high version. Redmine1.4.2 and backlogs were reinstalled today, and there was nothing unusual in the installation process. However, the following error occurred while accessing:

[Mon May 28 16:17:01 2012] [Notice] apache/2.2.3 (CentOS) configured--Resuming normal operations
/usr/local/lib/ruby/gems/1.8/gems/bundler-1.1.4/lib/bundler/source.rb:574:in ' load_spec_files ': http:// Github.com/vanuan/cucumber-rails.git (at cucumber-rails2_v0.3.3) isn't checked out. Please run ' bundle install ' (bundler::giterror)
From/usr/local/lib/ruby/gems/1.8/gems/bundler-1.1.4/lib/bundler/source.rb:372:in ' Local_specs '
From/usr/local/lib/ruby/gems/1.8/gems/bundler-1.1.4/lib/bundler/source.rb:557:in ' Specs '
From/usr/local/lib/ruby/gems/1.8/gems/bundler-1.1.4/lib/bundler/lazy_specification.rb:53:in ' __materialize__ '
From/usr/local/lib/ruby/gems/1.8/gems/bundler-1.1.4/lib/bundler/spec_set.rb:86:in ' materialize '
From/usr/local/lib/ruby/gems/1.8/gems/bundler-1.1.4/lib/bundler/spec_set.rb:83:in ' map! '
From/usr/local/lib/ruby/gems/1.8/gems/bundler-1.1.4/lib/bundler/spec_set.rb:83:in ' materialize '
From/usr/local/lib/ruby/gems/1.8/gems/bundler-1.1.4/lib/bundler/definition.rb:127:in ' Specs '
From/usr/local/lib/ruby/gems/1.8/gems/bundler-1.1.4/lib/bundler/definition.rb:172:in ' Specs_for '
From/usr/local/lib/ruby/gems/1.8/gems/bundler-1.1.4/lib/bundler/definition.rb:161:in ' Requested_specs '
From/usr/local/lib/ruby/gems/1.8/gems/bundler-1.1.4/lib/bundler/environment.rb:23:in ' Requested_specs '
From/usr/local/lib/ruby/gems/1.8/gems/bundler-1.1.4/lib/bundler/runtime.rb:11:in ' Setup '
From/usr/local/lib/ruby/gems/1.8/gems/bundler-1.1.4/lib/bundler.rb:107:in ' Setup '
from/var/lib/redmine/public/.. /config/.. /config/preinitializer.rb:16
from/var/lib/redmine/public/.. /config/boot.rb:33:in ' Load '
from/var/lib/redmine/public/.. /config/boot.rb:33:in ' Preinitialize '
from/var/lib/redmine/public/.. /config/boot.rb:15:in ' boot! '
from/var/lib/redmine/public/.. /config/boot.rb:124
from/var/lib/redmine/public/.. /config/environment.rb:8:in ' require '
from/var/lib/redmine/public/.. /config/environment.rb:8
From/var/lib/redmine/public/dispatch.fcgi:21:in ' require '
From/var/lib/redmine/public/dispatch.fcgi:21
[Mon May 28 16:17:06 2012] [Warn] [Client 172.16.99.11] (104) Connection Reset by Peer:mod_fcgid:error reading data from FastCGI server, Referer:http://localhost/login
[Mon May 28 16:17:06 2012] [ERROR] [Client 172.16.99.11] Premature end of script headers:dispatch.fcgi, Referer:http://localhost/login

In fact, cucumber related files have been installed successfully. Really don't know how to fix it, just put the/var/lib/redmine/vendor/plugins/redmine_backlogs/gemfile

Gem ' cucumber-rails ',: Git => ' http://github.com/Vanuan/cucumber-rails.git ',: Branch => ' cucumber-rails2_v0.3.3 '

Comment out and restart Apache. Then, everything is normal.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.