Raspberry pi上建立簡易Git Server及Redmine 專案管理

Raspberry Pi是個很利害的小東西,只要使用的軟體不算大,幾乎可以承受10人小公司的伺服器的需求,甚至可以將GitLab安裝在Raspberry Pi上(前提是不怕慢),有興趣的人可以上GitLab查看安裝方式。

如果在不得已的情況下,或不想花太多錢,Raspberry pi上建立簡易Git Server及Redmine 專案管理也是不錯的選擇。


1. 先安裝Git


    command-line:sudo apt-get install git-core


2. 在/srv下建立git資料夾


    command-line:sudo mkdir /srv/git


3. 建立git群組


    command-line:sudo groupadd git


4. 建立使用者並加入git群組


    command-line:sudo adduser michael


    command-line:sudo usermod -a -G git michael


5. 建立專案資料夾


    command-line:sudo mkdir /srv/git/project.git


6. 專案初始化並設成可分享


    command-line:cd /srv/git/project.git


    command-line:sudo git init –bare –shared


    command-line:sudo chgrp -R git /srv/git


    command-line:sudo chmod g+rwx -R /srv/git


7. 將專案設給使用者遠端協同作業


    command-line:sudo git remote add origin ssh://michael@git.localhost.com/srv/git/project.git/


8. client就可以連線下載這個空的專案,再把已經準備好的檔案push上去到master即可,這樣這個專案就有可供下載的檔案.


===========以下為Redmine 的部份==============================================
1. 安装apache2及相關套件


    command-line:sudo apt-get install apache2 libapache2-mod-passenger


2. 安装mysql


    command-line:sudo apt-get install mysql-server mysql-client


3. 安裝redmine及mysql相關套件


    command-line:sudo apt-get install redmine redmine-mysql


    command-line:sudo gem update


    command-line:sudo gem install bundler


4. 設定apache2


    command-line:sudo vim /etc/apache2/mods-available/passenger.conf


    <IfModule mod_passenger.c>
     PassengerDefaultUser www-data  <===  加入這行即可,其他的都不要動
     PassengerRoot /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini
     PassengerDefaultRuby /usr/bin/ruby
     </IfModule>


    command-line:sudo ln -s /usr/share/redmine/public /var/www/html/redmine


    command-line:sudo vim /etc/apache2/sites-available/000-default.conf


    在VirtualHost裡加入以下設定
     <Directory /var/www/html/redmine>
     RailsBaseURI /redmine
     PassengerResolveSymlinksInDocumentRoot on
     </Directory>


    command-line:sudo touch /usr/share/redmine/Gemfile.lock


    command-line:sudo chown www-data:www-data /usr/share/redmine/Gemfile.lock


    command-line:sudo service apache2 restart

留言

熱門文章