如何在windows中部署Gitblit

1.安裝Java環境html

2.下載Gitblit壓縮包java

http://gitblit.com/git

3.解壓後進行配置web

編輯gitblit-1.8.0\data\gitblit.properties文件apache

 

git.repositoriesFolder = F:/GitServer    注意目錄必需要用「/」而不是「\」。
server.httpPort = 8080
server.httpsPort = 8443windows

 

4.運行解壓目錄下的gitblit.cmd瀏覽器

 

5.在瀏覽器裏進行管理服務器

http://localhost:8080/app

在瀏覽器中訪問版本庫的時候,複製的按鈕須要Adobe Flash Playerless

 

6.導入證書

gitblit-1.8.0\data\certs\ca.cer

能夠參考http://blog.csdn.net/xtayfjpk/article/details/45669335  此文章有關於如何生成用戶證書以及服務器證書的細節

 

7.擴展:將GitBlit配置爲Windows服務

Gitblit uses Apache Commons Daemon to install and configure its Windows service.

  1. Review the contents of the installService.cmd where you may have to change the default keystore password.
  2. Set the ARCH value as appropriate for your installed Java Virtual Machine.
  3. Add any necessary --StartParams as enumerated below in Command-Line Parameters.
  4. Execute the script.

After service installation you can use the gitblitw.exe utility to control and modify the runtime settings of the service.
Additional service definition options and runtime capabilities of gitblitw.exe (prunmgr.exe) are documented here.

涉及到的一個啓動參數--StartParams="--storePassword;gitblit;--baseFolder;%CD%\data" ^    只要修改一下密碼就能夠了

NOTE:
If you change the name of the service from gitblit you must also change the name of gitblitw.exe to match the new service name otherwise the connection between the service and the utility is lost, at least to double-click execution.

 

cmd文件中提到了Procrun

 //IS Install service

 

Command-Line parameters override the values in gitblit.properties at runtime.

--baseFolder           The default base folder for all relative file reference settings
--repositoriesFolder   Git Repositories Folder
--userService          Authentication and Authorization Service (filename or fully qualified classname)
--httpPort             HTTP port for to serve. (port <= 0 will disable this connector)
--httpsPort            HTTPS port to serve.  (port <= 0 will disable this connector)
--sshPort              SSH Daemon port to serve.  (port <= 0 will disable this daemon)
--gitPort              Git Daemon port to serve.  (port <= 0 will disable this daemon)
--alias                Alias in keystore of SSL cert to use for https serving
--storePassword        Password for SSL (https) keystore.
--shutdownPort         Port for Shutdown Monitor to listen on. (port <= 0 will disable this monitor)
--dailyLogFile         Redirect logging to a rolling, daily log file instead of stdout
--tempFolder           Folder for server to extract built-in webapp

Example

java -jar gitblit.jar --userService c:/myrealm.config --storePassword something --baseFolder c:/data

 

服務安裝以後還須要另外設置

 

VM Considerations

By default, the service installation script configures your Windows service to use your default JVM. This setup usually defaults to a client VM.
If you have installed a JDK, you might consider using the gitblitw.exe utility to manually specify the server VM.

  1. Execute gitblitw.exe
  2. On the Java tab uncheck Use default.
  3. Manually navigate your filesystem and specify the server VM with the ... button
    Java Virtual Machine:
    C:\Program Files\Java\jre6\bin\server\jvm.dll

 

 

 

服務運行成功以後,假如經過https進行push的話,須要配置證書。

不然會提示fatal: unable to access url: SSL certificate problem: self signed certificate in certificate chain

 

有可能沒法啓動服務,能夠查看日誌gitblit-1.8.0\logs

[2017-05-19 17:29:14] [info] Commons Daemon procrun (1.0.10.0 64-bit) started
[2017-05-19 17:29:14] [error] Unable to open the Service Manager
[2017-05-19 17:29:14] [error] Access is denied.
[2017-05-19 17:29:14] [error] Commons Daemon procrun failed with exit value: 8 (Failed to install service)
[2017-05-19 17:29:14] [error] Access is denied.

http://stackoverflow.com/questions/13321132/apache-commons-daemon-procrun-access-is-denied-on-windows-7

Try running your command from a prompt with admin rights.

Right-click on the CMD.exe icon and select "Run as administrator" to start it that way.

用管理員權限打開cmd,而後進入installservice.cmd所在的目錄。用命令行打開。【須要注意的是,必須使用這種方法來處理,右鍵管理員權限運行是不行的】

 

8.配置成能夠使用Windows 域帳號進行登陸

realm.authenticationProviders = windows

 

9.配置郵件

http://gitblit.com/setup_hooks.html 

 

10.push failed for branch (n/a (unpacker error))

git.checkReferencedObjectsAreReachable = false

 

配置彙總

git.repositoriesFolder = D:/GitServerRepository
server.httpPort = 8080
realm.authenticationProviders = windows
federation.allowProposals = true
git.checkReferencedObjectsAreReachable = false

 

=====================================================================

Gitblit介紹

What is Gitblit?

Gitblit is an open-source, pure Java stack for managing, viewing, and serving Git repositories.
It's designed primarily as a tool for small workgroups who want to host centralized repositories.

GO: Single-Stack Solution

Gitblit GO is an integrated, single-stack solution based on Jetty.

You do not need Apache httpd, Perl, Git, or Gitweb. Should you want to use some or all of those, you still can; Gitblit plays nice with the other kids on the block.

This is what you should download if you want to go from zero to Git in less than 5 mins.

WAR: For Your Servlet Container

Gitblit WAR is what you should download if you already have a servlet container available that you wish to use. Jetty 6/7/8 and Tomcat 6/7 are known to work. Generally, any Servlet 2.5 or Servlet 3.0 container should work.

You decide how to use Gitblit

Gitblit can be used as a dumb repository viewer with no administrative controls or user accounts.
Gitblit can be used as a complete Git stack for cloning, pushing, and repository access control.
Gitblit can be used without any other Git tooling (including actual Git) or it can cooperate with your established tools.

All Transports

The SSH, HTTP, & GIT protocols are supported and ready-to-go out of the box.

Issue tracking with branch-based pull requests

Gitblit blends elements of GitHub, BitBucket, and Gerrit to provide a streamlined collaboration workflow based on branches within the primary repository.

 

 

 

 

=============================

Tickets

http://gitblit.com/tickets_setup.html

=================================

Gitblit進行遷移的時候,須要同步用戶設置,

git.repositoriesFolder = F:/GitServer
server.httpPort = 8080
server.httpsPort = 8443

 

Any important changes to the setting keys or default values will always be mentioned in the release log.

Gitblit v0.8.0 introduced a new default user service implementation which serializes and deserializes user objects into users.conf.

users.conf file will be automatically created from an existing users.properties file on the first launch after an upgrade.

To use the users.conf service,realm.userService=users.conf must be set.

This revised user service allows for more sophisticated Gitblit user objects and will facilitate the development of more advanced features without adding the complexity of an embedded SQL database.

users.properties and its user service implementation are deprecated as of v0.8.0.

users.properties會在服務器啓動的時候,自動轉換成users.conf

===============================

相關文章
相關標籤/搜索