Tuesday, January 4, 2022

How to Install Gitea with Mariadb on Debian 11

 Gitea is a community managed lightweight code hosting solution written in Go. || MariaDB Server is one of the most popular open source relational databases.
Offcial Website : https://gitea.io/en-us/
________________________________________________________________________________________________________________________
๐Ž๐ฎ๐ซ ๐’๐ž๐ซ๐ฏ๐ž๐ซ ๐’๐ฉ๐ž๐œ๐ข๐Ÿ๐ข๐œ๐š๐ญ๐ข๐จ๐ง:-
๐Ž๐ฌ : ๐ƒ๐ž๐›๐ข๐š๐ง ๐Ÿ๐Ÿ ๐›๐ฎ๐ฅ๐ฅ๐ฌ๐ž๐ฒ๐ž ๐Ÿ”๐Ÿ’ ๐๐ข๐ญ     || ๐‡๐จ๐ฌ๐ญ๐ง๐š๐ฆ๐ž:  debian.example.com     || ๐ˆ๐ ๐€๐๐๐ซ๐ž๐ฌ๐ฌ ๐จ๐Ÿ ๐’๐ž๐ซ๐ฏ๐ž๐ซ:192.168.1.60
________________________________________________________________________________________________________________________
                            lsb_release -cd  ; getconf LONG_BIT ; hostname ; hostname -I
 
apt install -y build-essential net-tools curl git software-properties-common mariadb-server
systemctl start mariadb ; systemctl status mariadb
mysql_secure_installation
mysql -u root -p
CREATE DATABASE gitea;
GRANT ALL PRIVILEGES ON gitea.* TO 'gitea'@'localhost' IDENTIFIED BY "StrongPassword";
FLUSH PRIVILEGES;
QUIT;
git config --global user.name "Your Name" ; git config --global user.email "youremail@yourdomain.com"

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

cd /tmp ; GITEAVERSION=1.15.7 ; wget -O gitea https://dl.gitea.io/gitea/${GITEAVERSION}/gitea-${GITEAVERSION}-linux-amd64
mv /tmp/gitea /usr/local/bin ; chmod +x /usr/local/bin/gitea ; mkdir -p /etc/gitea ; mkdir -p /var/lib/gitea/{custom,data,indexers,public,log} ; chown -R git:git /var/lib/gitea/ ; chown root:git /etc/gitea ; chmod -R 750 /var/lib/gitea/ ;chmod 770 /etc/gitea

nano /etc/systemd/system/gitea.service
[Unit]
Description=Gitea
After=syslog.target
After=network.target
After=postgresql.service

[Service]
RestartSec=2s
Type=simple
User=git
Group=git
WorkingDirectory=/var/lib/gitea/
ExecStart=/usr/local/bin/gitea web -c /etc/gitea/app.ini
Restart=always
Environment=USER=git HOME=/home/git GITEA_WORK_DIR=/var/lib/gitea

[Install]
WantedBy=multi-user.target
systemctl daemon-reload ; systemctl start gitea ; systemctl enable gitea ; systemctl status gitea
http://localhost:3000/
_________________________________________________________________________________________________________________________

No comments:

Post a Comment