参考
- http://d.hatena.ne.jp/bannyan/20090131/1233399237
- http://d.hatena.ne.jp/Hirohiro/20090522/1243016921 (おすすめ)
- http://gitorious.org/gitorious/mainline/blobs/master/doc/recipes/install-ubuntu.txt と
- http://gitorious.org/gitorious/mainline/blobs/master/doc/README
- http://gitorious.org/gitorious/pages/UbuntuInstallation
- http://cjohansen.no/en/ruby/setting_up_gitorious_on_your_own_serverにかかれているとおり.
基本ライブラリをdebでいれる.
apt-get install -y build-essential apache2 mysql-server mysql-client git git-svn apg geoip-bin libgeoip1 libgeoip-dev sqlite3 libsqlite3-dev imagemagick libpcre3 libpcre3-dev zlib1g zlib1g-dev libyaml-dev libmysqlclient15-dev apache2-dev postfix
apt-get install libonig2 memcached aspell-en aspell libaspell-dev
wget http://www.sphinxsearch.com/downloads/sphinx-0.9.8.tar.gz
tar xvfz sphinx-0.9.8.tar.gz
cd sphinx-0.9.8
./configure && make && make install
cd /home/gitorious
git clone git@gitorious.org/gitorious/mainline.git
apt-get install uuid uuid-dev openjdk-6-jre
wget http://www.powertech.no/apache/dist/activemq/apache-activemq/5.2.0/apache-activemq-5.2.0-bin.tar.gz
tar xzvf apache-activemq-5.2.0-bin.tar.gz -C /usr/local/
adduser --system --no-create-home activemq
echo "export ACTIVEMQ_HOME=/usr/local/apache-activemq-5.2.0" >> /etc/activemq.conf
echo "export JAVA_HOME=/usr/" >> /etc/activemq.conf
chown -R activemq /usr/local/apache-activemq-5.2.0/data
/usr/local/apache-activemq-5.2.0/conf/activemq.xml の書き換え
<networkConnector name="localhost" uri="static://(tcp://127.0.0.1:61616)"/>
wget http://launchpadlibrarian.net/15645459/activemq
mv activemq /etc/init.d
chmod +x /etc/init.d/activemq
REEのインストール
wget http://rubyforge.org/frs/download.php/64475/ruby-enterprise-1.8.7-20090928.tar.gz
apt-get install libreadline5-dev
展開して installというスクリプトを叩くとインストール開始.
おわるとこんなのが表示.
If want to use Phusion Passenger (http://www.modrails.com) in combination
with Ruby Enterprise Edition, then you must reinstall Phusion Passenger against
Ruby Enterprise Edition, as follows:
/opt/ruby-enterprise-1.8.7-20090928/bin/passenger-install-apache2-module
Make sure you don't forget to paste the Apache configuration directives that
the installer gives you.
If you ever want to uninstall Ruby Enterprise Edition, simply remove this
directory:
/opt/ruby-enterprise-1.8.7-20090928
/etc/profileに追加
export PATH=/opt/ruby-enterprise-1.8.7-20090928/bin:$PATH
export LD_LIBRARY_PATH="/usr/local/lib"
export LDFLAGS="-L/usr/local/lib -Wl,-rpath,/usr/local/lib"
source /etc/profile
passengerのインストーラ起動
passenger-install-apache2-module
/etc/apache2/mods-available/passenger.loadを作る
LoadModule passenger_module /opt/ruby-enterprise-1.8.7-20090928/lib/ruby/gems/1.8/gems/passenger-2.2.5/ext/apache2/mod_passenger.so
PassengerRoot /opt/ruby-enterprise-1.8.7-20090928/lib/ruby/gems/1.8/gems/passenger-2.2.5
PassengerRuby /opt/ruby-enterprise-1.8.7-20090928/bin/ruby
a2enmod passenger
/etc/apache2/sites-available/gitoriousを編集してからa2ensite gitorious
<VirtualHost *:80>
ServerName codes.mlab.t.u-tokyo.ac.jp
DocumentRoot /home/gitorious/gitorious/public # <-- be sure to point to 'pu
blic'!
</VirtualHost>
gitoriousに必要なgemをいれる.
apt-get install libonig-dev libmagick9-dev
gem install raspell mime-types oniguruma textpow chronic BlueCloth ruby-yadis ruby-openid rmagick geoip ultrasphinx rspec rspec-rails RedCloth echoe daemons geoip --no-rdoc --no-ri
gitoriousの設定
public/.htaccsss 以下のように書いてあるのを消した.
RewriteEngine on
RewriteRule ^projects/([a-zA-z0-9\-_]+)/?$ /$1 [R=301,L]
RewriteRule ^projects/([a-zA-z0-9\-_]+)/repos/([a-zA-z0-9\-_]+)(.+)?$ /$1/$2$3 [R=301,L]
/etc/init.dに必要なdaemonを追加
doc/templates/ubuntu/{git-ultrasphinx,git-daemon} を /etc/init.d以下にコピーしてかきかえる.そして chmod +x しとく.
root@codes:/etc/init.d# update-rc.d git-ultrasphinx start 99 2 3 4 5 .
root@codes:/etc/init.d# update-rc.d git-daemon start 99 2 3 4 5 .
git userをつくる
adduser git
chown -R git:git /home/gitorious
su - git
*.ymlの設定
config/database.ymlをexampleからコピーして作成.rootのパスワードを設定する.
config/gitorious.ymlをいじる.重要なのは,cookie_secret, gitorious_host
rake をうごかしてみるといくつか足りないgemがあるようなので追加.
gem install rdiscount stomp diff-lcs json mocha
gem install rdiscount -v 1.3.1.1
gem install ruby-hmac
rakeしまくり.
rake tmp:create
rake db:create RAILS_ENV=production
rake db:migrate RAILS_ENV=production
rake ultrasphinx:bootstrap RAILS_ENV=production
.bash_profile
export RUBY_HOME=/opt/ruby-enterprise-1.8.7-20090928
export GEM_HOME=$RUBY_HOME/lib/ruby/gems/1.8/gems
export PATH=$RUBY_HOME/bin:$PATH
logrotateの設定.
apacheにSSL設定
起動
- 本体はpassengerであがる.
- RAILS_ENV=production ./script/poller start
トラブル
ssh鍵が登録できない
broker.ymlを設定する.
gem install stompserver
ln -s /opt/ruby-enterprise-1.8.7-20090928/bin/stompserver /usr/bin
さらに /etc/init.d/stompを設定する.
aspellがおかしい.
http://millarian.com/programming/installing-aspell-and-raspell-for-ultrasphinx/ をまず見る.
rootでこれをやる.
rake ultrasphinx:spelling:build RAILS_ENV=production
0 件のコメント:
コメントを投稿