当前位置: 首页 > 编程日记 > 正文

GitLab 配置邮箱

设置 SMTP 发送邮件

这里以腾讯企业邮箱为例,其他邮箱可以参考 设置 SMTP 发送邮件。

SMTP 和 POP3/IMAP 协议

SMTP 负责发送邮件,POP3/IMAP 负责接收邮件。其中 IMAP 基本上替换掉了 POP3。

用户在使用客户端(例如 Foxmail)时,需要为这个客户端配置 SMTP 和 IMAP 服务器的地址和端口号。写完邮件后,发送到对应邮件服务器上的 SMTP 服务。邮件服务器收到客户编写完的邮件后,根据发件人和收件人的 domain 是否相同(例如都是 xx@qq.com),分为两种处理方式:

  • domain 相同:SMTP 服务将邮件转给本地的 POP3/IMAP 服务。
  • domain 不相同:SMTP 服务先通过 DNS 查找,找到收件人对应 domain 的 IP 地址,然后将邮件发送到这台服务器上的 SMTP 服务,后续步骤跟上一步相同。

设置

根据 GitLab 的不同安装方式(docker-compose、docker、二进制或源码安装),设置邮件的方式不同。

一直没找到邮件的日志位置,所以也不知道到底哪里报错。但是可以参考下面部分,通过 Ruby 控制台发邮件,会打印所有的错误信息。

以 root 用户身份登录后,在浏览器中访问 GitLab 时,在 URL 后添加 /api/v4/application/settings ,可以看到所有的设置,每个参数的含义可以 参考这里。

通过 docker-compose 设置(测试成功)

简单便捷,推荐。

修改 docker-compose.yml 文件后,通过 docker-compose up 命令重新加载配置(注意对于腾讯企业邮箱 SMTP_TLS 这个参数必须设置,且必须为 true,此时才会开启 TLS/SSL 加密):

    - SMTP_ENABLED=true
    - SMTP_DOMAIN=exmail.qq.com
    - SMTP_HOST=smtp.exmail.qq.com
    - SMTP_PORT=465
    - SMTP_USER=yeguan@szhuizhong.cn
    - SMTP_PASS=yg123lhf
    - SMTP_STARTTLS=true
    - SMTP_TLS=true
    - SMTP_AUTHENTICATION=login

注意,下面两个参数也要配置。GitLab 发出的确认邮件中的所有连接都会指向这两个参数设置的地址及端口:

    - GITLAB_HOST=https://gitlab.mydomain.com
    - GITLAB_PORT=10080

上面的设置,会影响容器中的 /home/git/gitlabconfig/initializers/smtp_settings.rb 文件。容器中所有 SMTP 相关设置都从这个文件获取,内容如下:

# To enable smtp email delivery for your GitLab instance do the following:
# 1. Rename this file to smtp_settings.rb
# 2. Edit settings inside this file
# 3. Restart GitLab instance
#
# For full list of options and their values see http://api.rubyonrails.org/classes/ActionMailer/Base.html
#
# If you change this file in a Merge Request, please also create a Merge Request on https://gitlab.com/gitlab-org/omnibus-gitlab/merge_requestsif Rails.env.production?Rails.application.config.action_mailer.delivery_method = :smtpActionMailer::Base.delivery_method = :smtpActionMailer::Base.smtp_settings = {address: "smtp.exmail.qq.com",port: 465,user_name: "yeguan@szhuizhong.cn",password: "********",domain: "exmail.qq.com",authentication: "login",enable_starttls_auto: true,openssl_verify_mode: 'none',tls: true}
end

直接修改容器中的配置文件(没测试)

编辑 /home/gitlab/gitlab/config/environments/production.rb/home/git/gitlab/config/environments/production.rb,把 config.action_mailer.delivery_method = :sendmail 这一行前面加 # 符号注释掉,下面添加:

config.action_mailer.delivery_method = :smtp
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = trueconfig.action_mailer.smtp_settings = {:address              => "smtp.exmail.qq.com",:port                 => 465,:domain               => 'exmail.qq.com',:user_name            => 'yeguan@szhuizhong.cn',:password             => 'xxx',:authentication       =>  :plain,:ssl                  =>  true,:enable_starttls_auto => true
}

编辑 /etc/gitlab/gitlab.rb 文件进行设置(没测试)

进入容器

docker exec -it gitlab bash

修改配置文件

vi /etc/gitlab/gitlab.rb

内容如下:

gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = ""
gitlab_rails['smtp_port'] = 587
gitlab_rails['smtp_user_name'] = "xxxx@xx.com"
gitlab_rails['smtp_password'] = "password"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = true
gitlab_rails['gitlab_email_from'] = 'xxxx@xx.com'
gitlab_rails['smtp_domain'] = ""

重新加载配置并重启

gitlab-ctl reconfigure
gitlab-ctl restart

测试 SMTP 配置是否成功

查看容器的日志

通过容器安装时,如果 gitlab-ctl 和 gitlab-rails 不可用,可以直接进入容器查看日志:

docker exec -it gitlab_1 bash
cd  /var/log/gitlab

例如,GitLab 的时区不支持 Shanghai,只支持 Beijing,设置为 Shanghai 会报错无法启动:

TZ=Asia/Shanghai
GITLAB_TIMEZONE=Shanghai

时区报错时,通过 cat gitlab/unicorn.stderr.log 查看日志,会有这么一行:

/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.10/lib/active_support/core_ext/time/zones.rb:72:in `rescue in find_zone!': Invalid Timezone: Shanghai (ArgumentError)

点击忘记密码

最简单的方法,在登录页面, 点击忘记密码就会自动发送邮件。如果有异常,可以执行下面的命令查看日志:

gitlab-ctl tail

用 Rails 控制台

配置完成后可以用 Rails 控制台验证邮件是否能发送成功。

1. 进入 rails 控制台

在 GitLab 服务器上,执行:

gitlab-rails console

如果是通过 Docker 安装的,可能没有上面的命令,此时可以通过 docker exec -it xx bash 进入容器后使用 bundle 命令:

bundle exec rails console production

2. 检查 ActionMailer 的 delivery_method 参数是否是你设置的值

如果是 SMTP 则会显示 :smtp。如果是 Sendmail 则会显示 :sendmail

irb(main):001:0> ActionMailer::Base.delivery_method
=> :smtp

3. 检查邮件的设置

irb(main):002:0> ActionMailer::Base.smtp_settings
=> {:address=>"smtp.exmail.qq.com", :port=>465, :user_name=>"yeguan@szhuizhong.cn", :password=>"********", :domain=>"exmail.qq.com", :authentication=>"login", :enable_starttls_auto=>true, :openssl_verify_mode=>"none", :tls=>false}

如果有异常之处,可以检查邮件服务对应的日志(例如 /var/log/mail.log)。

4. 发送测试邮件

进入控制台后,在控制台提示符后输入下面的命令发送一封测试邮件:

irb(main):003:0> Notify.test_email('kikajack@163.com', 'Hello World', 'This is a test message').deliver_nowNotify#test_email: processed outbound mail in 1.5msSent mail to kikajack@163.com (60238.9ms)
Date: Fri, 18 May 2018 02:28:11 +0000
From: GitLab <yeguan@szhuizhong.cn>
Reply-To: GitLab <yeguan@szhuizhong.cn>
To: kikajack@163.com
Message-ID: <5afe3a3b9f941_2d3b6cd0a48166@f258a250dfea.mail>
Subject: Hello World
Mime-Version: 1.0
Content-Type: text/html;charset=UTF-8
Content-Transfer-Encoding: 7bit
Auto-Submitted: auto-generated
X-Auto-Response-Suppress: All<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html><body><p>This is a test message</p></body></html>Net::ReadTimeout: Net::ReadTimeoutfrom /usr/lib/ruby/2.3.0/net/protocol.rb:176:in `rbuf_fill'from /usr/lib/ruby/2.3.0/net/protocol.rb:154:in `readuntil'from /usr/lib/ruby/2.3.0/net/protocol.rb:164:in `readline'from /usr/lib/ruby/2.3.0/net/smtp.rb:955:in `recv_response'from /usr/lib/ruby/2.3.0/net/smtp.rb:556:in `block in do_start'from /usr/lib/ruby/2.3.0/net/smtp.rb:965:in `critical'from /usr/lib/ruby/2.3.0/net/smtp.rb:556:in `do_start'from /usr/lib/ruby/2.3.0/net/smtp.rb:521:in `start'from /home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/mail-2.7.0/lib/mail/network/delivery_methods/smtp.rb:109:in `start_smtp_session'from /home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/mail-2.7.0/lib/mail/network/delivery_methods/smtp.rb:100:in `deliver!'from /home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/mail-2.7.0/lib/mail/message.rb:2160:in `do_delivery'from /home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/mail-2.7.0/lib/mail/message.rb:260:in `block in deliver'from /home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/actionmailer-4.2.10/lib/action_mailer/base.rb:543:in `block in deliver_mail'from /home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.10/lib/active_support/notifications.rb:164:in `block in instrument'from /home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.10/lib/active_support/notifications/instrumenter.rb:20:in `instrument'from /home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.10/lib/active_support/notifications.rb:164:in `instrument'from /home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/actionmailer-4.2.10/lib/action_mailer/base.rb:541:in `deliver_mail'from /home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/mail-2.7.0/lib/mail/message.rb:260:in `deliver'from /home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/actionmailer-4.2.10/lib/action_mailer/message_delivery.rb:85:in `deliver_now'from (irb):4from /home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/railties-4.2.10/lib/rails/commands/console.rb:110:in `start'from /home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/railties-4.2.10/lib/rails/commands/console.rb:9:in `start'from /home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/railties-4.2.10/lib/rails/commands/commands_tasks.rb:68:in `console'from /home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/railties-4.2.10/lib/rails/commands/commands_tasks.rb:39:in `run_command!'from /home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/railties-4.2.10/lib/rails/commands.rb:17:in `<top (required)>'from bin/rails:14:in `require'from bin/rails:14:in `<main>'

上面发送失败,同时报了一堆错误。Ruby 我不懂,所以去查资料。mail SSL smtp 发送不成功 (QQ/163) 这里讲的很明白,TLS/SSL 必须设置为 true。

修改设置后,再次发送邮件,成功:

irb(main):003:0> Notify.test_email('kikajack@163.com', 'Hello World', 'This is a test message').deliver_nowNotify#test_email: processed outbound mail in 313.8msSent mail to kikajack@163.com (1993.6ms)
Date: Fri, 18 May 2018 06:59:37 +0000
From: GitLab <yeguan@szhuizhong.cn>
Reply-To: GitLab <yeguan@szhuizhong.cn>
To: kikajack@163.com
Message-ID: <5afe79d9e5b57_2e96b90b8507d6@f9147604e002.mail>
Subject: Hello World
Mime-Version: 1.0
Content-Type: text/html;charset=UTF-8
Content-Transfer-Encoding: 7bit
Auto-Submitted: auto-generated
X-Auto-Response-Suppress: All<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html><body><p>This is a test message</p></body></html>=> #<Mail::Message:185028380, Multipart: false, Headers: <Date: Fri, 18 May 2018 06:59:37 +0000>, <From: GitLab <yeguan@szhuizhong.cn>>, <Reply-To: GitLab <yeguan@szhuizhong.cn>>, <To: kikajack@163.com>, <Message-ID: <5afe79d9e5b57_2e96b90b8507d6@f9147604e002.mail>>, <Subject: Hello World>, <Mime-Version: 1.0>, <Content-Type: text/html; charset=UTF-8>, <Content-Transfer-Encoding: 7bit>, <Auto-Submitted: auto-generated>, <X-Auto-Response-Suppress: All>>

各邮箱的区别

这里写图片描述

primary email

用户注册时的邮箱,默认状况下,通知邮箱也是同一个。可以在个人信息中修改。

notification email

用来接收系统邮件,如果 test、merge、review 通知等,和 primary email 一致就行。

public email

用户展示出来的个人信息,GitLab 并不使用。

ssh key 邮箱

设置公钥的时候是用的这个邮箱。用户将公钥添加到 GitLab 之后,可以在这个公钥的主机上 push 和 pull 代码。用户的commit后,系统鉴别的头像和用户名都和ssh key中的邮箱没有关系。

