===========================================================================
$NetBSD: README-pkgsrc,v 1.1 2026/02/11 07:53:37 taca Exp $

To use Redmine with nginx, you will need to perform the following steps.
For more information, please refer
<https://www.redmine.org/projects/redmine/wiki/RedmineInstall>.

1. If you want to use with MySQL server (by default), install
   databases/mysql80-* (or mariadb) and enable it.
   Then, create the database.

2. Install nginx httpd server, www/nginx.

3. Setup Redmine database:

	$ mysql -u root -p
	> create database redmine character set utf8;
	> create database redmine_development character set utf8;
	> create user 'redmine'@'localhost' identified by 'redmine_password';
	> grant all privileges on redmine.* to 'redmine'@'localhost';
	> grant all privileges on redmine_development.* to 'redmine'@'localhost';

4. Set the database password for the redmine and redmine_development databases
   in /usr/pkg/share/ruby32-redmine61/config/database.yml;

5. Create secret token and write to
   /usr/pkg/share/ruby32-redmine61/config/configuration.yml

	# redmine61_generate_secret_token32.sh
	# vi config/configuration.yml
	  [...]
	  secret_token: 'YOUR_SECRET_KEY'
	  [...]

6. Import some data to Redmine database, select your locale, and migrate the DB:

	# redmine61_migrate_db32.sh

7. Setup nginx.

	# vi /usr/pkg/etc/nginx/nginx.conf
	http {
	upstream unicorn_redmine {
		server unix:/usr/pkg/share/ruby32-redmine61/unicorn.redmine.sock fail_timeout=0;
	}
	server {
	listen       80;
	server_name  localhost;

	root /usr/pkg/share/ruby32-redmine61;
	try_files $uri @unicorn_redmine;

	location @unicorn_redmine {
		proxy_set_header Host $http_host;
		proxy_pass http://unicorn_redmine;
	}

	error_page   500 502 503 504  /50x.html;
		location = /50x.html {
		root   share/examples/nginx/html;
	}
	}

8. Start Redmine with Unicorn.

	# /etc/rc.d/redmine61_unicorn32 start

9. Start nginx.

	# /etc/rc.d/nginx start

10. Access Redmine with username: admin and password: admin.
===========================================================================
