0% found this document useful (0 votes)
53 views5 pages

Gogs Installation AND (Deployment)

This document provides step-by-step instructions for installing Gogs, a self-hosted Git service, on an Ubuntu server. It includes installing prerequisites like MySQL, Nginx, configuring the firewall to allow HTTP traffic, creating the Gogs database and user, downloading and configuring Gogs, and setting up Nginx as a reverse proxy. Once completed, the Gogs installation is accessible via the server's IP address or domain name.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views5 pages

Gogs Installation AND (Deployment)

This document provides step-by-step instructions for installing Gogs, a self-hosted Git service, on an Ubuntu server. It includes installing prerequisites like MySQL, Nginx, configuring the firewall to allow HTTP traffic, creating the Gogs database and user, downloading and configuring Gogs, and setting up Nginx as a reverse proxy. Once completed, the Gogs installation is accessible via the server's IP address or domain name.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Gogs installation AND (deployment)

FIRST ISTALL MYSQL( DATA BASE ) AND NGINIX (WEBBROWSER) MANUALLY


WE CAN INSTALL GOGS ON UBUNDU SERVER 20.04 LTS VERSION FOCAL.

INSATLL MYSQL STEP BY STEP

1. Open the terminal and run the following command:


2. sudo apt update
3.  Enter your password and wait for the update to finish.
4.  Next, run:- sudo apt upgrade
Install MySQL
5. sudo apt install mysql-server
6.  When asked if you want to continue with the installation, answer Y and hit ENTER.
7. The system downloads MySQL packages and installs them on your machine.
8. sudo apt install mysql-client- APPLY THIS COMMAND
9. Check if MySQL was successfully installed by running:- mysql –version
Securing MySQL
10. sudo mysql_secure_installation – APPLY THIS COMMAND

PUT THE PASSWORD FOR MYSQL AND ANOTHER QUESTION FROM MYSQL PUT Y
BETTER AND ANOTHER THING IS DEPEND ON THE USAGE CHAGE IT TO N
11.  Check if MySQL Service Is Running:- sudo systemctl status mysql
12. Log in to MySQL Server

INSTALL WEBSERVER AS NGINIX


FOLOW THE COMMAND AND EXECUTE

 sudo apt update



 sudo apt install nginx
Step 2 – Adjusting the Firewall

 sudo ufw app list

OUT PUT AS

Output
Available applications:
Nginx Full
Nginx HTTP
Nginx HTTPS
OpenSSH

NGINIX HTTP ENABLE WITH PORT NUMBER 80 BY

sudo ufw allow 'Nginx HTTP

You can verify the change by typing:

Output
Status: active

To Action From
-- ------ ----
OpenSSH ALLOW Anywhere
Nginx HTTP ALLOW Anywhere
OpenSSH (v6) ALLOW Anywhere (v6)
Nginx HTTP (v6) ALLOW Anywhere (v6)

Checking your Web Server

 systemctl status nginx

OUTPUT BECOME

Output
● nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset:
enabled)
Active: active (running) since Fri 2020-04-20 16:08:19 UTC; 3 days ago
Docs: man:nginx(8)
Main PID: 2369 (nginx)
Tasks: 2 (limit: 1153)
Memory: 3.5M
CGroup: /system.slice/nginx.service
├─2369 nginx: master process /usr/sbin/nginx -g daemon on;
master_process on;
└─2380 nginx: worker process
NOW WEBSERVER WORKING FINE BT TEST :- http://your_server_ip

GET NGINIX HOME PAGE AS WORKING FINE

THEN CREATE THE GOGS DEVELOPMENT

STEP UP THE DATA BASE

sudo mysql -u root -p


SET GLOBAL innodb_file_per_table = ON;
CREATE DATABASE gogsdb;

CREATE USER 'gogsuser'@'localhost' IDENTIFIED BY 'new_password_here';


GRANT ALL ON gogsdb.* TO 'gogsuser'@'localhost' IDENTIFIED BY 'user_password_here' WITH
GRANT OPTION;

ALTER DATABASE gogsdb CHARACTER SET = utf8mb4 COLLATE utf8mb4_unicode_ci;

FLUSH PRIVILEGES;
EXIT;

NOW THE DATABASE IS WORKING ON LOCAL HOST AS USER NAME AS gogsuser, database name as gogsdb

Edit some code on the file path as cd /etc/mysql/mariadb.conf.d/50-server.cnf in the file ( 50-server .cnf)
put the data as innodb_file_format = Barracuda

innodb_large_prefix = 1

innodb_default_row_format = dynamic
then restar mariadb by command - sudo systemctl restart mariadb.service

installing gogs by command below


sudo adduser --system --group --disabled-password --shell /bin/bash --home /home/git
--gecos 'Git Version Control' git

cd /tmp
wget https://dl.gogs.io/0.11.91/gogs_0.11.91_linux_amd64.tar.gz
sudo tar xvf gogs_0.11.91_linux_amd64.tar.gz -C /home/git
sudo chown -R git: /home/git/gogs
sudo cp /home/git/gogs/scripts/systemd/gogs.service /etc/systemd/system/

sudo systemctl daemon-reload


sudo systemctl enable gogs
sudo systemctl start gogs

sudo systemctl status gogs-in this we can see the googs server is working or not if
working go forward and take configuration on nginix file path as follow below

cd /etc/nginix/sites-enabled/gogs.biaodianfu.com- middle portion is optional eg we can


put as skylux

by using nano editer the file last mentioned add this below shown and save it
server {
listen 80;
server_name gogs.biaodianfu.com;

location / {
proxy_pass http://localhost:3000;
}

Restart the nginix by command - sudo systemctl restart nginx

Try to browse on webbrowser http://ipaddress:3000


We can get the installing page on browser

Enter msql usename password and host name

Another section add shh ip address port number

Add the domain addredd for the application running Ip address

You can also add the mail id username and password for administrative privillage

After click the install button and complet the install

After install try to login with user name and password early set on there these are the
initial insatalling process after we can create organization user admin all things we can
add on it it work as self hosting prorety server with storage repository

We can follow this link also :- https://www.sobyte.net/post/2021-11/gogs-gitea/

You might also like