WebFaction
Community site: login faq
0
1

I've used a hybrid of the notes from here and from here. Here's what I've done thus far:

echo "export PATH=$HOME/.rvm/bin:$PATH">>.bash_profile
bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
rvm install 1.9.2-p290
git clone git://github.com/gitlabhq/gitolite
gitolite/src/gl-system-install
sh -c "PATH=/home/******/bin:$PATH; gl-setup ~/gitrdone.pub"
chmod -R g+rwX /home/******/repositories
chown -R ******:****** /home/******/repositories
vim .gitolite.rc # changed the umask to 0007
mkdir src
cd src
wget http://www.sqlite.org/sqlite-autoconf-3070800.tar.gz
tar -zxvf sqlite-autoconf-3070800.tar.gz 
cd sqlite-autoconf-3070800
./configure --prefix=$HOME
make
make install
export LD_LIBRARY_PATH=$HOME/lib
export C_INCLUDE_PATH=$HOME/include
cd ~/src
wget http://redis.googlecode.com/files/redis-2.4.8.tar.gz
tar -zxvf redis-2.4.8.tar.gz
cd redis-2.4.8
make
make test
make PREFIX=/home/username/ install # This will install it to bin
mkdir -p lib/python2.7
easy_install-2.7 pip
pip install pygments
gem-ruby-1.9.2-p290 install bundler
git clone -b stable git://github.com/gitlabhq/gitlabhq.git
cd gitlabhq
redis-server # Used default conf variables and hit ctrl+z to background it (better to be daemonized, but I'm just trying to get it working at this point)
cp config/database.yml.example config/database.yml
cp config/gitlab.yml.example config/gitlab.yml
rvm --default use 1.9.2-p290
bundle install --without development test
bundle exec rake db:setup RAILS_ENV=production

When I run the last command I get the following error:

Access denied for user 'root'@'localhost' (using password: YES). 
Please provide the root password for your mysql installation
>
rake aborted!
Access denied for user 'root'@'localhost' (using password: NO)

Tasks: TOP => db:setup => db:schema:load_if_ruby => db:create
(See full trace by running task with --trace)

So the I created my mysql database and changed the values in config/database.yml to correlate with my newly created database values and got this error:

********* already exists
rake aborted!
Connection refused - Unable to connect to Redis on 127.0.0.1:6379

development:
Tasks: TOP => db:schema:load => environment
(See full trace by running task with --trace)

So then I made some arbitrary database name values in the previous file and got these errors:

rake aborted!
Mysql2::Error: Access denied for user '********'@'localhost' to database '********': CREATE DATABASE `*********` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`

Tasks: TOP => db:setup => db:schema:load_if_ruby => db:create
(See full trace by running task with --trace)

[edit] Tried editing the redis.rb file after adding a custom app listening on a port. vim ~/.rvm/gems/ruby-1.9.3-p125/gems/redis-2.2.2/lib/redis.rb:

bundle exec rake db:setup RAILS_ENV=production

*********** already exists
rake aborted!

Connection refused - Unable to connect to Redis on 127.0.0.1:16653

Tasks: TOP => db:schema:load => environment
(See full trace by running task with --trace)

asked 10 Mar '12, 21:45

ArrantSquid
26116
accept rate: 50%

edited 11 Mar '12, 07:09

Here's what the directory structure for gitlabhq looks like (ls -a):

app .bundle CHANGELOG config config.ru db doc .foreman Gemfile Gemfile.lock .git .gitignore lib LICENSE log Procfile Procfile.production public .rails_footnotes Rakefile README.md resque_dev.sh resque.sh .rspec script spec .travis.yml vendor VERSION

(10 Mar '12, 22:31) ArrantSquid

I think I have successfully installed gitlab, but I am struggling with the last part of making a website point to my custom app. Since this is installed in a whole new user outside of the ~/webapps directory, how to I enable one of my domains to point to gitlab?

(20 May '12, 17:49) Ross Hunter

As long as you are using a "Custom Application (listening on port)" application type, then this is actually very straightforward. There is no specific binding to your main user account, and the only thing that matters is the port which your application is listening on.

Specifically, a Custom Application (listening on port) works by forwarding all requests to a localhost port. If, for example, the assigned port for your Custom Application is 12345, then incoming requests will be forwarded to 127.0.0.1:12345, and any application listening on this address and port can receive and handle that request. So, it doesn't matter at all where your Gitlab is installed to or which user it's running under - as long as it's binding to 127.0.0.1 and listening on the appropriate port, then it will work.

So, to answer your question - all you need to do is use a website record in the control panel to point your domain to the custom application (listening on port), and then configure your gitlab application to bind to 127.0.0.1 on the port assigned by that custom application.

(20 May '12, 19:04) ryans ♦♦

NOTE: This procedure is out-dated and broken. DO NOT USE!

You'll need a new ssh user and a custom app setup before you do anything. Remember the port you're given for your custom port. You'll be doing all of this as the new ssh user that you've created.

Setup your ssh. On your client computer (your home machine):

cd $HOME/.ssh
ssh-keygen -t rsa # When prompted for a name use your ssh username. DO NOT ENTER A PASSWORD!!! 
scp ~/.ssh/ssh_username ssh_username@yourwebsite.com:ssh_username
scp ~/.ssh/ssh_username.pub ssh_username@yourwebsite.com:ssh_username.pub

Now go onto your server with your ssh user:

chmod 600 $HOME/.ssh/authorized_keys
chmod 700 $HOME/.ssh
cp $HOME/ssh_username $HOME/.ssh/id_rsa

Now run this command to save yourself some headaches later:

git config --global user.email "you@example.com"
git config --global user.name "Your Name"

Now install gitolite:

git clone git://github.com/gitlabhq/gitolite
gitolite/src/gl-system-install 
sh -c "PATH=/home/username/bin:$PATH; gl-setup ~/username.pub" # change the $REPO_UMASK value to 0007 from 0077 when the vi window comes up.
chmod -R g+rwX /home/username/repositories
chown -R username:username /home/username/repositories
vim .gitolite.rc # only do this if you didn't change the umask value earlier
setfacl -R -m u:<main-user>:rwx ~/repositories

Then install some non-standard libraries (sqlite3 and redis):

cd 
mkdir src
cd src
wget http://www.sqlite.org/sqlite-autoconf-3070800.tar.gz
tar -zxvf sqlite-autoconf-3070800.tar.gz 
cd sqlite-autoconf-3070800
./configure --prefix=$HOME
make
make install
export LD_LIBRARY_PATH=$HOME/lib
export C_INCLUDE_PATH=$HOME/include
cd ~/src
wget http://redis.googlecode.com/files/redis-2.4.8.tar.gz
tar -zxvf redis-2.4.8.tar.gz
cd redis-2.4.8
make
make test
make PREFIX=/home/username/ install # This will install it to bin

Now we need to configure redis:

cp ~/src/redis-2.4.8/redis.conf ~/.
vim ~/redis.conf # Change the line that says daemonize no to daemonize yes
redis-server ~/redis.conf # This starts the redis-server daemonized

Install our ruby stuff and gitlab:

echo "export PATH=$HOME/.rvm/bin:$PATH">>.bash_profile
source ~/.bash_profile
bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
rvm install 1.9.2-p290
mkdir -p lib/python2.7
easy_install-2.7 pip
pip install pygments
gem-ruby-1.9.2-p290 install bundler
git clone -b stable git://github.com/gitlabhq/gitlabhq.git
cd gitlabhq
cp config/database.yml.example config/database.yml
cp config/gitlab.yml.example config/gitlab.yml

Now we need to update our gitlab.yml file. Open the config/gitlab.yml editor (vim, emacs, nano): Change admin_uri to your ssh username and the urls you're using (eg gituser@git.asdf.com:gitolite-admin). Change the base path to reflect your ssh username (eg /home/gituser/repositories). Change your host to your host (eg git.asdf.com) and change your git_user to your ssh username. Uncomment the port.

Continue setting up the gitlab stuff:

rvm --default use 1.9.2-p290
bundle install --without development test
bundle exec rake db:setup RAILS_ENV=production
bundle exec rake db:seed_fu RAILS_ENV=production

Now you'll need to run:

bundle exec rails s -e production -p <your_custom_port> -d
$HOME/gitlabhq/resque.sh

Now that that's running you've got a running install of gitlab. You'll need to point that custom app to a domain name, but once that's done you'll be good to go.

Now just so you're aware after reading this, with 3 users logged into gitlab it takes up about 115mb of ram (just browsing no commits), so you need to be aware that it's a resource hog and you'll probably need to get extra ram (which is a problem with most RoR apps). Also, if you don't set the git config --global stuff and you add users, you'll screw up your install and have to re-install since it fails on that, but still adds the user.

This was all figured out with the help of some awesome folks at webfaction who put up with about 56 messages from me with all of my very long and detailed output. So big thanks to Neerav K, Ryan S, Björn M, Todor K and Ilias R. You guys rock.

permanent link

answered 11 Mar '12, 04:21

ArrantSquid
26116
accept rate: 50%

edited 12 Oct '13, 21:54

likebike
3366

Were you able to successfully install gitlabhq in web faction? I am trying for the same and would like to know if these steps are followed in sequence, will it make ti happen? What is your personal experience using gitlabhq? Is it worth the installation?

(14 May '12, 02:27) talktoari

I just wanted to make sure that if I start and follow that in order, I will be able to get it up and running in my web faction account. Let me know.

Do I select Rails as the app while trying to create a new app in my web faction account? By default web faction has ruby 1.9.3 for the latest choice of rails app. Shall I chose that or do a custom installation of ruby 1.9.2p0? Will I be able to install all the libraries and packages needed or are they already installed in webfaction?

(14 May '12, 02:28) talktoari

in part

Install our ruby stuff and gitlab:

  echo "export PATH=$HOME/.rvm/bin:$PATH">>.bash_profile

  rvm install 1.9.2-p290

if you get

  -bash: rvm: command not found

do

   source ~/.bash_profile

and then try

  rvm install 1.9.3

it should work

permanent link

answered 18 Apr '12, 14:08

Manraj Singh
11
accept rate: 0%

edited 18 Apr '12, 14:09

Thanks for your comment, Manraj. I have incorporated the 'source' command into ArrantSquid's answer.

(11 Oct '13, 18:36) likebike

I'm working through this and running into some issues, here:

My guess is I've run off the rails (no pun intended) with a file folder specification somewhere. What I'm trying to figure out is, where do I fix the 'pointer' that is pointing to 'earleygitlab' and then gitlabhq, where it should be going straight to /gitlabhq.

[earleygitlab@web400 gitlabhq]$ bundle exec rake db:setup RAILS_ENV=production
rake aborted!
No such file or directory - /home/earleygitlab/gitlabhq/config/database.yml
/home/earleygitlab/.rvm/gems/ruby-1.9.3-p448/gems/railties-        3.2.13/lib/rails/application/configuration.rb:115:in `read'
/home/earleygitlab/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.13/lib/rails/application/configuration.rb:115:in `database_configuration'
/home/earleygitlab/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.13/lib/active_record/railties/databases.rake:25:in `block (2 levels) in <top     (required)>'
/home/earleygitlab/.rvm/gems/ruby-1.9.3-p448/bin/ruby_executable_hooks:15:in `eval'
/home/earleygitlab/.rvm/gems/ruby-1.9.3-p448/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => db:setup => db:schema:load_if_ruby => db:create => db:load_config
permanent link

answered 08 Oct '13, 09:56

earleymw
1
accept rate: 0%

1

Looks to me that you don't have your database.yml file setup in the correct location. "No such file or directory - /home/earleygitlab/gitlabhq/config/database.yml" Ruby is a fickle being. Which is why after I did all of this I promptly removed it all. It's a resource hog and it doesn't really buy you anything outside of a UI to stare at. That being said, a missing file would crash any app. Do an ls on the directory you're running this from as well as in the config directory and post it here.

(08 Oct '13, 17:44) ArrantSquid

So based on the comment, I checked config and there was not a database.yml. I downloaded the sqlite3 one from a gist, but of course there is no support for it anymore, so i did

cp config/database.yml.mysql2 config/database.yml

I'm trying to install ANY database and continue getting errors.

[earleygitlab@web400 gitlabhq]$ bundle exec rake db:setup RAILS_ENV=production
rake aborted!
Please install the mysql2 adapter: `gem install activerecord-mysql2-adapter` (mysql2 is not part of the bundle. Add it to Gemfile.)
/home/earleygitlab/.rvm/gems/ruby-1.9.3-p448/gems/bundler-1.3.5/lib/bundler/rubygems_integration.rb:214:in `block     in replace_gem'
/home/earleygitlab/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-    3.2.13/lib/active_record/connection_adapters/mysql2_adapter.rb:3:in `<top (required)>'
/home/earleygitlab/.rvm/gems/ruby-1.9.3-p448/gems/backports-3.3.2/lib/backports/tools.rb:328:in `require'
/home/earleygitlab/.rvm/gems/ruby-1.9.3-p448/gems/backports-3.3.2/lib/backports/tools.rb:328:in         `require_with_backports'
/home/earleygitlab/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in     `block in require'
/home/earleygitlab/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
/home/earleygitlab/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
/home/earleygitlab/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_specification.rb:50:in `resolve_hash_connection'
/home/earleygitlab/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_specification.rb:29:in `spec'
/home/earleygitlab/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_specification.rb:130:in `establish_connection'
/home/earleygitlab/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.13/lib/active_record/railties/databases.rake:101:in `create_database'
/home/earleygitlab/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.13/lib/active_record/railties/databases.rake:62:in `block (3 levels) in <top (required)>'
/home/earleygitlab/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.13/lib/active_record/railties/databases.rake:62:in `each'
/home/earleygitlab/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.13/lib/active_record/railties/databases.rake:62:in `block (2 levels) in <top (required)>'
/home/earleygitlab/.rvm/gems/ruby-1.9.3-p448/bin/ruby_executable_hooks:15:in `eval'
/home/earleygitlab/.rvm/gems/ruby-1.9.3-p448/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => db:setup => db:schema:load_if_ruby => db:create
(See full trace by running task with --trace)
[earleygitlab@web400 gitlabhq]$

Note I've done as indicated and run install active-record...and also straight gem install mysql2.

permanent link

answered 10 Oct '13, 16:24

earleymw
1
accept rate: 0%

edited 11 Oct '13, 18:19

likebike
3366

Please send us a support ticket so we can troubleshoot the issue further.

(12 Oct '13, 01:22) johns

I documented the steps I took to get gitlab working...

https://gist.github.com/robmoggach/5da4b5ed8f994a036607

permanent link

answered 09 Nov '14, 02:25

mogga
213
accept rate: 0%

edited 23 Jan '15, 04:24

The link returns a 404 :(

(22 Jan '15, 21:47) pjrobertson

fixed. I changed my github username - sorry about that. Keep in mind this uses ALOT of ram.

(23 Jan '15, 04:25) mogga
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×111
×5
×4
×2

question asked: 10 Mar '12, 21:45

question was seen: 12,938 times

last updated: 23 Jan '15, 04:25

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM