Deploy Gogs on Alibaba Cloud ubuntu14.4

Source: Internet
Author: User
Tags nginx server nginx reverse proxy
This is a creation in Article, where the information may have evolved or changed. Previously deployed on the CentOS Gitlab, but because the purchase of the configuration is relatively low, the actual effect is not ideal, often card machine. Moreover, the Gitlab configuration is quite cumbersome and requires a lot of support from the wall pack. Recently in the development with Golang, by the discovery of gogs this git management system, it is said that after long-term iteration is stable enough, so also want to try the effect, after all, Golang is known for efficiency, presumably the system requirements will be very low. Here is a brief introduction to this successful configuration experience.   This article configuration item nginxmysqlgitgogs gogs v0.9.97 @ 2016-09-01  First of all, the basic steps gogs there are two installation scenarios, the first is the use of binary installation, the simplest, configuration good git environment, Run binary files can be done, the second is to compile the source code, set up a good environment, and then install the Golang language development environment and other needs to use the package, and finally compile their own. In fact, the difference is not big, the general use of the first proposal can be done. The second scheme is mainly used for special system environment and two modification development.   Two scenarios require these steps: 1, install Git, nginx to do reverse proxy resolution domain name, optional installation MySQL database. 2. Create a git account. 3, download gogs binary file, run configuration complete.   Below details the installation Step 1, install the GIT package, and create a git account. The following is an example of a "git" user. # install Gitsudo apt-get install-y git# create git account sudo adduser git 2, install nginx, install MySQL, or do not install any database. PS: The latest "GOGSV 0.9.97 @ 2016-09-01" version supports MySQL, Psql, SQLite. sudo apt-get install-y nginxsudo apt-get install-y mysql 3, in the git account "/home/git" directory, create gogs installation directory, git library storage directory. PS: Because Gogs runs on a git account, you need permissions to both the Gogs directory and the GIT library directory, preferably in your git account directory.  4, download the gogs Linux binary installation package and put it in the $home/git/gogs directory. Gogs v0.9.97 @ 2016-09-01 Download Address: Https://dl.gogs.io/gogs_v0.9.97_linux_amd64.tar.gzhTtp://7d9nal.com2.z0.glb.qiniucdn.com/gogs_v0.9.97_linux_amd64.tar.gz 5, enter $home/git/gogs, run the gogs binary file. # Enter the Gogs directory cd/home/git/gogs# start the Gogs Web service./gogs webps: This is the way to run Gogs directly, but it fails when the terminal is closed. So later you'll need to put the run script into the/ETC/INIT.D directory and make it self-running.  6, Browser access "http://Site ip:3000", fill in the configuration information as required. After completion, you can access to the Gogs service via Http://IP address: 3000. The following Gogs service is added to boot and resolves to the subdomain. PS: If a port conflict is found, you can modify the port configuration within the "/home/git/gogs/custom/conf/app.ini" file.  7, when finished, put the "/home/git/gogs/scripts/init/debian/gogs" file under "/etc/init.d", then you can use the service gogs command. # Copy the script to the INIT.D directory sudo cp/home/git/gogs/scripts/init/debian/gogs/etc/init.d# run services service Gogs start 8, set boot from boot. # Vim to open rc.local, add boot run script sudo vim/etc/rc.local# nginx Server service nginx start# MySQL Services service MySQL start# gogs service go GS start 9, configure the reverse proxy within Nginx, the sub-domain name to resolve to localhost:3000. # nginx Site Settings Server {server_name Xx.localhost.com;listen 80;location/{Proxy_pass http://localhost:3000/;}}  10, configuration complete.  faq* git repository address is localhost? After the configuration is complete, you can change the project address to "Domain name: 3000" in the Gogs configuration file. Note that the Nginx reverse proxy settings should be changed accordingly.   This article Permanent update address: http:Www.linuxdiyf.com/linux/27424.html
Related Article

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.