Installing Redmine in SourceForge's projects' web space

Added by Muriel Salvan over 9 years ago

Hi

I am greatly interested in Redmine, and I would enjoy installing it for projects hosted in SourceForge.

I am not yet interested in the Hosted Apps of SourceForge (I saw a previous post on this forum dealing with them: http://www.redmine.org/boards/1/topics/4691#message-4698), because Hosted Apps do not give access to their underlying database. As one of my goals is to automate some pages/tickets creation with user scripting, I want to install Redmine in the project's web space itself to have full control over the underlying database (I am not a SourceForge's admin).

SourceForge's projects web space includes:
  • An already running Apache server (the project can put its files in a htdocs/ directory to make them public through http://myproject.sourceforge.net), with no control over its configuration
  • An already running MySQL server
  • Shell access to the htdocs/ directory

I managed to install RubyGems and Rake, and was able to install Redmine up to step 8 of your installation guide (http://www.redmine.org/wiki/redmine/RedmineInstall). I have checked tables in the database, and everything appears to be fine.

The thing is step 8. is irrelevant for me, as Apache is already running.

So I tried to access the Redmine directories (http://rcodeleveler.sourceforge.net/redmine/ and http://rcodeleveler.sourceforge.net/redmine/public/), with no success (404), even after renaming the dispatch.cgi.example file to dispatch.cgi:


An error has been encountered in accessing this page.

1. Server: rcodeleveler.sourceforge.net
2. URL path: /home/groups/r/rc/rcodeleveler/htdocs/redmine/public/dispatch.cgi
3. Error notes: NONE
4. Error type: 404
5. Request method: GET
6. Request query string: NONE
7. Time: 2009-03-18 15:50:55 UTC (1237391455) 

As I am not yet familiar with Redmine architecture, I don't really know where to look, googling did not help much.
Once I figure the complete process to set it up, I will put this in a clear tutorial.

Please can you provide me a few hints to make this install work correctly ?

Thanks a lot

Muriel

PS: Here is the script/about output:

=> RAILS_ENV=production script/about
About your application's environment
Ruby version 1.8.5 (x86_64-linux)
RubyGems version 1.3.1
Rails version 2.1.2
Active Record version 2.1.2
Action Pack version 2.1.2
Active Resource version 2.1.2
Action Mailer version 2.1.2
Active Support version 2.1.2
Edge Rails revision unknown
Application root /home/groups/r/rc/rcodeleveler/htdocs/redmine
Environment production
Database adapter mysql
Database schema version 101

Replies (8)

RE: Installing Redmine in SourceForge's projects' web space - Added by Muriel Salvan over 9 years ago

Thanks for the link, but unfortunately it didn't help.

I tried adding ActionController::AbstractRequest.relative_url_root = "/redmine" or ActionController::AbstractRequest.relative_url_root = "/redmine/public" as I try to access it via http://rcodeleveler.sourceforge.net/redmine or http://rcodeleveler.sourceforge.net/redmine/public, but I always get a 403 on the redmine URL, and a 404 on the redmine/public URL.

Something I don't understand yet is where are the files that the server (Webrick as default) accesses behind http://localhost:3000/ in a normal local installation ? I tried finding some php or html over the installed files, but I remained clueless. These should be the files I am missing.

Thanks for your help

Muriel

RE: Installing Redmine in SourceForge's projects' web space - Added by Markus Knittig over 9 years ago

Have you access to the apache errorlog? AFAIK Webrick works embedded...

RE: Installing Redmine in SourceForge's projects' web space - Added by Muriel Salvan over 9 years ago

Yes, I managed to get the error logs, here they are:

When /redmine is accessed:
[error] [client 127.0.0.1] Directory index forbidden by Options directive: /home/groups/r/rc/rcodeleveler/htdocs/redmine/ (indeed there is no .htaccess file in this directory)
When /redmine/public is accessed:
[error] [client 127.0.0.1] File does not exist: /home/groups/r/rc/rcodeleveler/htdocs/home (indeed htdocs/home does not exist). I don't know yet why it checks in this home directory.

So my guess is that the /redmine/public directory contains the relevant files I need to run redmine from Apache.

In the meantime, I discovered that SourceForge restricts execution of CGI scripts outside of a cgi-bin directory. So now I moved the CGI files right there, changed some paths inside of them to reflect their new location, and added some debugging output to check that they are accessed correctly. It is indeed the case, but I still don't have any working redmine yet.

I think the problem is more related to the RubyOnRails integration in SourceForge environment than to redmine itself.
Now I am up to investigate by reading and changing RoR scripts.

I will post news of this in the forum, as I am planning on delivering a tool that can automate redmine's installation on any SourceForge's project.

Thanks a lot for your help

Muriel

RE: Installing Redmine in SourceForge's projects' web space - Added by Muriel Salvan over 9 years ago

Done.

Here is the complete procedure:
http://weacemethod.sourceforge.net/wiki/index.php/HowToInstallRedmineSF.NET

I have also released a set of scripts that install it for you.

Even if you are not hosted on SourceForge, this can be useful to those who want to install Redmine on a "hosted" environment, with no root access and an already running Apache server with no subdomain creation.

To sum up the initial problem, files named 'public/dispatch.[f]cgi' are the ones to be used by browsers that don't have any embedded web server. The tricks (explained in my tutorial above) were to make Apache understand correctly how to interface with those dispatch.[f]cgi files.

Don't hesitate to post any question/comment/remark on this tutorial and the corresponding scripts, I will update them accordingly.

Thanks a lot

Muriel

RE: Installing Redmine in SourceForge's projects' web space - Added by Miguel Chavez about 8 years ago

Hi,
I see this post has one year old, but way here is my question.

Im completely new to redmine and of course ruby/ror.
I followed the procedure (by hand, not used the scripts) on the link in the last comment, to install redmine on Sourceforge web project.

When trying to access the site, i got a 500 Error:

2. URL path: /cgi-bin/redmine/dispatch.fcgi
3. Error notes: Premature end of script headers: dispatch.fcgi
4. Error type: 500

And on the apache log and (fast-cgi.crash.log):
[26/Aug/2010:03:08:46 :: 8436] Dispatcher failed to catch: Invalid argument (Errno::EINVAL)
/home/groups/l/le/lemoncourier/rubygems/mygemrepository/gems/fcgi-0.8.8/lib/fcgi.rb:49:in `for_fd'
/home/groups/l/le/lemoncourier/rubygems/mygemrepository/gems/fcgi-0.8.8/lib/fcgi.rb:49:in `default_connection'
/home/groups/l/le/lemoncourier/rubygems/mygemrepository/gems/fcgi-0.8.8/lib/fcgi.rb:35:in `each'
/home/groups/l/le/lemoncourier/redmine-1.0.1/vendor/rails/railties/lib/fcgi_handler.rb:77:in `process_each_request'
/home/groups/l/le/lemoncourier/redmine-1.0.1/vendor/rails/railties/lib/fcgi_handler.rb:76:in `catch'
/home/groups/l/le/lemoncourier/redmine-1.0.1/vendor/rails/railties/lib/fcgi_handler.rb:76:in `process_each_request'
/home/groups/l/le/lemoncourier/redmine-1.0.1/vendor/rails/railties/lib/fcgi_handler.rb:51:in `process!'
/home/groups/l/le/lemoncourier/redmine-1.0.1/vendor/rails/railties/lib/fcgi_handler.rb:23:in `process!'
/home/groups/l/le/lemoncourier/cgi-bin/redmine/dispatch.fcgi:39
retrying after unhandled exception
[26/Aug/2010:03:08:46 :: 8436] starting
[26/Aug/2010:03:08:46 :: 8436] Dispatcher failed to catch: Invalid argument (Errno::EINVAL)
/home/groups/l/le/lemoncourier/rubygems/mygemrepository/gems/fcgi-0.8.8/lib/fcgi.rb:49:in `for_fd'
/home/groups/l/le/lemoncourier/rubygems/mygemrepository/gems/fcgi-0.8.8/lib/fcgi.rb:49:in `default_connection'
/home/groups/l/le/lemoncourier/rubygems/mygemrepository/gems/fcgi-0.8.8/lib/fcgi.rb:35:in `each'
/home/groups/l/le/lemoncourier/redmine-1.0.1/vendor/rails/railties/lib/fcgi_handler.rb:77:in `process_each_request'
/home/groups/l/le/lemoncourier/redmine-1.0.1/vendor/rails/railties/lib/fcgi_handler.rb:76:in `catch'
/home/groups/l/le/lemoncourier/redmine-1.0.1/vendor/rails/railties/lib/fcgi_handler.rb:76:in `process_each_request'
/home/groups/l/le/lemoncourier/redmine-1.0.1/vendor/rails/railties/lib/fcgi_handler.rb:51:in `process!'
/home/groups/l/le/lemoncourier/redmine-1.0.1/vendor/rails/railties/lib/fcgi_handler.rb:23:in `process!'
/home/groups/l/le/lemoncourier/cgi-bin/redmine/dispatch.fcgi:39
stopping after unhandled exception within 10 seconds of the last

I really dont know what is happening.

Ruby version is 1.8.6 (2009-06-08 patchlevel 369) [x86_64-linux]
gem version is 1.3.7
fcgi version is 2.4.0
rake version is 0.8.7
redmine version is 1.0.1

Any one has got the same? Any idea?

Thanks.

RE: Installing Redmine in SourceForge's projects' web space - Added by Muriel Salvan about 8 years ago

Hi Miguel

The error is thrown by the FCGI-Ruby Gem (your version is 0.8.8, but the code I pasted is from 0.8.7):
48 def self::default_connection
49 ::Socket.for_fd($stdin.fileno)
50 end

I found another post regarding a similar issue: http://www.justskins.com/forums/socket-accept-problem-via-98776.html
But they say it should have been fixed already.

First time I hear about this problem. Maybe induced by a difference between Redmine 0.8.2 and 1.0.1 ? Or FCGI-Ruby Gem 0.8.7 and 0.8.8 ? Maybe you should also ask in the FCGI-Ruby forums.

Another clue: the Ruby code here tries to create an IO object wrapping the standard input (I think it will use it afterwards to read stdin). Maybe the problem could come from your environment (or the environment where Apache is run): if stdin cannot be accessed correctly you might have this error.
I tried those lines on irb, and it worked on my WinXP environment:
C:\>irb
irb(main):001:0> require 'socket'
=> true
irb(main):002:0> myStdin = ::Socket.for_fd($stdin.fileno)
=> #<Socket:0x2c091c4>
irb(main):003:0> myStdin.gets
Hello World
=> "Hello World\n"
irb(main):004:0>

I am afraid I can't help you more for now.

Muriel

RE: Installing Redmine in SourceForge's projects' web space - Added by Muriel Salvan over 6 years ago

Don't know if this will still be useful to other people, but I came across the same error myself and investigated further.

Apparently this is thrown when your are using Rails 2 with fcgi on an Apache server that does not have mod_fastcgi installed.
Therefore the server sockets can't be created correctly, hence the error.

The only solution I see to this problem is to install mod_fastcgi Apache module.

Hope this will help.

Muriel

(1-8/8)