Newbie Question re. Installing Redmine (a Ruby Application)


TwistMyArm

Recommended Posts

Hi all,

I'm looking to install Redmine on my shared hosting account. It's a Ruby application quite similar to Trac but support for multiple projects etc.

Firstly, I guess, the question is: has anyone here installed Redmine before? If so, can you give me some pointers on how to go about doing it?

If not, I can always muddle through things myself :) If that is to be the case, though, do I need to organise shell access to install the application, or is there some way to do it through cPanel?

Any hints, tips, pointers or suggestions for a better place to ask here are more than welcome.

Thanks!

Link to comment
Share on other sites

Hi all,

I'm looking to install Redmine on my shared hosting account. It's a Ruby application quite similar to Trac but support for multiple projects etc.

Firstly, I guess, the question is: has anyone here installed Redmine before? If so, can you give me some pointers on how to go about doing it?

If not, I can always muddle through things myself :) If that is to be the case, though, do I need to organise shell access to install the application, or is there some way to do it through cPanel?

Any hints, tips, pointers or suggestions for a better place to ask here are more than welcome.

Thanks!

I use Redmine daily for numerous projects I manage / am part of. The documentation they provide is somewhat decent, though they don't go over how to set it up in an environment similar to ours. Unfortunately I haven't tried setting it up on a cPanel based host such as ourselves so I can't really point you in the right direction. If I can find some time I'll see if I can get it running / make a quick how-to for you (don't count on this we're swamped)!

If you're able to get it installed / working properly please post how you did it here as other people will undoubtedly find it useful :)

http://www.redmine.org/wiki/redmine/HowTos

Link to comment
Share on other sites

I have tried it and had it working at a Hawk Host shared hosting account, though it was a year back or so. The installation is pretty straight-forward if you have Shell access. There is one thing though in getting the app to run properly from cPanel, but I cannot remember what it was. If you don't do it right there, there's a process that starts taking 100% of one CPU core and you'll have to stop that. Once that's been fixed it works perfectly (without local subversion, that is)!

But like I said, this was all over a year ago. Perhaps I'll try again soon and create a how-to, might be useful :)

Edit: it appears to work with external subversion repositories. That, plus it's multi-project feature, gives it a bug plus over Trac from that point of view.

Edited by mistermartin75
Link to comment
Share on other sites

Cool, well thanks for the notes guys.

I guess I'll start out with getting SSH / shell access and go from there, then :)

@Cody: I'll definitely try and keep some notes and write up some documentation here, too, unless mistermartin75 beats me to it.

Just out of curiosity: as I'm going along, if I have any problems is it better to ask in the forums, or as support tickets? Unfortunately I think I'm one of those guys that knows just enough to get into trouble!

Link to comment
Share on other sites

Here's a short how-to. Redmine works in the end via the built-in webrick server (DO NOT USE THIS!) but I can't reach it via the 12xxx port (connection times out), so that's something to look in to. It could be solved by rewrites, but I was yet unsuccesfull.

1) Check Ruby and Rails versions:


ruby -v

rails -v

2) Checkout the matching Redmine version (trunk for Hawk Host) to a directory of your choice (mine was /home/*username*/redmine):

svn co http://redmine.rubyforge.org/svn/trunk/ .

3) Create a database in cPanel 4) Edit config/enviroment.rb and comment out the line:

RAILS_GEM_VERSION = '2.3.4' unless defined? RAILS_GEM_VERSION

5) Follow steps 3 - 6 from: http://www.redmine.org/wiki/redmine/RedmineInstall

6) Go to cPanel, 'Ruby on Rails' and press 'Start'

7) You're all set (if ports 12xxx) works.

Easy, isn't it? Well, except for the 12xxx ports :P

Edited by mistermartin75
Link to comment
Share on other sites

Once it does the ports in cPanel you add a rewrite to make it accessible for web pages since each mongrel process runs their own port. cPanel should have the option right on the Ruby page.

It doesn, though it doesn't work for subdirectories. I'm not really a mod_rewrite expert and I didn't have time to look it up, but it's not working as expected (not Hawk Host's fault, mind).

Link to comment
Share on other sites

Here's a short how-to. Redmine works in the end via the built-in webrick server (DO NOT USE THIS!) but I can't reach it via the 12xxx port (connection times out), so that's something to look in to. It could be solved by rewrites, but I was yet unsuccesfull.

Thanks for the links etc. I was able to get fairly far myself last night, but I too started butting heads against port 12xxx timing out.

I've pulled together a heap of 'stuff' from around the web so I'm just about to start trying again tonight. Suffice to say if I find anything I will let all know.

Once it does the ports in cPanel you add a rewrite to make it accessible for web pages since each mongrel process runs their own port. cPanel should have the option right on the Ruby page.

Just to be clear where I experienced my issue: in the "Available Ruby on Rails Applications" table I had an entry for Redmine and there was a link there ("URL") in the "Rails Server" column to http://myservername:12012 . Following that link, though, the page timed out. I'm assuming the rewrite wouldn't help that, right?

Like I say, I'm going to check a few more things tonight and see if I can crack this egg.

As always, thanks to all for the help!

Link to comment
Share on other sites

Just to be clear where I experienced my issue: in the "Available Ruby on Rails Applications" table I had an entry for Redmine and there was a link there ("URL") in the "Rails Server" column to http://myservername:12012 . Following that link, though, the page timed out. I'm assuming the rewrite wouldn't help that, right?

Like I say, I'm going to check a few more things tonight and see if I can crack this egg.

As always, thanks to all for the help!

What you experienced is exactly what you'd expect. We do not open up the mongrel ports to be accessible. Could expose things you would not like exposed plus we don't know just how many ruby apps one server would see. So we'd have to open up a good chunk of ports to cover it. Since you wouldn't want people accessing via the port makes sense to just have the rewrite rule handle it.

Link to comment
Share on other sites

What you experienced is exactly what you'd expect. We do not open up the mongrel ports to be accessible.
Tony: as per usual, that makes a lot of sense :)

It doesn, though it doesn't work for subdirectories.
I'm guessing this is the problem that I saw this evening: I created a redirect as a subdirectory under my main domain (that is to say, http://mydomainname/redmine ) but hitting that subdirectory, I got a 404.

After that, I tried defining a subdomain (code.mydomainname) and then set the rewrite for the application to the root of that subdomain. That worked, for the basic front page... unfortunately all of the links, the stylesheets and all that still return a 404.

I really appreciate your help, guys, but I'm wondering if I'm just a little in over my head trying to sort this out :)

Edited by TwistMyArm
Removing my actual domain name
Link to comment
Share on other sites

Just to be clear where I experienced my issue: in the "Available Ruby on Rails Applications" table I had an entry for Redmine and there was a link there ("URL") in the "Rails Server" column to http://myservername:12012 . Following that link, though, the page timed out. I'm assuming the rewrite wouldn't help that, right?

If the rewrite would also work for subdirectories and/or other links, it should work very well.

The argument against opening those ports is a really valid one, and properly functioning rewrites would definitely solve the issue. of having closed ports.

Link to comment
Share on other sites

Well I've found a solution :)

Firstly, I just want to say that:

a) this may not be the right way to do it; and

B) it may only apply to my situation (that is the one where I had the subdomain being redirected to the appropriate port)

Remembering that the subdomain was already pointing into a subdirectory on the main site, I had a look in that directory to see if anything popped out.

In that directory was a .htaccess file, with the following rewrite rule:

RewriteRule ^/?$ "http://127.0.0.1:12012%{REQUEST_URI}" [P,QSA,L]

That kind of looked suspicious: why was it only redirecting the call to the root? So I added:

RewriteRule ^(.*)$ "http://127.0.0.1:12012%{REQUEST_URI}" [P,QSA,L]

straight after it and voila, it seems to work.

I'm going to essentially delete everything tonight and try it all again, though, and document it all correctly. Before I do that, though, does anyone see any problems with what I did?

Thanks to all for your tips and comments!

Lincoln.

Link to comment
Share on other sites

OK, so for anyone else that is trying to follow this, I just wanted to write down all of the steps that I took to get Redmine working. It may be possible to cut it down somewhat, but it works.

One last time: thanks to everyone for the help.

----------------------------------------

At the moment, 0.8.5 is the latest version: that is the one that I will refer to.

The following assumes that you will be installing Redmine such that it runs from a subdomain (without a subdirectory)...

1) Get SSH access for your account

2) Open your cPanel interface

3) Create a database (I named my 'redmine', which resulted in a database actually called myusername_redmine)

4) Create a database user (I named my 'redmine', which resulted in a user actually named myusername_redmine)

5) Give the new user full rights to the new database

6) Create a subdomain (I used code.mydomain.com, which resulted in a directory being created at ~/public_html/code)

7) Create a Rails application named 'redmine'

8) Stop the newly created application (if it's running)

9) Download the file redmine-0.8.5.tar.gz from http://rubyforge.org/frs/?group_id=1850

10) Upload the redmine-0.8.5.tar.gz file to your home directory on the Hawkhost server

11) Open your SSH interface

12) Switch to the ~/etc/rails_apps/redmine directory

13) Delete everything in the directory: rm -rf *

14) Copy redmine-0.8.5.tar.gz from your home directory to ~/etc/rails_apps/redmine

15) Extract the file: tar -zxvf redmine-0.8.5.tar.gz

16) Switch into the redmine-0.8.5 directory and move everything to the parent directory: mv * ..

17) Switch back to the parent directory and remove the now empty redmine-0.8.5 directory: rmdir redmine-0.8.5

18) Copy the example database YML file: cp config/database.yml.example config/database.yml

19) Open config/database.yml in your editor of choice

20) Find the section that looks like:

production:

adapter: mysql

database: redmine

host: localhost

username: redmine

password: my_password

and set the correct value for the 'database' line, the 'username' line and the 'password' line.

21) Save the file and exit back to the command line.

22) Create the database structure: rake db:migrate RAILS_ENV="production"

23) Add the default configuration data: rake redmine:load_default_data RAILS_ENV="production"

24) Switch to cPanel

25) Add a rewrite for the Redmine application: on the Rails application page, click 'Create a Rewrite' for the Redmine application. On the next page, change the dropdown so that it has the correct subdomain selected. Leave the text box empty and click 'Save'.

26) Start the Redmine application

26) Switch to SSH

27) Edit the .htaccess file in the directory that was originally created for your subdomain. In my case, this is the ~/public_html/code/.htaccess file.

28) After the line:

RewriteRule ^/?$ "http://127.0.0.1:12012%{REQUEST_URI}" [P,QSA,L]

add the line:

RewriteRule ^(.*)$ "http://127.0.0.1:12012%{REQUEST_URI}" [P,QSA,L]

29) Save the file and exit back to the command line.

30) Send your browser to the subdomain you created and see your Redmine application running. Default username is 'admin', default password is 'admin'.

Link to comment
Share on other sites

  • 3 months later...
OK, so for anyone else that is trying to follow this, I just wanted to write down all of the steps that I took to get Redmine working. It may be possible to cut it down somewhat, but it works.

One last time: thanks to everyone for the help.

----------------------------------------

At the moment, 0.8.5 is the latest version: that is the one that I will refer to.

The following assumes that you will be installing Redmine such that it runs from a subdomain (without a subdirectory)...

1) Get SSH access for your account

2) Open your cPanel interface

3) Create a database (I named my 'redmine', which resulted in a database actually called myusername_redmine)

4) Create a database user (I named my 'redmine', which resulted in a user actually named myusername_redmine)

5) Give the new user full rights to the new database

6) Create a subdomain (I used code.mydomain.com, which resulted in a directory being created at ~/public_html/code)

7) Create a Rails application named 'redmine'

8) Stop the newly created application (if it's running)

9) Download the file redmine-0.8.5.tar.gz from http://rubyforge.org/frs/?group_id=1850

10) Upload the redmine-0.8.5.tar.gz file to your home directory on the Hawkhost server

11) Open your SSH interface

12) Switch to the ~/etc/rails_apps/redmine directory

13) Delete everything in the directory: rm -rf *

14) Copy redmine-0.8.5.tar.gz from your home directory to ~/etc/rails_apps/redmine

15) Extract the file: tar -zxvf redmine-0.8.5.tar.gz

16) Switch into the redmine-0.8.5 directory and move everything to the parent directory: mv * ..

17) Switch back to the parent directory and remove the now empty redmine-0.8.5 directory: rmdir redmine-0.8.5

18) Copy the example database YML file: cp config/database.yml.example config/database.yml

19) Open config/database.yml in your editor of choice

20) Find the section that looks like:

production:

adapter: mysql

database: redmine

host: localhost

username: redmine

password: my_password

and set the correct value for the 'database' line, the 'username' line and the 'password' line.

21) Save the file and exit back to the command line.

22) Create the database structure: rake db:migrate RAILS_ENV="production"

23) Add the default configuration data: rake redmine:load_default_data RAILS_ENV="production"

24) Switch to cPanel

25) Add a rewrite for the Redmine application: on the Rails application page, click 'Create a Rewrite' for the Redmine application. On the next page, change the dropdown so that it has the correct subdomain selected. Leave the text box empty and click 'Save'.

26) Start the Redmine application

26) Switch to SSH

27) Edit the .htaccess file in the directory that was originally created for your subdomain. In my case, this is the ~/public_html/code/.htaccess file.

