redmine服务搭建

1、下载安装包https://bitnami.com/stack/redmine/installer

2、使用Xftp传到/root/Public/redmine

3、安装命令:./bitnami-redmine-2.5.2-1-linux-x64-installer.run

[root@node188 Public]# ./bitnami-redmine-3.3.3-0-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-3.3.3-0]: /opt/redmine-3.3.3-0    

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

Bitnami Redmine Stack admin 用户创建

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

Email地址 [user@example.com]: 你的邮箱@163.com

登录 [user]: admin

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

选择缺省数据配置语言:

[1] Bosnian
[2] 保加利亚语
[3] Catalan
[4] 捷克语
[5] Danish
[6] 德语
[7] 英语
[8] 西班牙
[9] 法语
[10] Galician
[11] 希伯来语
[12] Hungarian
[13] 意大利语
[14] 日语
[15] 朝鲜语
[16] Lithuanian
[17] 荷兰语
[18] Norwegian
[19] 波兰语
[20] 葡萄牙语
[21] 罗马尼亚语
[22] 俄语
[23] Slovak
[24] Slovenian
[25] 塞尔维亚语
[26] 瑞典语
[27] Turkish
[28] Ukrainian
[29] Vietnamese
[30] 中文
请选择选项 [30] : 30

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.

用户名 []: 你的邮箱.com

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

SMTP端口 [587]: 25

安全连接

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

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

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

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

 正在安装
 0% ______________ 50% ______________ 100%
 ########################################^[[D#
                                                                                       
----------------------------------------------------------------------------
安装程序已经将 Bitnami Redmine Stack 安装于您的电脑中。

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

3、访问http://127.0.0.1/redmine/就可以了,接下来配置邮箱功能。

4、命令发送一条测试邮件检查sendmial服务

echo test| mail -v -s "test" youemailaddress@163.com或echo "email test"|mail -s test youemailaddress@163.com,如果邮箱收到邮件,那恭喜你,那个装linux的人是好同事。如果没收到邮件,那你就坑了,使用tail /var/log/maillog查看日志排查原因。

注:此处如果你是使用公司的内网,日志里被SMTP服务器connection refusedtelnet这个服务器地址(163QQ邮箱服务器)的25端口也被拒绝了,说明你的网络被管制,需要打开163QQ等的邮箱服务器的25端口,使你的主机能链接上这服务器。

5、Redmine的邮件功能基于服务器的邮件服务,可以使用sendmail或者postfix(配置简单,推荐使用,太简单大家百度就行)。

以下对sendmail服务做详解,用两种方法可供选择

  (1使用本机sendmai服务,bin/mail会默认使用本地sendmail发送邮件,这样要求本地的机器必须安装和启动Sendmail服务
  (2利用外部的smpt服务器通过修改配置文件可以使用外部SMTP服务器,可以达到不使用sendmail而用外部的smtp服务器发送邮件的目的:
 修改/etc/nail.rc (/etc/mail.rc)
 set from=fromUser@domain.com smtp=smtp.domain.comset smtp-auth-user=username smtp-auth-password=passwordset smtp-auth=login
 说明:
 from是发送的邮件地址
 smtp是发生的外部smtp服务器的地址
 smtp-auth-user是外部smtp服务器认证的用户名
 smtp-auth-password是外部smtp服务器认证的用户密码
 smtp-auth是邮件认证的方式

12这里我们采取第一种方法,检查本机是否安装sendmial

[root@localhost ~]# rpm -qa | grep sendmail

sendmail-cf-8.14.4-9.el6_8.1.noarch

sendmail-8.14.4-9.el6_8.1.x86_64

[root@localhost ~]# rpm -qa | grep m4

m4-1.4.13-5.el6.x86_64

[root@localhost ~]# rpm -q mailx

mailx-12.4-7.el6.x86_64

安装sendmail,这里我已经安装好了sendmail,如果未安装可以使用yum -y install sendmail完成安装

[root@localhost ~]# yum -y install sendmail

Loaded plugins: fastestmirror, product-id, subscription-manager

This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.

Loading mirror speeds from cached hostfile

base   | 3.7 kB     00:00     

extras  | 3.4 kB     00:00     

updates | 3.4 kB     00:00     

Setting up Install Process

Package sendmail-8.14.4-9.el6_8.1.x86_64 already installed and latest version

Nothing to do

也可以从ftp://ftp.sendmail.org/pub/sendmail/sendmail.8.12.11.tar.gz获取安装包

配置sendmail.mc

 #备份sendmail.mc文件

 mv /etc/sendmail.mc /etc/sendmail.mc.old

 #打开sendmail.mc文件

 vi /etc/mail/sendmail.mc

 DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')
 #改成 (将Addr=0.0.0.0,有一说改成本机ip)

 DAEMON_OPTIONS(`Port=smtp,Addr=0.0.0.0, Name=MTA')

 #保存离开

 #重新定制文档

 m4 sendmail.mc >  sendmail.cf

关掉sendmail的反向解析

 vim /etc/mail/sendmail.cf

 找到 #O ResolverOptions=+AAONLY 这一行信息,并把它的注释去掉。

启动mailserver

 /etc/rc.d/init.d/sendmail restart

 /etc/rc.d/init.d/sendmail status

设置主机名称

 [root@localhost mail]# vi /etc/mail/local-host-names

 #local-host-names - include all aliases for your machine here.

 redmineServer.com

 mail.redmineServer.com

设定邮件服务器的权限

 vi /etc/mail/access

 #预设情况下有启用的IP

 Connect:localhost.localdomain           RELAY

 Connect:localhost                       RELAY

 Connect:127.0.0.1                       RELAY

 #新增

 Connect:本机IP                   RELAY

 Connect:redmineserver.com                 RELAY

 #保存离开

配置DNS

1)配置resolv.conf文件

 vi /etc/resolv.conf

# No nameservers found; try putting DNS servers into your

# ifcfg files in /etc/sysconfig/network-scripts like so:

#

# DNS1=xxx.xxx.xxx.xxx

# DNS2=xxx.xxx.xxx.xxx

# DOMAIN=lab.foo.com bar.foo.com

nameserver 218.85.157.99(看具体情况)

nameserver 8.8.8.8

search localhostdomain

 

2)配置hosts文件

 vi /etc/hosts

127.0.0.1        localhost localhost.localdomain localhost4 localhost4.localdomain4

本机IP    redmineserver.com

::1              localhost localhost.localdomain localhost6 localhost6.localdomain6

3)配置network文件

 vim /etc/sysconfig/network

NETWORKING=yes

#HOSTNAME=localhost.localdomain

HOSTNAME=redmineserver.com

测试邮件

[root@localhost etc]# echo test| mail -v -s "test" r122225@163.com

r122225@163.com... Connecting to [127.0.0.1] via relay...

220 localhost.localdomain ESMTP Sendmail 8.14.4/8.14.4; Wed, 7 Jun 2017 15:49:14 +0800

>>> EHLO localhost.localdomain

250-localhost.localdomain Hello localhost [127.0.0.1], pleased to meet you

250-ENHANCEDSTATUSCODES

250-PIPELINING

250-8BITMIME

250-SIZE

250-DSN

250-ETRN

250-AUTH GSSAPI DIGEST-MD5 CRAM-MD5

250-DELIVERBY

250 HELP

>>> MAIL From:<root@localhost.localdomain> SIZE=220 AUTH=root@localhost.localdomain

250 2.1.0 <root@localhost.localdomain>... Sender ok

>>> RCPT To:<r122225@163.com>

>>> DATA

250 2.1.5 <r122225@163.com>... Recipient ok (will queue)

354 Enter mail, end with "." on a line by itself

>>> .

250 2.0.0 v577nECl021540 Message accepted for delivery

r122225@163.com... Sent (v577nECl021540 Message accepted for delivery)

Closing connection to [127.0.0.1]

>>> QUIT

221 2.0.0 localhost.localdomain closing connection


注:发现邮件一直没收到,查看发送日志tail /var/log/maillog,这里我发现邮件没发出去connection refused,卧槽,原来是内网的原因,网络管制需要开通smtp.163.com的25端口。去年买了个表,一个电话甩到网络部,“不好意思开通下ip下的smtp163.com的25端口”(跟孙子一样的口气)。好了终于可以收到了。。

19、修改配置,命令:

vi /opt/redmine-3.3.3-0/apps/redmine/htdocs/config/configuration.yml

 因为在安装的时候已经配置过来,这里也可以省略,不过为了安全起见这里再检查一遍,#修饰的为备注信息可以忽略

  # See the examples below and the Rails guide for more configuration options:
  # http://guides.rubyonrails.org/action_mailer_basics.html#action-mailer-configuration
  email_delivery:
    delivery_method: :smtp
    smtp_settings:


      address: smtp.163.com
      port: 25
      domain: smtp.163.com
      authentication: :login
      user_name: 你的邮箱@163.com
      password: smtp授权码




  # ==== Simple SMTP server at localhost
  #
  #  email_delivery:
  #    delivery_method: :smtp
  #    smtp_settings:
  #      address: "localhost"
  #      port: 25
  #
  # ==== SMTP server at example.com using LOGIN authentication and checking HELO for foo.com
  #

20、开启“你的邮箱@163.com”这个邮箱的的POP3/IMAP/SMTP服务

就是登陆到你的这个账户,在邮箱设置里面打开这个默认关闭的服务,具体百度,日,QQ要好几个工作日才能用这个服务。

21、咋们能使用使用postfix别去搞sendmial

配postfix或者sendmail之前先用echo "email test"|mail -s test rsdsd112@163.com发送一条邮件试试,或许本来就配置好了。完!




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值