Description = Gogs (Go Git Service) After = syslog.target After = network.target After = rvice After = rvice Type = simple User = git Group = git WorkingDirectory = /home/git/go/src//gogs/gogs ExecStart = /home/git/go/src//gogs/gogs/gogs web Restart = always Environment = USER=git HOME=/home/git WantedBy = multi-user.targetĮnable the systemd unit file: sudo systemctl enable gogs Open the PostgreSQL interactive terminal to create a new database and user for Gogs: sudo -u postgres psql -d template1 Install the required packages: sudo apt-get install -y postgresql postgresql-client libpq-dev Feel free to skip this section if you don’t want to use a database server with Gogs. Using a database server for Gogs is completely optional. You will return to this installation page after installing PostgreSQL and Nginx. Since you haven’t installed the database server yet, close the browser and stop the web server by pressing CTRL+C. Gogs will redirect the browser to the installation page. It will start the web server and listen for HTTP connections on port 3000 while outputting something like this: 9 15:41:41 Custom config (/home/git/go/src//gogs/gogs/custom/conf/app.ini) not found, ignore this if you're running first timeĩ 15:41:41 Custom path: /home/git/go/src//gogs/gogs/customĩ 15:41:41 Log path: /home/git/go/src//gogs/gogs/logĩ 15:41:41 Gogs: Go Git Service 0. It will produce a binary named gogs in the current directory. This may take a few minutes during which your console will appear unresponsive.īuild the Gogs binary: cd $GOPATH/src//gogs/gogs You’ll see output that resembles the following: go version go1.7 linux/amd64ĭownload and install Gogs: go get -u /gogs/gogs We need to specify the GOROOT environment variable since we are installing Go to a custom location.Ĭheck that Go is properly installed: go version echo 'export GOROOT=$HOME/local/go' > $HOME/.bashrcĮcho 'export GOPATH=$HOME/go' > $HOME/.bashrcĮcho 'export PATH=$PATH:$GOROOT/bin:$GOPATH/bin' > $HOME/.bashrc bashrc file so they will be available every time we enter the shell. Set the GOPATH environment variable to specify the location of our workspace. In this section we will download the latest version of Go (version 1.7 at the time of this writing) and install the package in the /home/git/local/go directory.Ĭreate the /home/git/local directory: sudo su - gitĭownload Go and extract the compressed file: wget So, create that user: sudo adduser -disabled-login -gecos 'Gogs' git When you install Go and Gogs, it will be under the user git. Update your system: sudo apt update & sudo apt upgrade Before Installing Gogsįollow the Getting Started and Securing Your Server guides, and make sure your Linode’s hostname is set. If you’re not familiar with the sudo command, you can check our Users and Groups guide. Commands that require elevated privileges are prefixed with sudo. This guide is written for a non-root user.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |