StuRa:Server/Redmine: Unterschied zwischen den Versionen

Aus Wiki StuRa HTW Dresden
Zur Navigation springen Zur Suche springen
Zeile 473: Zeile 473:
</pre>
</pre>
-->
-->
: <code></code>
: <code>pkg install -y rubygem-passenger</code>
: <code></code>
<!--
<pre>
Message for apache24-2.4.16:
To run apache www server from startup, add apache24_enable="yes"
in your /etc/rc.conf. Extra options can be found in startup script.
 
Your hostname must be resolvable using at least 1 mechanism in
/etc/nsswitch.conf typically DNS or /etc/hosts or apache might
have issues starting depending on the modules you are using.
 
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
- apache24 default build changed from static MPM to modular MPM
- more modules are now enabled per default in the port
- icons and error pages moved from WWWDIR to DATADIR
 
  If build with modular MPM and no MPM is activated in
  httpd.conf, then mpm_prefork will be activated as default
  MPM in etc/apache24/modules.d to keep compatibility with
  existing php/perl/python modules!
 
Please compare the existing httpd.conf with httpd.conf.sample
and merge missing modules/instructions into httpd.conf!
 
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
</pre>
<pre>
Message for rubygem-passenger-5.0.14:
#####################################################################
 
Please edit your Apache configuration file, and add these lines:
 
  LoadModule passenger_module /usr/local/lib/ruby/gems/2.1/gems/passenger-5.0.14/buildout/apache2/mod_passenger.so
  PassengerRoot /usr/local/lib/ruby/gems/2.1/gems/passenger-5.0.14
  PassengerRuby /usr/local/bin/ruby21
 
After you restart Apache, you are ready to deploy any number of Ruby on Rails
applications on Apache, without any further Ruby on Rails-specific
configuration!
 
#####################################################################
</pre>
-->
: <code>$EDITOR /usr/local/etc/apache22/httpd.conf</code>
<pre></pre>
<pre>
  LoadModule passenger_module /usr/local/lib/ruby/gems/2.1/gems/passenger-5.0.14/buildout/apache2/mod_passenger.so
  PassengerRoot /usr/local/lib/ruby/gems/2.1/gems/passenger-5.0.14
  PassengerRuby /usr/local/bin/ruby21
</pre>
<pre></pre>
: <code>install -y ap24-mod_fastcgi</code>
<pre>
[preparing module `fastcgi' in /usr/local/etc/apache24/httpd.conf]
</pre>
: <code>$EDITOR /usr/local/etc/apache22/httpd.conf</code>
<pre></pre>
<pre>
#LoadModule suexec_module      libexec/apache22/mod_suexec.so
LoadModule fastcgi_module    libexec/apache22/mod_fastcgi.so
 
<IfModule fastcgi_module>
    AddHandler fastcgi-script .fcgi
#    FastCgiWrapper /usr/local/sbin/suexec
    FastCgiConfig -idle-timeout 600 -restart -pass-header Authorization
</IfModule>
</pre>
<pre></pre>
: <code></code>
: <code></code>
: <code></code>
: <code></code>
Zeile 481: Zeile 548:
-->
-->
----
----
: <code>pkg install rubygem-passenger</code>
: <code>pkg install rubygem-passenger</code>
: <code>passenger-config --root</code>
: <code>passenger-config --root</code>

Version vom 31. Juli 2015, 06:33 Uhr

Achtung

Dieser Artikel ist ein exemplarischer Artikel.

Es handelt sich hierbei nicht um die Instanz Redmine als AUS vom StuRa. Dazu dienen die Artikel:

Installation

Randbedingungen

OS
FreeNAS 9.3
Paketverwaltung
freebsd-man:pkgng

Vorbereitung der Installation

pauschales Aktualisieren
pkg update; pkg upgrade -y
zsh installieren und in zsh wechseln
pkg install -y zsh; zsh

tatsächliche Installation

Lokalisation prüfen und setzen
(optional) kann sich angeschaut werden welche Werte (für die Einstellungen) gesetzt sind
locale
(optional) kann sich angeschaut werden welche Werte (für die Einstellungen) gesetzt werden können
locale -a
Setzen der Werte für deutsche Lokalisation (de_DE)
Insbesondere für die Programmiersprache Ruby soll das wichtig sein. Das gilt insbesondere, wenn Ruby selbst kompiliert wird.
export LANG=de_DE.UTF-8
export LC_ALL=de_DE.UTF-8
Installieren von benötigten Paketen
Siehe auch
Installieren von Redmine
pkg install -y redmine
Demnach ist MySQL der standardmäßig vorgesehen.
pkg install -y mysql56-server
echo 'mysql_enable="YES"' >> /etc/rc.conf
service mysql-server start
Starting mysql.
mysql_install_db --basedir /usr/local
mysqladmin -u root password
New password: 
Confirm new password:
mysql_secure_installation
mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 5.6.25 Source distribution

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> create database redmine character set utf8;
Query OK, 1 row affected (0,00 sec)

mysql> create user 'redmine'@'localhost' identified by 'redmine';
Query OK, 0 rows affected (0,01 sec)

mysql> grant all privileges on redmine.* to 'redmine'@'localhost';
Query OK, 0 rows affected (0,00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0,00 sec)

mysql> quit;
Bye

cd /usr/local/www/redmine
bundle install
rake generate_session_store
RAILS_ENV=production rake redmine:load_default_data

Select language: ar, az, bg, bs, ca, cs, da, de, el, en, en-GB, es, et, eu, fa, fi, fr, gl, he, hr, hu, id, it, ja, ko, lt, lv, mk, mn, nl, no, pl, pt, pt-BR, ro, ru, sk, sl, sq, sr, sr-YU, sv, th, tr, uk, vi, zh, zh-TW [en] de
====================================
Default configuration data loaded.
mkdir tmp tmp/pdf public/plugin_assets
chmod -R 755 files log tmp public/plugin_assets
cd public
cp dispatch.fcgi.example dispatch.fcgi
useradd redmine -d /usr/local/www/redmine
chown -R redmine:redmine /usr/local/www/redmine

pkg install -y apache22
pkg install -y rubygem-passenger
$EDITOR /usr/local/etc/apache22/httpd.conf

   LoadModule passenger_module /usr/local/lib/ruby/gems/2.1/gems/passenger-5.0.14/buildout/apache2/mod_passenger.so
   PassengerRoot /usr/local/lib/ruby/gems/2.1/gems/passenger-5.0.14
   PassengerRuby /usr/local/bin/ruby21

install -y ap24-mod_fastcgi
[preparing module `fastcgi' in /usr/local/etc/apache24/httpd.conf]
$EDITOR /usr/local/etc/apache22/httpd.conf

#LoadModule suexec_module      libexec/apache22/mod_suexec.so
LoadModule fastcgi_module     libexec/apache22/mod_fastcgi.so

<IfModule fastcgi_module>
    AddHandler fastcgi-script .fcgi
#    FastCgiWrapper /usr/local/sbin/suexec
    FastCgiConfig -idle-timeout 600 -restart -pass-header Authorization
</IfModule>


pkg install rubygem-passenger
passenger-config --root
Installieren von PostgreSQL
pkg install rubygem-pg
  • client für PostgreSQL sollte bereits installiert sein.
    pkg info | grep postgresql
postgresql93-client-9.3.9
  • pkg install postgresql93-server
Einrichten von PostgreSQL
echo 'postgresql_enable="YES"' >> /etc/rc.conf
Wenn es sich um eine Jail handelt, so muss für PostgreSQL SysV IPC erlaubt sein. Bei FreeNAS muss einfach bei der Jail ,allow.sysvipc=true ergänzend eingetragen werden.
service postgresql initdb
service postgresql start
su pgsql

createdb redminedb
exit

passwd pgsql
Exemplarisch wird nachfolgend davon ausgegangen, dass das Passwort redmine-passwd verwendet wurde.
production:
  adapter: postgresql
  database: redminedb
  host: localhost
  username: pgsql
  password: "redmine-passwd"
  encoding: utf8
echo '/usr/local/www/redmine/log/production.log 644 3 3000 * J' >> /etc/newsyslog.conf