StuRa:Server/Redmine: Unterschied zwischen den Versionen

Aus Wiki StuRa HTW Dresden
Zur Navigation springen Zur Suche springen
Zeile 178: Zeile 178:
:: Demnach ist ''MySQL'' der standardmäßig vorgesehen.
:: Demnach ist ''MySQL'' der standardmäßig vorgesehen.
: <code>pkg install mysql56-server</code>
: <code>pkg install mysql56-server</code>
<!--
<pre>
===> Creating users and/or groups.
Creating group 'mysql' with gid '88'.
Creating user 'mysql' with uid '88'.
</pre>
<pre>
Message for mysql56-server-5.6.25:
************************************************************************
Remember to run mysql_upgrade the first time you start the MySQL server
after an upgrade from an earlier version.
************************************************************************
</pre>
-->
: <code>echo 'mysql_enable="YES"' >> /etc/rc.conf</code>
: <code>service mysql-server start</code>
<pre>
Starting mysql.
</pre>
: <code>mysql_install_db --basedir /usr/local</code>
<!--
<pre>
Installing MySQL system tables...2015-07-31 05:40:21 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2015-07-31 05:40:21 0 [Note] /usr/local/libexec/mysqld (mysqld 5.6.25) starting as process 91700 ...
2015-07-31 05:40:21 91700 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-07-31 05:40:21 91700 [Note] InnoDB: The InnoDB memory heap is disabled
2015-07-31 05:40:21 91700 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-07-31 05:40:21 91700 [Note] InnoDB: Memory barrier is not used
2015-07-31 05:40:21 91700 [Note] InnoDB: Compressed tables use zlib 1.2.3
2015-07-31 05:40:21 91700 [Note] InnoDB: Not using CPU crc32 instructions
2015-07-31 05:40:21 91700 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-07-31 05:40:21 91700 [Note] InnoDB: Completed initialization of buffer pool
2015-07-31 05:40:21 91700 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
2015-07-31 05:40:21 91700 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
2015-07-31 05:40:21 91700 [Note] InnoDB: Database physically writes the file full: wait...
2015-07-31 05:40:21 91700 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
2015-07-31 05:40:21 91700 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
2015-07-31 05:40:22 91700 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2015-07-31 05:40:22 91700 [Warning] InnoDB: New log files created, LSN=45781
2015-07-31 05:40:22 91700 [Note] InnoDB: Doublewrite buffer not found: creating new
2015-07-31 05:40:22 91700 [Note] InnoDB: Doublewrite buffer created
2015-07-31 05:40:22 91700 [Note] InnoDB: 128 rollback segment(s) are active.
2015-07-31 05:40:22 91700 [Warning] InnoDB: Creating foreign key constraint system tables.
2015-07-31 05:40:22 91700 [Note] InnoDB: Foreign key constraint system tables created
2015-07-31 05:40:22 91700 [Note] InnoDB: Creating tablespace and datafile system tables.
2015-07-31 05:40:22 91700 [Note] InnoDB: Tablespace and datafile system tables created.
2015-07-31 05:40:22 91700 [Note] InnoDB: Waiting for purge to start
2015-07-31 05:40:22 91700 [Note] InnoDB: 5.6.25 started; log sequence number 0
2015-07-31 05:40:23 91700 [Note] Binlog end
2015-07-31 05:40:23 91700 [Note] InnoDB: FTS optimize thread exiting.
2015-07-31 05:40:23 91700 [Note] InnoDB: Starting shutdown...
2015-07-31 05:40:25 91700 [Note] InnoDB: Shutdown completed; log sequence number 1625977
OK
Filling help tables...2015-07-31 05:40:25 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2015-07-31 05:40:25 0 [Note] /usr/local/libexec/mysqld (mysqld 5.6.25) starting as process 91736 ...
2015-07-31 05:40:25 91736 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-07-31 05:40:25 91736 [Note] InnoDB: The InnoDB memory heap is disabled
2015-07-31 05:40:25 91736 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-07-31 05:40:25 91736 [Note] InnoDB: Memory barrier is not used
2015-07-31 05:40:25 91736 [Note] InnoDB: Compressed tables use zlib 1.2.3
2015-07-31 05:40:25 91736 [Note] InnoDB: Not using CPU crc32 instructions
2015-07-31 05:40:25 91736 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-07-31 05:40:25 91736 [Note] InnoDB: Completed initialization of buffer pool
2015-07-31 05:40:25 91736 [Note] InnoDB: Highest supported file format is Barracuda.
2015-07-31 05:40:25 91736 [Note] InnoDB: 128 rollback segment(s) are active.
2015-07-31 05:40:25 91736 [Note] InnoDB: Waiting for purge to start
2015-07-31 05:40:25 91736 [Note] InnoDB: 5.6.25 started; log sequence number 1625977
2015-07-31 05:40:25 91736 [Note] Binlog end
2015-07-31 05:40:25 91736 [Note] InnoDB: FTS optimize thread exiting.
2015-07-31 05:40:25 91736 [Note] InnoDB: Starting shutdown...
2015-07-31 05:40:26 91736 [Note] InnoDB: Shutdown completed; log sequence number 1625987
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
  /usr/local/bin/mysqladmin -u root password 'new-password'
  /usr/local/bin/mysqladmin -u root -h vedmine password 'new-password'
Alternatively you can run:
  /usr/local/bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.
See the manual for more instructions.
You can start the MySQL daemon with:
  cd . ; /usr/local/bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
  cd mysql-test ; perl mysql-test-run.pl
Please report any problems at http://bugs.mysql.com/
The latest information about MySQL is available on the web at
  http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com
WARNING: Found existing config file /usr/local/my.cnf on the system.
Because this file might be in use, it was not replaced,
but was used in bootstrap (unless you used --defaults-file)
and when you later start the server.
The new default config file was created as /usr/local/my-new.cnf,
please compare it with your file and take the changes you need.
</pre>
-->
: <code>mysqladmin -u root password</code>
<pre>
New password:
</pre>
<pre>
Confirm new password:
</pre>
: <code>mysql_secure_installation</code>
<!--
<pre>
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!
In order to log into MySQL to secure it, we'll need the current
password for the root user.  If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none):
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.
You already have a root password set, so you can safely answer 'n'.
Change the root password? [Y/n] n
... skipping.
By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.
Remove anonymous users? [Y/n] n
... skipping.
Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] n
... skipping.
By default, MySQL comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n] y
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] y
... Success!
All done!  If you've completed all of the above steps, your MySQL
installation should now be secure.
Thanks for using MySQL!
Cleaning up...
</pre>
-->
: <code>mysql -u root -p</code>
<pre>
Enter password:
</pre>
<pre>
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.
</pre>
<pre>
mysql> create database redmine character set utf8;
</pre>
<pre>
Query OK, 1 row affected (0,00 sec)
</pre>
<pre>
mysql> create user 'redmine'@'localhost' identified by 'redmine';
</pre>
<pre>
Query OK, 0 rows affected (0,01 sec)
</pre>
<pre>
mysql> grant all privileges on redmine.* to 'redmine'@'localhost';
</pre>
<pre>
Query OK, 0 rows affected (0,00 sec)
</pre>
<pre>
mysql> flush privileges;
</pre>
<pre>
Query OK, 0 rows affected (0,00 sec)
</pre>
<pre>
mysql> quit;
</pre>
<pre>
Bye
</pre>
----
----
: <code>pkg install rubygem-passenger</code>
: <code>pkg install rubygem-passenger</code>

Version vom 31. Juli 2015, 05:56 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 redmine
Demnach ist MySQL der standardmäßig vorgesehen.
pkg install 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

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