$ ssh-keygen -t rsa -b 4096 -C "565066158@qq.com"
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/Administrator/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /c/Users/Administrator/.ssh/id_rsa.
Your public key has been saved in /c/Users/Administrator/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:ZZYs4/OKNCJLoMCJ5/4vf+Uvq0RvcD64YSw0VS6mBQE 565066158@qq.com
The key's randomart image is:
+---[RSA 4096]----+
|    E.o.  .      |
|       . + .     |
|        B B      |
|o .    * B       |
|+o.   + S .      |
|o+   . + O.      |
|. + . + *o*      |
| o o.o *.=o.     |
|  o..++.+..+.    |
+----[SHA256]-----+

git 配置邮箱

用户需要在 Git 软件中设置邮箱和用户名:

$ git config user.name 'jack'
$ git config user.email '123@qq.com'

可以在 ~/.gitconfig 文件中实现全局配置。

用户提交代码之后,GitLab 会将 git config 中的邮箱与用户 email 进行匹配。如果匹配成功,则可以上传。

值得注意的是:当邮箱匹配时,commit 的用户名是用户的 GitLab 的用户名,而不是 git config 中的。如果邮箱不匹配,则使用 git config 中的用户名和邮箱。

转载于:https://www.cnblogs.com/kika/p/10851615.html

相关文章:

在 Ubuntu Natty 中解除系统托盘限制

在 Ubuntu 11.04 Natty 中&#xff0c;Ubuntu 对顶部面板右上角的通知区域&#xff08;系统托盘&#xff09;采用了白名单制度&#xff0c;只有支持 Indicators 并位于白名单的部分程序才会被显示在系统托盘中&#xff0c;目前支持的程序有&#xff1a; Java apps, Mumble, Win…

Oracle10g客户端远程连接数据库全过程[转]

最近项目用到了oracle&#xff0c;使用的是oracle10g&#xff0c;因为小组内有多人使用数据库&#xff0c;并且oracle数据库很占内 存&#xff0c;就放在单独的一台服务器上&#xff0c;所以最好每个人都装一个oracle10g的客户端。那么客户端到数据库的远 程访问时免不了的了。…

【css】页面出现两个滚动条以及只有一半页面显示内容的解决方法

可能当修改页面的margin等属性时会出现页面只有一半的页面显示内容的情况&#xff0c;此时我们可以修改css代码来解决问题 代码实现&#xff1a; body{overflow:hidden}html{/*overflow-y:scroll;*/ }html{overflow: auto; } 注意&#xff1a;该代码为css代码&#xff0c;需…

Microsoft Dynamics Marketplace

微软对一些产品提供网上销售第三方插件/解决方案的站点叫做 Marketplace&#xff0c;比如 Windows Phone Marketplace, Dynamics Marketplace.这样可以帮助合作伙伴/客户提供一个网上的产品交流平台&#xff0c;Microsoft Dynamics Marketplace 针对微软CRM/ERP 产品&#xff0…

【hdu】4521 小明序列【LIS变种】【间隔至少为d】

题目链接&#xff1a;https://vjudge.net/contest/228455#problem/B 转载于&#xff1a;https://blog.csdn.net/a709743744/article/details/51765252 题目大意&#xff1a; 求最长上升子序列&#xff0c;其中子序列中相邻的两个数的下标差要超过k 解题分析&#xff1a; 子序列…

【bootstrap】bootstrap-4.5.0-example 各个模板展示

前言&#xff1a;博主做前端开发的时候经常用到bootstrap&#xff0c;但挑选模板的时候&#xff0c;需要一个一个的打开文件夹、打开html文件再查看模板是否合适&#xff0c;这样实在有点浪费时间&#xff0c;所以今天博主将各个页面截图展示出来&#xff0c;之后方便大家也方便…

HDU1053 Entropy 哈夫曼树

题目链接&#xff1a;http://acm.hdu.edu.cn/showproblem.php?pid1053 认真读题&#xff0c;别怕题长&#xff0c;此题考查的就是哈夫曼树并求出最小编码值&#xff0c;注意每一次要将数组清0&#xff0c;否则会出错&#xff01; AC代码&#xff1a; #include<iostream>…

