一键安装 redmine on rhel6.4

时间:2021-03-06 15:35:04

一键安装 redmine on rhel6.4

一键式安装redmine省去了大量不必要的时间。下载:bitnami-redmine-2.5.2-1-linux-x64-installer.run。

https://bitnami.com/stack/redmine

安装过程如下:

[root@vm-redmine ~]# ./bitnami-redmine-2.5.2-1-linux-x64-installer.run
Language Selection

Please select the installation language
[1] English - English
[2] Spanish - Español
[3] Japanese - 日本語
[4] Korean - 한국어
[5] Simplified Chinese - 简体中文
[6] Hebrew - עברית
[7] German - Deutsch
[8] Romanian - Română
[9] Russian - Русский
Please choose an option [1] : 5
----------------------------------------------------------------------------
欢迎来到 Bitnami Redmine Stack 安装程序。

----------------------------------------------------------------------------
选择您想要安装的组件,清除您不想安装的组件。当您准备继续时,点击前进。

Subversion [Y/n] :Y

PhpMyAdmin [Y/n] :Y

Redmine : Y (Cannot be edited)

Git [Y/n] :Y

上述选择是否正确? [Y/n]: Y

----------------------------------------------------------------------------
安装文件夹

请选择安装Bitnami Redmine Stack的文件夹

选择一个文件夹 [/opt/redmine-2.5.2-1]: 

----------------------------------------------------------------------------
创建管理员帐户

Bitnami Redmine Stack admin 用户创建

您的真实姓名 [User Name]: cl    

Email地址 [user@example.com]: ??????@qq.com

登录 [user]: master

密码 :
请确认密码 :
----------------------------------------------------------------------------
缺省数据配置语言

选择缺省数据配置语言:

[1] 保加利亚语
[2] 捷克语
[3] 德语
[4] 英语
[5] 西班牙
[6] 法语
[7] 希伯来语
[8] 意大利语
[9] 日语
[10] 朝鲜语
[11] 荷兰语
[12] 波兰语
[13] 葡萄牙语
[14] 葡萄牙语/巴西
[15] 罗马尼亚语
[16] 俄语
[17] 塞尔维亚语
[18] 瑞典语
[19] 中文
[20] 中文/繁体
请选择选项 [19] : 

Do you want to configure mail support? [y/N]: y

----------------------------------------------------------------------------
配置SMTP设置

This is required so your application can send notifications via email.

默认电子邮件提供商:

[1] GMail
[2] 自定义
请选择选项 [1] : 2

----------------------------------------------------------------------------
配置SMTP设置

This data is stored in the application configuration files and may be visible to
others. For this reason, it is recommended that you do not use your personal
account credentials.

用户名 []: ??????@qq.com

密码 :
重新输入 :
SMTP 主机 []: smtp.qq.com

SMTP端口 []: 25

安全连接

[1] 没有
[2] SSL
[3] TLS
请选择选项 [3] : 

----------------------------------------------------------------------------
安装程序已经准备好将 Bitnami Redmine Stack 安装到您的电脑。

您确定要继续吗? [Y/n]: y

----------------------------------------------------------------------------
正在安装 Bitnami Redmine Stack 至您的电脑中,请稍候。

 正在安装
 0% ______________ 50% ______________ 100%
 #########################################

----------------------------------------------------------------------------
安装程序已经将 Bitnami Redmine Stack 安装于您的电脑中。

启动Redmine应用程序。 [Y/n]: Y

信息: 访问 Bitnami Redmine Stack, 从你的浏览器访问http://localhost:80。
按 [Enter] 继续:
[root@vm-redmine ~]#

安装好之后如果发现无法发邮件,登录qq邮箱,确定开启smtp。

游戏->设置->账户:
POP3/IMAP/SMTP/Exchange/CardDAV/CalDAV服务
开启服务:
    x  POP3/SMTP服务 (如何使用 Foxmail 等软件收发邮件?)
    x  IMAP/SMTP服务  (什么是 IMAP,它又是如何设置?)
    x  Exchange服务 (什么是Exchange,它又是如何设置?)
    x  CardDAV/CalDAV服务 (什么是CardDAV/CalDAV,它又是如何设置?)
    x (POP3/IMAP/SMTP/CardDAV/CalDAV服务均支持SSL连接。如何设置?)

我因为新申请了一个qq邮箱,而没有配置上面内容,出现错误:(end of file reached) 。导致折腾一天。

