红米4x和红米note4xx能不能在台

gerrit + Git 服务器的搭建 - B.U.G - ITeye技术网站
博客分类:
一. 准备工作
系统环境:Ubuntu12.04
Gerrit版本:2.2.1
http://gerrit-releases./index.html
apt-get install git 二. 配置过程
zhouyanjiang@zhouyanjiang:~/Gerrit$ java -jar gerrit-2.2.1.war init -d review_sites
安装过程中会提示输入各种信息,包括数据库信息等,大部分都可以使用默认配置。除了一个地方注意改成Y,Behind reverse proxy [y/N]? Y。
*** Gerrit Code Review 2.2.1
Create '/home/zhouyanjiang/Gerrit/review_sites' [Y/n]?
*** Git Repositories
Location of Git repositories [git]:
*** SQL Database
Database server type [H2/?]:
*** User Authentication
Authentication method [OPENID/?]:
*** Email Delivery
SMTP server hostname [localhost]:
SMTP server port [(default)]:
SMTP encryption [NONE/?]:
SMTP username :
*** Container Process
Run as [zhouyanjiang]:
Java runtime [/usr/lib/jvm/java-6-openjdk-amd64/jre]:
Copy gerrit.war to /home/zhouyanjiang/Gerrit/review_sites/bin/gerrit.war [Y/n]?
Copying gerrit.war to /home/zhouyanjiang/Gerrit/review_sites/bin/gerrit.war
*** SSH Daemon
Listen on address [*]:
Listen on port [29418]:
Gerrit Code Review is not shipped with Bouncy Castle Crypto v144
If available, Gerrit can take advantage of features
in the library, but will also function without it.
Download and install it now [Y/n]?
Downloading http://www.bouncycastle.org/download/bcprov-jdk16-144.jar ... OK
Checksum bcprov-jdk16-144.jar OK
Generating SSH host key ... rsa... dsa... done
*** HTTP Daemon
Behind reverse proxy [y/N]? Y
Proxy uses SSL (https://) [y/N]?
Subdirectory on proxy server [/]:
Listen on address [*]:
Listen on port [8081]:
Canonical URL [http://zhouyanjiang-System-Product-Name/]:
Initialized /home/zhouyanjiang/Gerrit/review_sites
Executing /home/zhouyanjiang/Gerrit/review_sites/bin/gerrit.sh start
Starting Gerrit Code Review: OK
Waiting for server to start ... OK
Opening browser ...
1. 登陆网页会发现一些跳转不正常
修改 review_sites/etc/gerrit.config文件 canonicalWebUrl = http://192.168.5.102:8081/
2. 启动gerrit服务出现报错
zhouyanjiang@zhouyanjiang:~/Gerrit/review_sites/bin$ ./gerrit.sh start
** ERROR: GERRIT_SITE not set
报错为GERRIT_SITE未设置,只需要在gerrit.sh中设置GERRIT_SITE=/home/zhouyanjiang/Gerrit/review_sites即可
3. 重启gerrit服务报错
zhouyanjiang@zhouyanjiang:~/Gerrit/review_sites/bin$ ./gerrit.sh start
Starting Gerrit Code Review: process already running.
重新启动服务需要先stop,再start 四. 邮箱设置
经过上述的配置和调整,gerrit页面http://192.168.5.102:8081 已经可以访问,此时第一个注册的用户为系统管理员。在此之前,还需要配置一下系统邮箱。
系统邮箱的作用是给注册用户发送注册验证,给用户提交/merge代码发送邮件提示。在gerrit.config中的[sendemail]处进行配置,下面是的一个例子。
[sendemail]
enable = true
smtpServer = smtp.gmail.com
smtpServerPort = 465
smtpEncryption = ssl
smtpUser = nuaayan@gmail.com
smtpPass = ******
sslVerify = false
from = CodeReview&nuaayan@gmail.com&
五. GERRIT公钥配置
1.注册用户
访问http://192.168.5.102:8081/, 点击右上角的"Register",使用google或yahoo邮箱注册,如果没有,需要提前申请。点击右上角的"Settings", 填写“Profile“里Username,"Contact Information"中Full Name,点击"Save Changes";
2.配置公钥
~$ mkdir .ssh
~$ cd .ssh
~/.ssh$ ssh-keygen -t rsa -C nuaayan@gmail.com (注:一路按回车即可)
在.ssh文件夹里添加新文件config, 内容如下:
Host nuaayan
Hostname 192.168.5.102
Port 29418
User nuaayan
PubkeyAuthentication yes
IdentitiesOnly yes
PasswordAuthentication no
IdentityFile ~/.ssh/id_rsa
进入gerrit - Settings - SSH Keys,填入Username(和config的User一致); 并将~/.ssh/id_rsa.pub的内容复制到"Add SSH Public Key"
~$ ssh nuaayan (192.168.5.102的别名,在config中配置过)
出现下面两行,就说明连接成功了。
gerrit: no shell available
Connection to 192.168.5.102 closed.
如果遇到错误:
Agent admitted failure to sign using the key.
Permission denied (publickey,password).
请在 .bashrc 中设置环境变量并重启bashrc:
export SSH_AUTH_SOCK=0
六. 新建/检出 GIT仓库
1. 新建git仓库:
ssh nuaayan gerrit create-project -n test/project1
2. 察看本人仓库权限 :
ssh nuaayan gerrit ls-projects
3. 检出仓库test/project1
git clone nuaayan:test/project1
被射下的眼泪
浏览: 27231 次
来自: 江西萍乡
你好,请问这个系统你是在什么环境下实现的。?
你的源代码是有错的~~~你按规则摆放残局调用残局的函数用错了~ ...
SUSE的yast2配置蛮方便的,其实看生成的文件还是挺简单的 ...
谢谢 对我挺有帮助的温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!&&|&&
LOFTER精选
网易考拉推荐
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
1、SSH密钥对的生成和使用
本版本库与服务器共用同一账号,并采用标准SSH账号访问,即用户账号可以直接登陆到服务器获得shell。因此远程账户需要将SSH公钥追加到版本库所在服务器的对应账号目录(请修改为对应的用户名)。
1 生成本地账号SSH密钥对
$ cd ~yuwf
$ ssh-keygen
2 远程追加到服务器账号公钥列表
$ ssh-copy-id -i .ssh/id_rsa.pub yuwf@192.168.247.111
3 将SSH公钥(Geriit服务器所在的账号和远程执行GIT操作的账号两者都要)内容粘贴到Gerrit登陆的WEB页面中(上图,或下图):
2、通过SSH协议取得GIT版本库
对于拥有shell登陆权限的用户账号,可以用下面的标准的SSH协议语法访问GIT版本库:
ssh://[&username&@]&server&[:&port&]/path/to/repos/myrepo.git
1 配置账号相关的GIT配置
需要在配置好账号相关的GIT,尤其是账号的email,email必须与Gerrit中有效的email地址一致(请修改有效的用户名和邮件地址)。
$ git config --global user.name "&your name&"
$ git config --global user.email &your email&
2 对于采用Gerrit服务器的版本库,使用下面的命令来取得代码:
$ git clone ssh://192.168.247.111:29418/test
3 取得钩子脚本:
$ scp -P 29418 -p 192.168.247.111:/hooks/commit-msg .git/hooks/
3、修改代码并向服务器提交
用户zrm通过CLONE取得代码后,对其进行修订。
1 修改test.c,添加如下代码并保存:
void test_zrm(void)
&&& printk("ZRM: Zhang Rongming, &&\n");
2 提交修订
如果新增了文件,添加新文件:
$ git add .
如果删除或修改了文件,使用命令:
$ git add -u
编写说明并提交:
git commit -a -s -m "test_zrm"
其中,“-s”参数对于Gerrit的提交是必须的,它用于在提交说明中加入“Signed-off-by:”标记。“–m”是提交说明,如果没有,则自动打开相关联的编辑器,以让提交者编辑提交说明。
3 查看下提交日志
$ git log --pretty=full -1
可以看到有特殊的标签,即“Signed-off-by:”,它是由钩子脚本自动生成的。
4、向审核服务器提交修订
Gerrit服务器不能直接提交,否则会提示“prohibited by Gerrit”错误。正确的做法是,必须向特殊的引用推送,这样Gerrit自动将新提交转为评审任务。
$ git push origin HEAD:refs/for/master
三、审核流程
1、代码评审
以hz用户登录Gerrit服务器:
http://hz:.247.111/gerrit/login/
打开All-&Open标签,可以新提交到Gerrit状态为Open的评审任务,如下图:
可以在URL栏中看到 ,这是一个评审编号为2的任务。
作为演示,让此次提交通过代码审核:
选择“+1 Looks good to me, but someone else must approve”,点击“Publish Comments”,通过评审。可以在Message文本框中写入评审意见,特别是在打回重做时,需要填写意见,让提交者知道修订的问题所在。
hz作出评审决定后,提交者zrm会收到一封电子邮件,通知其修订的评审结果。
2、评审任务没有通过测试
以yuwf用户登录Gerrit服务器,打开All-&Open标签,如图:
阅读(1587)|
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
历史上的今天
loftPermalink:'',
id:'fks_',
blogTitle:'Gerrit代码审核服务器简明手册',
blogAbstract:'(v1.0, )
Finish off all japs.
blogTag:'git,gerrit',
blogUrl:'blog/static/',
isPublished:1,
istop:false,
modifyTime:1,
publishTime:7,
permalink:'blog/static/',
commentCount:0,
mainCommentCount:0,
recommendCount:0,
bsrk:-100,
publisherId:0,
recomBlogHome:false,
currentRecomBlog:false,
attachmentsFileIds:[],
groupInfo:{},
friendstatus:'none',
followstatus:'unFollow',
pubSucc:'',
visitorProvince:'',
visitorCity:'',
visitorNewUser:false,
postAddInfo:{},
mset:'000',
remindgoodnightblog:false,
isBlackVisitor:false,
isShowYodaoAd:false,
hostIntro:'',
hmcon:'1',
selfRecomBlogCount:'0',
lofter_single:''
{list a as x}
{if x.moveFrom=='wap'}
{elseif x.moveFrom=='iphone'}
{elseif x.moveFrom=='android'}
{elseif x.moveFrom=='mobile'}
${a.selfIntro|escape}{if great260}${suplement}{/if}
{list a as x}
推荐过这篇日志的人:
{list a as x}
{if !!b&&b.length>0}
他们还推荐了:
{list b as y}
转载记录:
{list d as x}
{list a as x}
{list a as x}
{list a as x}
{list a as x}
{if x_index>4}{break}{/if}
${fn2(x.publishTime,'yyyy-MM-dd HH:mm:ss')}
{list a as x}
{if !!(blogDetail.preBlogPermalink)}
{if !!(blogDetail.nextBlogPermalink)}
{list a as x}
{if defined('newslist')&&newslist.length>0}
{list newslist as x}
{if x_index>7}{break}{/if}
{list a as x}
{var first_option =}
{list x.voteDetailList as voteToOption}
{if voteToOption==1}
{if first_option==false},{/if}&&“${b[voteToOption_index]}”&&
{if (x.role!="-1") },“我是${c[x.role]}”&&{/if}
&&&&&&&&${fn1(x.voteTime)}
{if x.userName==''}{/if}
网易公司版权所有&&
{list x.l as y}
{if defined('wl')}
{list wl as x}{/list}2381人阅读
android(2)
(文章来源: http://blog.csdn.net/ljchlx/article/details/)
本文所使用的关于apache的配置设置是基于apache2.2的,因此部分设置与apache 2.3/2.4稍有不同.
&&&&&&&&& Order deny,allow
&&&&&&&&& Allow from all
就应该改为
&&&&&&&&& Require all granted
&进一步详细的请查看apache说明文档。
系统配置环境
Gerrit 是一个基于 Web 的代码评审和项目管理的工具,面向基于 Git 版本控制系统的项目。因此需要Apache、Mysql、GIT等相关软件的支持系统配置:新装的UBANTU LINUX系统请先更新自己的系统软件包$sudo apt-get dist-upgrade
$sudo adduser project
以新用户身份操作$sudo su - project
$sudo apt-get install
git-core apache2.2-bin apache2.2-common apache2-utils
安装Gerrit
1.创建一个以项目名称命名的新用户,以project为例(如以创建可省)
$sudo adduser project
以新用户身份操作
$sudo su - project
2.创建安装目录,以项目名命令。(建议直接拷贝使用其它项目的gerrit安装目录)$mkdir -p gerrit_reviewsite3.下载gerrit
4.安装并配置初始化gerrit java -jar gerrit-2.6.1.war init -d ~/gerrit_reviewsite/
reate '/home/gerrit2/review-site' [Y/n]?
*** Git Repositories
Location of Git repositories [git]:
*** SQL Database
Database server type [H2/?]:
//改成MYSQL或者使用H2
*** User Authentication
Authentication method [OPENID/?]: HTTP
//注意这个不要按回车跳过去了,否则不是HTTP认证,是需要用google的OPENID
Get username from custom HTTP header [y/N]?&:
SSO logout URL&:
*** Email Delivery
SMTP server hostname [localhost]:
//自己改成自己的邮箱smtp
SMTP server port [(default)]:&25
SMTP encryption [NONE/?]:
SMTP username [?]:
//自己改成自己的邮箱
's password&: xxxxxxx
confirm password&: xxxxxxx
*** Container Process
Run as [project]:
Java runtime [/usr/lib/jvm/java-6-sun-1.6.0.24/jre]:
Copy gerrit.war to /home/gerrit2/review-site/bin/gerrit.war [Y/n]?
Copying gerrit.war to /home/gerrit2/review-site/bin/gerrit.war
*** SSH Daemon
Listen on address [*]:
Listen on port [29418]:
//如果同一个用户下建多个gerrit,请不用都公用29418这个端口号 如
Gerrit Code Review is not shipped with Bouncy Castle Crypto v144
If available, Gerrit can take advantage of features
in the library, but will also function without it.
Download and install it now [Y/n]? & &&//这里如果选择了y,则gerrit服务器上的fingerprint会有两个,否则则只有一个Downloading http://www.bouncycastle.org/download/bcprov-jdk16-144.jar ... OKChecksum bcprov-jdk16-144.jar OKGenerating SSH host key ... rsa... dsa... done*** HTTP Daemon*** Behind reverse proxy
//使用反向代理的话必须选择y来配置,默认是NProxy uses SSL (https://)
[y/N]? nSubdirectory on proxy server
[/]: /project/
//可以选择直接跳过,那样你的gerrit最后的URL是 on address
[*]:&Listen on port
//切记,此端口号一定不要和apache2占用相同的端口号,多个gerrit可以84
//否则就会Starting Gerrit Code Review:FailedCanonical URL&&&&&&&&&&&&&&&&& [http://*/]:http://192.168.11.73/project/
//上一步Subdirectory on proxy server 跳过不填则是
(80为你将要在apache 给gerrit设置的端口)Initialized /home/gerrit2/review-siteExecuting&/home/gerrit2/review-site/bin/gerrit.sh startStarting Gerrit Code Review: OK=========================================QA=======================================================================================Q:Configuration ErrorCheck the HTTP server's authentication settings.The HTTP server did not provide the username in the Authorizationheader when it forwarded the request to Gerrit Code Review.If the HTTP server is Apache HTTPd, check the proxy configurationincludes an authorization directive with the proper location, ensuringit ends with '/':In error_log:ERROR com.google.gerrit.httpd.auth.container.HttpLoginServlet : Unableto authenticate user by Authorization request header. &Check containeror server configuration.A:You cannot run these on the same port. Your Apache NameVirtualHostshould be on a different port than the internal Jetty web sever thatGerrit is using.即gerrit和apache2占用相同的端口号例如:cat review_site_project/etc/gerrit.config:[httpd]& & & &listenUrl =&cat /etc/apache2/apache2.conf :NameVirtualHost x.x.x.x:8081&VirtualHost x.x.x.x:8081&apache2和gerrit都使用了8081,肯定有一个启动不来的,一般是gerrit5. 启动gerrit时失败,查看gerrit_reviewsite/log/error_log中的错误信息如下:[ 02:56:56,387] [main] WARN& com.google.gerrit.sshd.SshDaemon : Disabling cipher aes192-cbc: I try installing unlimited cryptography extension
[ 02:56:56,388] [main] WARN& com.google.gerrit.sshd.SshDaemon : Disabling cipher aes256-cbc: I try installing unlimited cryptography extension
[ 02:56:56,390] [main] WARN& com.google.gerrit.sshd.SshDaemon : Disabling cipher aes256-ctr: I try installing unlimited cryptography extension
[ 02:56:56,393] [main] WARN& com.google.gerrit.sshd.SshDaemon : Disabling cipher arcfour256: Illegal key size o try installing unlimited cryptography extension
[ 02:56:56,425] [main] WARN& com.google.gerrit.server.config.GitwebCgiConfig : gitweb not installed (no /usr/lib/cgi-bin/gitweb.cgi found)
[ 02:56:56,882] [main] INFO& org.eclipse.jetty.util.log : Logging initialized @14808ms
[ 02:56:56,950] [main] INFO& com.google.gerrit.server.git.LocalDiskRepositoryManager : Defaulting core.streamFileThreshold to 45m
[ 02:56:56,999] [main] ERROR com.google.gerrit.pgm.Daemon : Unable to start daemon
com.google.inject.ProvisionException: Unable to provision, see the following errors:
1) Schema not yet initialized.& Run init to initialize the schema:
$ java -jar gerrit.war init -d /home/watasianata/gerrit_review
&&&&&&& at com.google.gerrit.server.schema.SchemaVersionCheck.start(SchemaVersionCheck.java:56)
&&&&&&& at com.google.gerrit.lifecycle.LifecycleManager.start(LifecycleManager.java:74)
&&&&&&& at com.google.gerrit.pgm.Daemon.start(Daemon.java:302)
&&&&&&& at com.google.gerrit.pgm.Daemon.run(Daemon.java:203)
&&&&&&& at com.google.gerrit.pgm.util.AbstractProgram.main(AbstractProgram.java:64)
&&&&&&& at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
&&&&&&& at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
&&&&&&& at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
&&&&&&& at java.lang.reflect.Method.invoke(Method.java:606)
&&&&&&& at com.google.gerrit.launcher.GerritLauncher.invokeProgram(GerritLauncher.java:159)
&&&&&&& at com.google.gerrit.launcher.GerritLauncher.mainImpl(GerritLauncher.java:100)
&&&&&&& at com.google.gerrit.launcher.GerritLauncher.main(GerritLauncher.java:56)
&&&&&&& at Main.main(Main.java:25)
1)原因1,google搜素到有如下可能,就是我们在新的gerrit的gerrit.config中增加了如下索引的配置 [index]
&&&&&&& type = LUCENE而我们的系统中,并未安装Lucene,因此参照网上的例子安装下Lucene(http://keping.me/ubuntu%E4%B8%8Blucene%E7%8E%AF%E5%A2%83%E6%90%AD%E9%85%8D/)。2)Lucene安装完毕了,试一下,发现仍然报上述错误。万般无奈之下,只能按照提示重新跑了一遍java -jar gerrit.war init -d /home/watasianata/gerrit_review逐个参数检查,终于发现原来是在安装Lucene时,将原本jkd1.7的环境改为了jdk1.8,而gerrit却仍然采用了jdk1.7的配置,能不出错吗?赶紧将&&&&&&& user = watasianata&&&&&&& javaHome = /usr/local/devtools/jdk1.8.0_45/jre改好。再次试,这次仍然出错:[ 03:24:10,152] [main] INFO& com.google.gerrit.server.plugins.PluginLoader : Loaded plugin reviewnotes, version v2.12.3[ 03:24:10,214] [main] INFO& com.google.gerrit.server.plugins.PluginLoader : Loaded plugin singleusergroup, version v2.12.3[ 03:24:10,216] [main] ERROR com.google.gerrit.pgm.Daemon : Unable to start daemoncom.google.inject.ProvisionException: Unable to provision, see the following errors:1) No
run Reindex1 error&&&&&&& at com.google.gerrit.lucene.LuceneVersionManager.start(LuceneVersionManager.java:124)&&&&&&& at com.google.gerrit.lifecycle.LifecycleManager.start(LifecycleManager.java:74)&&&&&&& at com.google.gerrit.pgm.Daemon.start(Daemon.java:302)&&&&&&& at com.google.gerrit.pgm.Daemon.run(Daemon.java:203)&&&&&&& at com.google.gerrit.pgm.util.AbstractProgram.main(AbstractProgram.java:64)&&&&&&& at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)&&&&&&& at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)&&&&&&& at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)&&&&&&& at java.lang.reflect.Method.invoke(Method.java:497)&&&&&&& at com.google.gerrit.launcher.GerritLauncher.invokeProgram(GerritLauncher.java:159)&&&&&&& at com.google.gerrit.launcher.GerritLauncher.mainImpl(GerritLauncher.java:100)&&&&&&& at com.google.gerrit.launcher.GerritLauncher.main(GerritLauncher.java:56)&&&&&&& at Main.main(Main.java:25)这次的信息明确多了,直接重新reindex一次,java -jar ~/tool/gerrit-2.12.3.war reindex好啦!5.按下面内容修改gerrit_reviewsite/etc/gerrit.conf 及GERRIT的配置文件[gerrit]&&&&&&& basePath = git &//指定被gerrit管理的所有git库存放位置,即review_site_project/git/&&&&&&& canonicalWebUrl = http://42.62.42.75:8090/project & &//指定web访问gerrit的网址//填自己的ip和端口号,勿完全抄[database]&&&&&&& type = h2 & & & & &//指定gerrit所默认数据库类型,可以选用mysql&&&&&&& database = db/ReviewDB & & [auth]&&&&&&& type = HTTP & &//指定浏览器登录gerrit时的认证方式[sendemail]&&&&&&& enable = true&&&&&&& smtpServer = &&&&&&& smtpServerPort = 25&&&&&&& smtpUser = &&&&&&& smtpPass = xxxxxxxx&&&&&&& sslVerify = false&&&&&&& from = CodeReview&&[container]&&&&&&& user = gerritserver & & & & & &//指定gerrit所在机器的用户身份与上文创建的用户对应一致&&&&&&& javaHome = /usr/lib/jvm/jdk7/jre & & & & & //系统本身自带[sshd]&&&&&&& listenAddress = *:29418 & & & & &//指定sshd服务监听的端口号[httpd]&&&&&&& listenUrl = http://*:8081/project & & & & & &//指定http代理地址[cache]&&&&&&& directory = cache & & &//缓存位置配置Apache$sudo apt-get install
apache2.2-bin apache2.2-common apache2-utils 1.创建编辑apache配置文件,添加如下内容(下面以Ubuntu系统为例请注意不同操作系统apache配置文件的区别)也可配置 apache2.conf&httpd.conf,我们这里配置的是/etc/apache2/sites-available/gerrit$sudo vi /etc/apache2/sites-available/defalt
&VirtualHost 192.168.134.59:8090&&&& ServerName 192.168.134.59&&& ProxyRequests Off&&& ProxyVia Off&&& ProxyPreserveHost On&&& &Proxy *&&&&&&&&&& Order deny,allow&&&&&&&&& Allow from all&&& &/Proxy&&&& &Location &/project/login/&&&&&&& AuthType Basic&&&&& AuthName &Gerrit Code Review&&&&&& AuthBasicProvider file&&&&& AuthUserFile ../../../etc/apache2/passwords
//指定http登录认证的的paassword文件所在位置,放哪都行,根据后来 sudo htpasswd -cb& /etc/apache2/passwords admin pwxxx 来定。
&&&&& Require valid-user&&& &/Location&&&& AllowEncodedSlashes On&&& RedirectMatch& ^/project$&&&&&&&&&&&&&&& /project/&&& ProxyPass /project/ http://127.0.0.1:8081/project/&&& ProxyPassReverse /project/ http://127.0.0.1:8081/project/&/VirtualHost&保存退出
$cd /etc/apache2/sites-enabled/
$sudo ln ../sites-available/gerrit .
2.创建passwd文件,添加gerrit登录用户,-c参数为创建,仅限第一次添加用户时使用$sudo htpasswd -cb
/etc/apache2/passwords admin passwordxxx
第二次添加其他用户时,不要加-c了:
$sudo htpasswd -b
/etc/apache2/passwords test test3继续配置apache2$sudo vi /etc/apache2/http.conf
//在文件中加入以下内容 ServerName localhost$cd /etc/apache2/mods-enabled
$sudo ln -s /etc/apache2/mods-available/proxy.conf proxy.conf
$sudo ln -s /etc/apache2/mods-available/proxy.load proxy.load
$sudo ln -s /etc/apache2/mods-available/proxy_http.load proxy_http.load配置apache2的监听端口:/etc/apache2$sudo vi ports.conf
NameVirtualHost *:80
Listen 8080
//不要给gerrit!
Listen 8000
//不要给gerrit!
添加apache2的tcp端口号,切记不要把gerrit的,即Listen on port
[8081]: 不要输入上面配置给apache2的端口号,切记!!!
可以用sudo netstat -lnp | grep 80
查看相关80的所有端口使用情况否则gerrit 起不来的
搭建多个gerrit 时Listen on port
[8081]:可以用84 等
&Apache2 配置安装 FQA:Q:启动apache报错Syntax error on line 300 of /etc/apache2/apache2.conf:Invalid command 'ProxyPass', perhaps misspelled or defined by a module not included in the server configuration
A:配置了反向代理,但是没有打开module,执行下面操作cd /etc/apache2/mods-enabled
ln -s /etc/apache2/mods-available/proxy.conf proxy.conf
ln -s /etc/apache2/mods-available/proxy.load proxy.load
&ln -s /etc/apache2/mods-available/proxy_http.load proxy_http.load
Q:启动Apache报错No apache MPM package installed
A:安装apache2-mpm-worker软件包$sudo apt-get install apache2-mpm-worker
Q:启动Apache报错&apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
A:修改/etc/apache2/http.conf文件,在文件中加入以下内容ServerName localhost&Q:(13)Permission denied: make_sock: could not bind to address 0.0.0.0:80
A:需要用ROOT用户执行 & 直接 sudo &/etc/init.d/apache2 restart &就OK了 &
&启动服务1.启动apachesudo /etc/init.d/apache2 restart
2.启动gerrit服务$review_site_project/bin/gerrit.sh start
登录gerrit在浏览器地址栏中输入<span style="color:#8.11.73/project/&&&&注:Subdirectory on proxy server [/]:选择直接跳过& 则192.168.11.73:80在显示的登录框中输入用户名/密码,即之前配置passwords&$sudo htpasswd -cb
/etc/apache2/passwords admin passwordxxadminpasswordxxNote: 请注意第一个登入的用户,Gerrit会自动将其定义为管理员3. 接入企业内部域账号&&& &Location &/project/login&&&&&&& AuthType Basic&&&&& AuthName &Gerrit Code Review&&&&&& AuthBasicProvider ldap&&&&& AuthzLDAPAuthoritative off&&&&& AuthLDAPURL &ldap://192.168.xx.x:xxx/OU=xxxxx,OU=_BJKS(xxx),DC=xxxxx,DC=cn?sAMAccountName?sub?(objectClass=user)&&&&&& AuthLDAPBindDN &&&&& AuthLDAPBindPassword xxxx&&&&& Require valid-user&&& &/Location&
&&相关文章推荐
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:8048次
排名:千里之外
(1)(1)(1)(1)(2)(1)(2)(2)}

我要回帖

更多关于 红米note4x限量多少台 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信