C++用数组和链表分别实现Queue

C用数组和链表分别实现Queue 昨天写了《C用数组和链表分别实现Stack》&#xff0c;今天就是《C用数组和链表分别实现Queue》&#xff0c; 队列就是先来的先被处理掉&#xff0c;后来的就等&#xff0c;直到成为先来的&#xff0c;实现起来感觉和栈差不多。 模板好用的&#xff…

bzoj1150 [CTSC2007]数据备份Backup

大概就是写了道生日礼物那个不知道叫啥的贪心。。。。。 大概就是说这道题和那个比较像。。。 所以留着看看吧&#xff0c;哪天想起了回来做这道题咯~ 转载于:https://www.cnblogs.com/LLppdd/p/9051440.html

004本周总结报告

这一周总的来说并没有学到多少东西。只是学习了java数组相关的知识&#xff0c;发现和C/C中的数组基本一样&#xff0c;同时也了解到堆内存和栈内存的概念。在学习数组时发现java数组的length属性很好用&#xff0c;学习了数组的插入赋值&#xff0c;冒泡和选择排序等并用数组的…

JS保留两位小数

JS保留两位小数 对于一些小数点后有多位的浮点数&#xff0c;我们可能只需要保留2位&#xff0c;但js没有提供这样直接的函数&#xff0c;所以我们得自己写函数实现这个功能&#xff0c;代码如下&#xff1a; function changeTwoDecimal(x) { var f_x parseFloat(x); if…

【资源分享】The Beatles(披头士)乐队所有专辑带封面

资源免费分享&#xff0c;送给各位披头士的粉丝。只求个赞可以吗。 复制这段内容后打开百度网盘手机App&#xff0c;操作更方便哦 链接:https://pan.baidu.com/s/1N5BXA18JeaznYhRRy6kiAw 提取码:5439

Serial Communications in Win32

http://msdn.microsoft.com/en-us/library/ms810467.aspx http://hi.baidu.com/beisika/blog/item/b204d58f6c3bece9513d9297.html

platform_driver_register适配的两种方式及probe是否启动与硬件关系

platform_driver_register2种方式学习 1.platform_device_register与platform_driver_register配合使用&#xff1a; 实例代码摘自下述网址&#xff1a; 这样当两个name一样时&#xff0c;就会嗲用mt65xx_leds_probe这个函数了。 static struct platform_driver mt65xx_leds_d…

Java中创建泛型数组

Java中创建泛型数组 使用泛型时&#xff0c;我想很多人肯定尝试过如下的代码&#xff0c;去创建一个泛型数组 T[] array new T[]; 当我们写出这样的代码时编译器会报Cannot create a generic array of T&#xff0c;初学泛型时&#xff0c;看到这个错就以为Java中不能创建泛型…

eclipse假死解决办法

因为要同时开发android&#xff0c;还有毕设要用myeclipse&#xff0c;装了太多插件&#xff0c;eclipse老卡死&#xff0c;解决办法如下&#xff1a; 1、关闭myeclipse的插件&#xff08;开发网页时再打开&#xff09;方法如下&#xff1a; &#xff08;1&#xff09;eclipse-…

Petapoco 连接oracle11g 自动生成poco时遇到的问题

偶尔在园子里看到.net的轻量级ORM框架Petapoco的介绍&#xff0c;觉得很有趣。相关介绍&#xff1a;PetaPoco&#xff1a;适用于.NET的微型ORM 正好最近有个C#Oracle11g的项目&#xff0c;想趁此机会试试用petapoco来做数据层的框架。 在配置步骤和遇到的问题&#xff0c;记录如…

网页分享插件 share.js 国外常用

这两天做推广&#xff0c;要求实现页面分享到国外各大社交媒体的功能。自己去翻各大厂的文档的话&#xff0c;实现起来时间相当长。 github 上找了个插件&#xff0c;很6. 地址&#xff1a; https://github.com/ellisonleao/sharer.js 支持主流的国外的社交媒体的分享。 主要支…