28) After the line:

RewriteRule ^/?$ "http://127.0.0.1:12012%{REQUEST_URI}" [P,QSA,L]

add the line:

RewriteRule ^(.*)$ "http://127.0.0.1:12012%{REQUEST_URI}" [P,QSA,L]

29) Save the file and exit back to the command line.

30) Send your browser to the subdomain you created and see your Redmine application running. Default username is 'admin', default password is 'admin'.

Just noticed this - on my local server rails applications default to port 12002 NOT 12012

So I had to modify the re-write (step 28) to this -> http://myservername:12002

But everything else worked great as long as I used Redmine package 'redmine-0.8.5' :D

Link to comment
Share on other sites

  • 2 months later...

First, thanks for such a useful post. This is the best How To Install Redmine guide for cPanel/Ruby! I would like add two things to keep in mind while following this How-To that may not be clear or if your server behaves like mines :huh:

The database once created with cPanel may not have the proper character set. It should be UTF-8!

3) Create a database (I named my 'redmine', which resulted in a database actually called myusername_redmine)

4) Create a database user (I named my 'redmine', which resulted in a user actually named myusername_redmine)

5) Give the new user full rights to the new database

- You have to make sure that the database character set is UTF-8 before importing any data. Some cPanel/MySQL services, by default, setup databases with character sets for "latin1_swedish_ci" and not "utf8_general_ci". This simple MySQL command can quickly fix that:

ALTER DATABASE `redmine_database` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ;
Once unpacking the tar file, check to see that the user and usergroup for the redmine files/directories are set to your proper server's user and usergroup.
15) Extract the file: tar -zxvf redmine-0.8.5.tar.gz
- After extraction, I noticed that the folder came with the default user:usergroup as 3000:3000. This simple SSH command line will fix that:
chown -R my_username:my_usergroup redmine-0.9.3
You may have to update your configuration on the .htaccess file
27) Edit the .htaccess file in the directory that was originally created for your subdomain. In my case, this is the ~/public_html/code/.htaccess file. 28) After the line: RewriteRule ^/?$ "http://127.0.0.1:12012%{REQUEST_URI}" [P,QSA,L] add the line: RewriteRule ^(.*)$ "http://127.0.0.1:12012%{REQUEST_URI}" [P,QSA,L] 29) Save the file and exit back to the command line.
- Be sure that the rewrite rule points to your server correctly and that it is using the proper port. Here is how it is setup on my server:
RewriteRule ^(.*)$ "http://example.com:12001%{REQUEST_URI}" [P,QSA,L]

I'm excited about using Redmine. Hope this helps. Thanks again for the post!

Link to comment
Share on other sites

  • 1 month later...

This post was awesome!! I've been trying to install Redmine for quite some time now lol.

However for those of you that have installed it via this method, how did you go about actually utilizing it? What steps did you take or additional setups did you do to start keeping track of development of files and creating changelogs?

I'm not too sure how to go about doing so now that I finally have redmine installed. Any advice, tips, etc will be greatly appreciated.

I really can't find guides online on how to use a SCM software on a shared hosting environment such as CPanel.

Link to comment
Share on other sites

This post was awesome!! I've been trying to install Redmine for quite some time now lol.

However for those of you that have installed it via this method, how did you go about actually utilizing it? What steps did you take or additional setups did you do to start keeping track of development of files and creating changelogs?

I'm not too sure how to go about doing so now that I finally have redmine installed. Any advice, tips, etc will be greatly appreciated.

I really can't find guides online on how to use a SCM software on a shared hosting environment such as CPanel.

Most people will compile GIT or just use ssh as a repository for Mercurial / GIT since they're distributed / support simple pulling and pushing.

Link to comment
Share on other sites

  • 4 weeks later...

Is there a possibility that the rails version can be updated to 2.3.5? We are currently at 2.3.4 of rails and with 2.3.5 I can finally update my redmine to the latest version and access some of the plug-ins I am looking for.

Thank you for your consideration

You should be able to update the rails version specific to your account. Just need to do it via the Ruby on Rails option in your cPanel.

Link to comment
Share on other sites

  • 3 months later...

You should be able to update the rails version specific to your account. Just need to do it via the Ruby on Rails option in your cPanel.

Hi Tony / Darren,

So I've only just around to looking at this myself and so I have a really stupid question... I'm looking at the RVSkin, 'Ruby on Rails' and I can't for the life of me work out how to actually update Rails. Any hints on that please?

Thanks :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...