"redmine"测试邮件 发送邮件时发生错误 (end of file reached

开启redmine:

# /opt/redmine-2.5.2-1/ctlscript.sh restart

访问:

http://vm-redmine:80

查看一下配置文件: /opt/redmine-2.5.2-1/apps/redmine/htdocs/config/configuration.yml

# default configuration options for all environments
default:
  # Outgoing emails configuration (see examples above)
  email_delivery:
    delivery_method: :smtp
    smtp_settings:

      address: smtp.qq.com
      port: 25
      domain: example.net
      authentication: :login
      user_name: ??????@qq.com
      password: ********

由于我是在内部网段安装的redmine,需要在对外服务的网段的nginx配置中指向它。nginx的配置如下:

1)在nginx的安装目录(/usr/local/nginx/)里,找到conf/nginx.conf,修改如下(在http {...} 里面加入include redmine.conf;):

...
http {
...
include redmine.conf;
...
}
...

2)创建/usr/local/nginx/redmine.conf,内容如下:

# 指向内网redmine的web服务(192.168.10.100:80)
#
upstream redmine {
    server 192.168.10.100:80;
}

server {
	server_name vm-redmine;

	# /var/log/nginx 本地目录必须存在
	access_log  /var/log/nginx/redmine_access.log;
	error_log   /var/log/nginx/redmine_error.log;

	location /redmine {
		try_files $uri @ruby;      # @ruby 名字是任意的
	}

	location @ruby {
		proxy_set_header  Host             $host;
		proxy_set_header  X-Real_IP        $remote_addr;
		proxy_set_header  X-Forwarded-For  $proxy_add_x_forwarded_for;

		proxy_read_timeout     300;
		proxy_connect_timeout  300;
		proxy_redirect         off;

		proxy_pass http://redmine;  # 指向 upstream redmine
	}
}

3) 重新加载nginx配置:

$ /usr/local/nginx/sbin/nginx -t                  # 测试配置文件
$ /usr/local/nginx/sbin/nginx -s reload       # 重新加载nginx.conf

============================= A nginx sample on ubuntu14.04 ============================

1) install nginx on ubuntu:

$ sudo apt-get install nginx

2) config files

/etc/nginx/nginx.conf

user www-data;
worker_processes 4;
pid /run/nginx.pid;

events {
	worker_connections 768;
	# multi_accept on;
}

http {

	##
	# Basic Settings
	##

	sendfile on;
	tcp_nopush on;
	tcp_nodelay on;
	keepalive_timeout 65;
	types_hash_max_size 2048;
	# server_tokens off;

	# server_names_hash_bucket_size 64;
	# server_name_in_redirect off;

	include /etc/nginx/mime.types;
	default_type application/octet-stream;

	##
	# Logging Settings
	##

	access_log /var/log/nginx/access.log;
	error_log /var/log/nginx/error.log;

	##
	# Gzip Settings
	##

	gzip on;
	gzip_disable "msie6";

	# gzip_vary on;
	# gzip_proxied any;
	# gzip_comp_level 6;
	# gzip_buffers 16 8k;
	# gzip_http_version 1.1;
	# gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;

	##
	# nginx-naxsi config
	##
	# Uncomment it if you installed nginx-naxsi
	##

	#include /etc/nginx/naxsi_core.rules;

	##
	# nginx-passenger config
	##
	# Uncomment it if you installed nginx-passenger
	##

	#passenger_root /usr;
	#passenger_ruby /usr/bin/ruby;

	##
	# Virtual Host Configs
	##

        # PLEASE NOTE BELOW 2 LINES:
	include /etc/nginx/conf.d/*.conf;
######## include /etc/nginx/sites-enabled/*;
}

#mail {
#	# See sample authentication script at:
#	# http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
#
#	# auth_http localhost/auth.php;
#	# pop3_capabilities "TOP" "USER";
#	# imap_capabilities "IMAP4rev1" "UIDPLUS";
#
#	server {
#		listen     localhost:110;
#		protocol   pop3;
#		proxy      on;
#	}
#
#	server {
#		listen     localhost:143;
#		protocol   imap;
#		proxy      on;
#	}
#}

/etc/nginx/conf.d/redmine.conf

# 指向内网redmine的web服务(192.168.122.21:80)
#
upstream redmine {
    server 192.168.122.21:80;
}

server {
    server_name vm-redmine;

    # /var/log/nginx 本地目录必须存在
    access_log  /var/log/nginx/redmine_access.log;
    error_log   /var/log/nginx/redmine_error.log;

    location /redmine {
        try_files $uri @ruby;      # @ruby 名字是任意的
    }

    location @ruby {
        proxy_set_header  Host             $host;
        proxy_set_header  X-Real_IP        $remote_addr;
        proxy_set_header  X-Forwarded-For  $proxy_add_x_forwarded_for;

        proxy_read_timeout     300;
        proxy_connect_timeout  300;
        proxy_redirect         off;

        proxy_pass http://redmine;  # 指向 upstream redmine
    }
}

3) make sure http 80 port is accessiable on redmine machine.