ORM操作models一对多、多对多关系

ORM操作 单表、一对多表操作 1 from django.db import models2 3 4 class UserGroup(models.Model):5 title models.CharField(max_length32)6 7 8 class UserInfo(models.Model):9 username models.CharField(max_length32) 10 password models.CharField(max…

【基础知识】如何快速转发CSDN博客

使用&#xff1a;火狐浏览器、Markdown编辑器 一、打开要转发的博客、按F12并点击查看器 二、复制页面的代码&#xff08;此处用到一个小技巧&#xff09; 1、鼠标点击该按钮 2、将鼠标放到图示位置&#xff0c;使变色的位置覆盖所有博客的内容后点击鼠标左键 3、看到下方代码…

SQLServer 系统表

SQLServer 系统表 http://blog.163.com/zangyunling126/blog/static/1646245052010101641620415/ http://www.cnblogs.com/yolion/archive/2007/10/08/916767.html SQL系统表说明 http://hi.baidu.com/etimeman/blog/item/3d5d82fc09bbfff8fc037fae.html SQLServer系统表详细说…

c#之旅--第一天

昨天开始的第一篇博客被我这个菜鸟找不到了&#xff0c;那就从今天开始吧废话也不多说了&#xff0c;good good study, day day up! 首先总结一下昨天所学&#xff1a; 从程序的开头开始吧&#xff0c;首先是引用&#xff0c;这里总结一下using的用法&#xff1a;1,。将外部命名…

第十一周总结CoreIDRAW

一、学到了什么&#xff1f; 1、交互式工具为制作逼真的特效提供了基础&#xff0c;如交互式调和工具常用于制作逼真的过滤效果&#xff1b;交互式阴影工具用于制作逼真的阴影&#xff1b;而交互式透明工具用于制作逼真的高光效果。 2、利用这些工具做了232页实训——画册制作和…

formatData

//解决传入0 格化后不返回空的问题function formatAmountValueNew(objValue,flag) { if(objValue!"" && objValue!null) { if(flag0) { // 验证输入金额数值或数值字符串&#xff1a; return objValue.toString().replace(/,/g, "");…

【java】将自己写的类生成说明文档的方法

使用工具&#xff1a; jdk中的javadoc 实现步骤&#xff1a; 1、将java文件放到一个目录之下 2、进入doc(winR,输入cmd) 3、通过cd指令进入存放java文件的文件夹 4、编译java文件 代码实现&#xff1a; javac HelloWorld.java 注&#xff1a; &#xff08;1&#xff09…

Scrapy和MongoDB的应用

Scrapy是Python开发的一个快速、高层次的屏幕抓取和web抓取框架,用于抓取Web站点并从页面中提取结构化的数据.它最吸引人的地方在于任何人都可以根据需求方便的修改。 MongoDB是现下非常流行的开源的非关系型数据库&#xff08;NoSql&#xff09;&#xff0c;它是以“key-value…

linux bunzip2命令

Linux命令&#xff1a;bunzip2 功能说明&#xff1a;.bz2文件的解压缩程序。 语 法&#xff1a;bunzip2 [-fkLsvV][.bz2压缩文件] 补充说明&#xff1a;bunzip2可解压缩.bz2格式的压缩文件。bunzip2实际上是bzip2的符号连接&#xff0c;执行bunzip2与bzip2 - d的效果相同。 参…

[C++]C++中的IO类

C中的IO类 C语言不直接处理输入输出&#xff0c;而是通过一组定义在标准库中的类型来处理IO。这些类型支持从设备读取数据&#xff0c;向设备写入数据的IO操作&#xff0c;设备可以是文件&#xff0c;控制台窗口等。还有一些类型允许内存IO&#xff0c;即从string读取数据&…

solr 3.5 配置及服务器设置

一、solr 的简介 Apache Solr 是一个开源的搜索服务器。Solr 使用 Java 语言开发&#xff0c;主要基于 HTTP 和 Apache Lucene 实现。Apache Solr 中存储的资源是以 Document 为对象进行存储的。每个文档由一系列的 Field 构成&#xff0c;每个 Field 表示资源的一个属性。Solr…