Skip to content

Instantly share code, notes, and snippets.

@nielsbasjes
Forked from ddunlop/gist:659756
Created November 6, 2010 21:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nielsbasjes/665730 to your computer and use it in GitHub Desktop.
Save nielsbasjes/665730 to your computer and use it in GitHub Desktop.
as root
$ yum update
$ shutdown -r 0
back as root
$ cd /usr/local/src
$ wget http://dag.wieers.com/rpm/packages/rpmforge-release/rpmforge-release-0.5.1-1.el5.rf.i386.rpm
$ rpm -Uvh rpmforge-release-0.5.1-1.el5.rf.i386.rpm
$ yum -y install git apg GeoIP httpd httpd-devel mysql mysql-server mysql-devel sqlite sqlite-devel libjpeg libjpeg-devel readline-devel curl-devel pcre pcre-devel zlib zlib-devel openssl openssl-devel libyaml libyaml-devel gcc gcc-c++ autoconf automake java-1.6.0-openjdk java-1.6.0-openjdk-devel sphinx mod_xsendfile memcached
$ service mysqld start
$ chkconfig mysqld on
$ mysqladmin -u root password '[MYSQL_PASSWORD]'
$ mysql -u root -p
> CREATE DATABASE gitorious;
> CREATE USER 'gitorious'@'localhost' IDENTIFIED BY '[GITORIOUS_MYSQL_PASSWORD]';
> GRANT ALL PRIVILEGES ON gitorious.* TO 'gitorious'@'localhost';
# One command of 7 lines!
$ echo 'export PATH=/opt/ruby-enterprise/bin:$PATH
export LD_LIBRARY_PATH="/usr/local/lib"
export LDFLAGS="-L/usr/local/lib -Wl,-rpath,/usr/local/lib"
export RUBY_HOME=/opt/ruby-enterprise
export GEM_HOME=$RUBY_HOME/lib/ruby/gems/1.8
export PATH=$RUBY_HOME/bin:$PATH' > /etc/profile.d/ruby.sh
$ echo "/usr/local/lib" > /etc/ld.so.conf.d/locallib.conf
# Logout and login. Or simply start a new shell by typing "bash"
$ bash
$ ldconfig
$ cd /usr/local/src
$ wget 'http://www.geocities.jp/kosako3/oniguruma/archive/onig-5.9.1.tar.gz'
$ tar -zxvf onig-5.9.1.tar.gz
$ cd onig-5.9.1
$ ./configure
$ make && make install
$ cd ..
# TODO: Why is the standard available ImageMagick not good enough?
$ wget ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick-6.6.5-5.tar.bz2
$ tar jxvf ImageMagick-6.6.5-5.tar.bz2
$ cd ImageMagick-6.6.5-5
$ ./configure --prefix=/usr
$ make && make install
$ cd ..
$ wget 'http://apache.spd.co.il/activemq/apache-activemq/5.3.2/apache-activemq-5.3.2-bin.tar.gz'
$ tar xzvf apache-activemq-5.3.2-bin.tar.gz -C /opt/
$ ln -s /opt/apache-activemq-5.3.2 /opt/apache-activemq
$ chown root:root -R /opt/apache-activemq-5.3.2/
$ echo "export ACTIVEMQ_HOME=/opt/apache-activemq" >> /etc/activemq.conf
$ echo "export JAVA_HOME=/usr/" >> /etc/activemq.conf
$ echo "export ACTIVEMQ_OPTS=\"-Xmx512M\"" >> /etc/activemq.conf
# Change the config to work as described here: http://activemq.apache.org/web-console.html
$ vi /opt/apache-activemq/webapps/camel/WEB-INF/applicationContext.xml
# backup activemq.xml
$ mv /opt/apache-activemq/conf/activemq.xml /opt/apache-activemq/conf/activemq.xml.org
# use stomp config:
$ cp /opt/apache-activemq/conf/activemq-stomp.xml /opt/apache-activemq/conf/activemq.xml
*** TODO add this as a startup script --> http://activemq.apache.org/unix-service.html
I setup the /etc/init.d/activemq but didn't use it did:
$ cd /opt/apache-activemq/bin/linux-x86-32 # THE DIRECTORY DEPENDS ON YOUR PLATFORM !
$ ./activemq start
RUBY
$cd /usr/local/src
$ wget http://rubyforge.org/frs/download.php/71096/ruby-enterprise-1.8.7-2010.02.tar.gz
$ tar zxvf ruby-enterprise-1.8.7-2010.02.tar.gz
$ cd ruby-enterprise-1.8.7-2010.02
$ ./installer # Select all default values
$ ln -s /opt/ruby-enterprise-1.8.7-2010.02 /opt/ruby-enterprise
gem install -b --no-ri --no-rdoc rmagick chronic geoip daemons hoe echoe ruby-yadis ruby-openid mime-types diff-lcs json ruby-hmac rake stompserver rails ultrasphinx
gem install -b --no-ri --no-rdoc -v 1.0 raspell
gem install -b --no-ri --no-rdoc -v 1.0.1 rack
gem install -b --no-ri --no-rdoc -v 1.3.1.1 rdiscount
gem install -b --no-ri --no-rdoc -v 1.1 stomp
gem uninstall -v 3.0.0 passenger
gem install -b --no-ri --no-rdoc -v 2.2.11 passenger
#gem uninstall -v 1.2.1 rack
# This next one because of this: http://www.mail-archive.com/gitorious@googlegroups.com/msg01619.html
gem uninstall i18n
$ cd /opt
$ git clone git://gitorious.org/gitorious/mainline.git gitorious
$ ln -s /opt/gitorious/ /var/www/gitorious
$ ln -s /opt/gitorious/script/gitorious /usr/local/bin/gitorious
$ rm -f /opt/gitorious/public/.htaccess
$ cd /var/www/gitorious
$ mkdir tmp/pids
$ mkdir public/tarballs-cache
$ mkdir public/tarballs-work
$ mkdir /opt/gitrepos/
adduser git
chown -R git:git /opt/gitorious
chown -R git:git /opt/gitrepos
mkdir /var/git
chown -R git:git /var/git
su - git
edit .bash_profile
append:
export RUBY_HOME=/opt/ruby-enterprise
export GEM_HOME=$RUBY_HOME/lib/ruby/gems/1.8
export PATH=$RUBY_HOME/bin:$PATH
source .bash_profile
mkdir ~/.ssh
chmod -R 700 /home/git/.ssh
touch /home/git/.ssh/authorized_keys
chmod 600 /home/git/.ssh/authorized_keys
mkdir /opt/gitorious/repos
chmod -R 700 /opt/gitorious/repos
cd /var/www/gitorious
cd /var/www/gitorious/config
cp database.sample.yml database.yml
cp gitorious.sample.yml gitorious.yml
cp broker.yml.example broker.yml
edit database.yml - make sure to change production to have the same values as we used in creating the database in MySQL (near the top of this checklist).
edit gitorious.yml -- use `apg -m 64` for cookie_secret then put on one line make sure your changing production
** TODO - show config
#The "production:" seection in the example is EMPTY. So make sure you fill that one!
# Specific settings to take note of:
repository_base_path: "/opt/gitrepos"
archive_cache_dir: "/opt/gitorious/public/tarballs-cache"
archive_work_dir: "/opt/gitorious/public/tarballs-work"
$ rake gems:install RAILS_ENV=production
$ rake db:migrate RAILS_ENV=production
$ rake ultrasphinx:bootstrap RAILS_ENV=production
$ crontab -e
* */1 * * * cd /var/www/gitorious && /usr/local/ruby/rake ultrasphinx:index RAILS_ENV=production
disable gitorious ssl:
edit /var/www/gitorious/config/environments/production.rb and add a line:
SslRequirement.disable_ssl_check = true
# go back to being root
passenger-install-apache2-module
Create a new file called /etc/httpd/conf.d/gitorious.conf
LoadModule passenger_module /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-2.2.11/ext/apache2/mod_passenger.so
PassengerRoot /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-2.2.11
PassengerRuby /opt/ruby-enterprise/bin/ruby
<VirtualHost *:80>
ServerName git.forbes.com
DocumentRoot /var/www/gitorious/public
<Directory /var/www/gitorious/public>
AllowOverride all
Options -MultiViews
</Directory>
</VirtualHost>
$ chkconfig httpd on
$ service httpd start
$ cd /etc/init.d
$ cp /opt/gitorious/doc/templates/centos/git-daemon .
$ chmod +x git-daemon
$ chkconfig --add git-daemon
$ chkconfig git-daemon on
$ service git-daemon start
$ cp /opt/gitorious/doc/templates/centos/git-ultrasphinx .
$ chmod +x git-ultrasphinx
$ chkconfig --add git-ultrasphinx
$ service git-ultrasphinx restart
$ chkconfig memcached on
$ service memcached start
edit /etc/init.d/gitorious-poller
#!/bin/sh
#
# poller Startup script for Gitorious's poller
#
# chkconfig: - 86 15
# description: Gitorious's poller script is simple worker that polls \
# tasks from stomp server queue and executes them.
# processname: poller
/bin/su - git -c "cd /var/www/gitorious; RAILS_ENV=production ./script/poller $@"
$ chmod +x gitorious-poller
$ chkconfig --add gitorious-poller
$ chkconfig gitorious-poller on
$ service gitorious-poller start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment