Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.86 KB | None | 0 0
  1.  
  2.  
  3.  
  4.  
  5. install scmgit postgresql84-server ruby18-postgres-pr ruby18-RMagick thin
  6.  
  7.  
  8. gem install rail -v=*
  9.  
  10.  
  11.  
  12. cp /mnt/usb/redmine-1.1.1.tar.gz /home/david
  13.  
  14.  
  15.  
  16. # cp /usr/pkg/share/examples/rc.d/pgsql /etc/rc.d/pgsql
  17.  
  18. # echo "pgsql=YES" >> /etc/rc.conf
  19.  
  20.  
  21.  
  22.  
  23.  
  24. $ /etc/rc.d/pgsql initdb -E unicode
  25.  
  26.  
  27.  
  28. /etc/rc.d/pgsql start
  29.  
  30.  
  31.  
  32.  
  33.  
  34. # su - pgsql
  35.  
  36. # createuser -I -E -P -S -R -D redmine # Enter the desired password we asked
  37.  
  38. # createdb -T template0 -O redmine -E UTF8
  39.  
  40.  
  41.  
  42.  
  43.  
  44. # cd ~_redmine
  45.  
  46. # tar xvfz redmine-0.8.6.tar.gz
  47.  
  48. # mv redmine-0.8.6 redmine # non obligatoire
  49.  
  50. # cd redmine
  51.  
  52.  
  53.  
  54.  
  55.  
  56. # cp config/database.yml.example config/database.yml
  57.  
  58.  
  59.  
  60.  
  61.  
  62. nano config/database.yml and add
  63.  
  64. production:
  65.  
  66. adapter: postgresql
  67.  
  68. database: redmine
  69.  
  70. host: localhost
  71.  
  72. username: redmine
  73.  
  74. password: my_pwd
  75.  
  76.  
  77.  
  78.  
  79.  
  80. RAILS_ENV=production rake db:migrate
  81.  
  82.  
  83.  
  84. RAILS_ENV=production rake redmine:load_default_data
  85.  
  86.  
  87.  
  88. # mkdir tmp public/plugin_assets
  89.  
  90. # sudo chown -R _redmine:_redmine files log tmp public/plugin_assets
  91.  
  92. # sudo chmod -R 755 files log tmp public/plugin_assets
  93.  
  94.  
  95.  
  96.  
  97.  
  98. Configure the thin server
  99.  
  100.  
  101.  
  102. Consider here that redmine is installed in /home/_redmine/redmine
  103.  
  104.  
  105.  
  106. We need to create a rcng script to be able to start thin at boot time: /etc/rc.d/thin
  107.  
  108.  
  109.  
  110. #!/bin/sh
  111.  
  112. #
  113.  
  114. # PROVIDE: thin
  115.  
  116. # REQUIRE: DAEMON
  117.  
  118.  
  119.  
  120. . /etc/rc.subr
  121.  
  122.  
  123.  
  124. name="thin"
  125.  
  126. rcvar=$name
  127.  
  128. command="/usr/pkg/bin/$name"
  129.  
  130. stop_cmd="/usr/pkg/bin/thin -c /home/_redmine/redmine -e production stop"
  131.  
  132. command_args="-c /home/_redmine/redmine -e production -d -u _redmine -g _redmine start"
  133.  
  134.  
  135.  
  136. load_rc_config $name
  137.  
  138. run_rc_command $1
  139.  
  140.  
  141.  
  142.  
  143.  
  144. Now activate it
  145.  
  146. # chmod 755 /etc/rc.d/thin
  147.  
  148. # echo "thin=YES" >> /etc/rc.conf
  149.  
  150. # /etc/rc.d/thin start
  151.  
  152.  
  153.  
  154.  
  155.  
  156. Configure the git-daemon
  157.  
  158.  
  159.  
  160. Here consider that the repositories will be in /home/_git/repos.
  161.  
  162.  
  163.  
  164. As for thin we will need create a rcng script: /etc/rc.d/gitdaemon
  165.  
  166.  
  167.  
  168. #!/bin/sh
  169.  
  170. #
  171.  
  172. # PROVIDE: gitdaemon
  173.  
  174. # REQUIRE: DAEMON
  175.  
  176.  
  177.  
  178. . /etc/rc.subr
  179.  
  180.  
  181.  
  182. name="gitdaemon"
  183.  
  184. rcvar=$name
  185.  
  186. pidfile="/var/run/$name.pid"
  187.  
  188. command="/usr/pkg/libexec/git-core/git-daemon"
  189.  
  190. command_args="--detach --base-path=/home/_git/repos --user=_git --group=_git --pid-file=$pidfile"
  191.  
  192.  
  193.  
  194. load_rc_config $name
  195.  
  196. run_rc_command $1
  197.  
  198.  
  199.  
  200.  
  201.  
  202. Activate it:
  203.  
  204.  
  205.  
  206. # chmod 755 /etc/rc.d/gitdaemon
  207.  
  208. # echo "gitdaemon=YES" >> /etc/rc.conf
  209.  
  210. # /etc/rc.d/gitdaemon start
  211.  
  212.  
  213.  
  214.  
  215.  
  216. When adding new daemon export ready repositories, in /home/_git/repos, they will be automatically available.
  217.  
  218.  
  219.  
  220. For example, considering we have /home/_git/repos/CBlog.git you can clone it like this:
  221.  
  222.  
  223.  
  224. git clone git://mybeautifulserver/Cblog.git
  225.  
  226.  
  227.  
  228. To be able tu push, you just have to play with ssh and the authorized_keys.
  229.  
  230. You can also restrict the shell using git-shell instead of /bin/sh for the _git user.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement