Create git servers and Bug Tracking in Windows XP

Source: Internet
Author: User
Tags redmine ssh port ssh server
Document directory
  • 1.4.1 generate public and private keys
  • 1.4.2 configure the Public Key
  • 1.4.3 try to connect to sshd server
  • 5.5.1 install mongrel
  • 5.5.2 download the mongrel bug patch
  • 5.5.3 register the mongrel Service
  • 5.5.4 run mongrel and Apache simultaneously
1. Install the Open-ssh software package on the SSH server 1.1

It is very easy to create an SSH server on Ubuntu, but it will take some effort on XP. First, install cygwin. Fortunately, Netease provides cygwin images, so this step is now very simple.

1. Download setup.exe from cygwin's official website http://Cygwin.com

2. Select http://mirrors.163.com during installation, download speed is particularly fast

3. Select the software package OpenSSH and install it until it is complete.

1.2 install the sshd service

1. After installation, put "C: \ cygwin \ bin" in the bin folder in the cygwin installation folder to the path environment variable.

2. Double-click the cygwin icon on the desktop to open the console. Enter "ssh-host-config-y" to register sshd as a system service and set it to auto start.

3. manually control the startup of the SSH service (or restart the computer) "Net start sshd" (disable it as "net stop sshd ")

4. configure the firewall and open the ssh port. The default value is 22 (TCP)

1.3 configure the sshd server

Use ultraedit or WordPad to open the configuration file c: \ cygwin \ etc \ sshd_config

1. # permitrootlogin Yes => permitrootloginno # prohibit Root Login

2. # passwordauthentication Yes => passwordauthenticationno # log on with a key only

3. # protocol => Protocol 2 # Only the SSH2 mode is allowed

1.4 Add the Public Key 1.4.1 to the user to generate the public key and Private Key

1. From http://www.chiark.greenend.org.uk /~ Sgtatham/Putty/download.html, download putty.zip

2. Run puttygen.exe after decompression.

3. In the bottom parameters select SSH-2 RSA, number of bits in a generated key fill in 1024 (this is the default)

4. Click Generate and move the mouse randomly until generation is complete.

5. Copy the Public Key (in the top box, start with ssh-RSA) to a text file and store it as the authorized_keys file.

6. Click Save private key to save the private key file.

Note: Do not directly click Save Public Key to save the public key. This will generate many useless strings and cause logon failure.

1.4.2 configure the Public Key

1. Switch to the user's home directory: Cd ~

2. Create a New. Ssh Folder: mkdir. SSH

3. Copy the saved public key file authorized_keys to the. Ssh folder.

4. Modify the authorized_keys attribute to 600: chmod 600 authorized_keys.

Note: The attributes group and other of the. Ssh folder cannot have the write permission. Otherwise, they cannot log on.

Note: Each Server user can have multiple public and private key pairs.

1.4.3 try to connect to sshd server

Run putty.zipto decompress putty.exe.

1. Fill in the host name in the session with the IP address of the sshd server installed

2. Set auto-loginusername in connection-> data to the username of the public key you Just configured.

3. Connection-> ssh-> auth private Keyfile for authentication select the generated private key file

4. Click Open to connect to the database.

2. Install the git2.1 Server

1. re-run cygwin's setup.exe and install git

2. initialize a bare repository. For example, run git -- bare init in the/opt/git/test. Git folder.

3. Make sure that the user name you set has the permission to read and write test. Git.

2.2 Client

1. Install the latest versions of msysgit and tortoisegit (both are installed by default)

2. Find an empty folder in tortoisegit and right-click Clone.

3. Enter <username >@< serverip/Name>:/opt/git/test. Git in the URL.

4. Select the load putty key, select the generated private key file, and click OK. If there is no accident, the file can be cloned successfully.

5. Add a file to see if it can be pushed. It should be okay.

3. Use http copy repository 3.1 to install Apache

1. re-run cygwin's setup.exe

2. install Apache httpd2

3. Add the user environment variable cygwin = server (I don't know why to add it. If I don't add it, it won't work)

4. re-open cygwin command line

5. Run cygserver-config to register cygserver as a Windows system service.

6. manually start the cygserver service: Net start cygserver

7. Run the Apache server:/usr/sbin/apachectl2 start

8. Open a browser to access http: // localhost, it works!

3.2 configure git Repository

1. Rename the pre-update.sample In the hooks folder in the repository to pre-Update

2. Add execution attributes: chmod A + x hooks/pre-Update

Note: This Configuration updates the server's info after each push to ensure that HTTP and clone are correct.

3.3 configure Apache

1. Open the/etc/apache2/HTTP. conf file.

2. Search for the httpd-vhosts.conf and remove the # Before the # include/etc/apache2/extra/httpd-vhosts.conf line

3. Open the/etc/apache2/extra/httpd-vhosts.conf File

4. Add the following content at the end

<Virtualhost *: 80>

Serveradmin <your email>

Servernamegit. gitserver

DocumentRoot/opt/git

<Directory/opt/git/>

Orderallow, deny

Allowfrom all

</Directory>

</Virtualhost>

5. Restart the Apache server.

A)/usr/sbin/apachectl2 stop

B)/usr/sbin/apachectl2 start

3.4 client clone method

1. Configure the DNS server or directly modify the hosts file of the client, and direct the Server IP address to git. gitserver

2. Running git clone http://git.gitserver/test.git on the client should be able to clone anonymously without accident

4. Create a gitweb Server

Access the GIT repository through the web page.

4.1 download git source code

1. re-run cygwin's setup.exe,

A) install the GIT source file. The installation source file is in/usr/src.

B) install gcc4 and make

2. decompress the GIT source file and enter the decompressed folder.

3. Make gitweb_projectroot = "/opt/git" prefix =/usr gitweb/gitweb. cgi

4. CP-RF gitweb/srv/www/

Note: gitweb_projectroot specifies the GIT repository set folder

Note:/srv/www/is a folder created by Apache httpd2. You can also add other folders.

4.2 configure Apache

1. Open the/etc/apache2/extra/httpd-vhosts.conf File

2. Add the following content at the end

<Virtualhost *: 80>

Servernameweb. gitserver

DocumentRoot/srv/www/gitweb

<Directory/srv/www/gitweb>

Optionsexeccgi + followsymlinks + symlinksifownermatch

Allowoverrideall

Orderallow, deny

Allowfrom all

Addhandlercgi-script CGI

Directoryindexgitweb. cgi

</Directory>

</Virtualhost>

3. Restart the Apache server

4.3 Client Access Method

1. Configure DNS or directly modify the hosts file of the client so that web. gitserver points to the server

2. Enter http://web.gitserver in the browser

3. You can directly access the GIT repository.

5. Install redmine

Note: After the installation is complete, I found a link on the official website to create an installation package for Windows. Click http://bitnami.org/stack/redmine.

Note: I tried bitnami today. It is really good. I installed Apache, MySQL, Ruby/rails/rake, redmine in one click and configured it automatically! Pay attention to the following issues:

  1. During installation, you must disable anti-virus software and security software, such as 360.
  2. Do not enter Chinese characters, such as the name of a person. Otherwise, the configuration file cannot be correctly generated.
  3. Note that no conflicting items have been installed before, such as ImageMagick (if they are installed at last, but redmine cannot be started, check the log file)
5.1 install Ruby/rails/Rack

1. Download and install rubyinstaller-1.8.7-p357.exe in rubyforge. (do not install the new version. The new version is not easy to use)

2. Select Ruby 1.8.7-p357-> Start command prompt with Ruby from the Start Menu.

3. Gem install rails-V = 2.3.11

4. Gem install rack-V = 1.1.1

5. Gem install MySQL

6. Download libmysql. dll from the installation instructions on the official website.

Bytes

7. Gem update -- System 1.6.2 (otherwise, the following DB: migrate will report an error)

5.2 download and decompress redmine

1. Download redmine 1.3.0 from the official website.

Http://rubyforge.org/frs? Group_id = 1850

5.3 install and configure MySQL

1. Download MySQL Win32 and install (I installed a mysql-5.5.19-win32.msi), remember to hook the optional MySQL execution file path to the Path Environment Variables

2. Open cmd, execute mysql-u root-P, enter the password, and then execute the following three SQL statements

A) Create Database redminecharacter set utf8;

B) create user 'redmine '@ 'localhost' identified by 'my _ password ';

C) Grant all privileges onredmine. * To 'redmine '@ 'localhost ';

5.4 configure redmine

1. Go to the redmine decompressed folder, rename config/database. yml. Example to config/database. yml, and change the content in production

Production:

Adapter: MySQL

Database: redmine

HOST: localhost

Username: redmine

Password: my_password

2. Run the following command in the redmine Folder:

A) rake generate_session_store

B) Set rails_env = Production

C) rake DB: migrate

D) rake redmine: load_default_data

3. test:

A) Ruby script/Server webrick-eproduction

B) Access http: // localhost: 3000 in the browser

C) log on to the Administrator: the user name is admin and the password is admin.

5.5 mongrel

The webrick server can only be used for testing. The mongrel server or Apache server can be used for publishing. However, the module corresponding to Apache is too difficult to complete and mongrel is better configured.

5.5.1 install mongrel

1. Install mongrel: Gem install mongrel

2. Install mongrel_service: Gem install mongrel_service

5.5.2 download the mongrel bug patch

Problems caused by incompatibility between rails and mongrel.

1. Download https://gist.github.com/raw/826692/cb0dcf784c30e6a6d00c631f350de99ab99e389d/mongrel.rb

2. Run rails -- version to see what version rails is. My version is 2.3.14, And I installed 2.3.11 ......

3. open mongrel. RB file, the first line after the if Will be a look will know that it is an array, add your rails version at the end, such as [, '2. 3.14 '], save

4. Save the mongrel. RB file to the config \ initializers \ subfolder in the redmine folder.

5.5.3 register the mongrel Service

1. register the service: mongrel_rails service: Install-N redmine-C <redmine folder path, such as c: \ redmine>-P 3000-e Production

2. Open Control Panel-> Administrative Tools-> services, find redmine, and set it to "automatic" to enable the redmine service to start up.

 

Note:

1. manually start the service: mongrel_rails service: Start-N redmine

2. manually stop the service: mongrel_rails service: Stop-n redmine

3. Delete the service: mongrel_rails service: Remove-N redmine

5.5.4 run mongrel and Apache simultaneously

It is said that the mod_proxy module of Apache can be used to map a folder of Apache to the port where mongrel is located, but it will not be neat and give up.

Resources used

For the convenience of everyone, I uploaded the files used during installation. There are two packages:

Http://download.csdn.net/detail/windtailljj/3999049

Http://download.csdn.net/detail/windtailljj/3999070

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.