Gitea is a community managed lightweight code hosting solution written in Go. || PostgreSQL is an advanced, enterprise-class, and open-source relational database system.
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 nginx
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
apt-get update ; sudo apt-get -y install postgresql -y
systemctl start postgresql ; systemctl enable postgresql ; systemctl status postgresql
nano /etc/postgresql/14/main/postgresql.conf
listen_addresses = 'localhost, 0.0.0.0'
password_encryption = scram-sha-256
systemctl restart postgresql
sudo -u postgres psql
CREATE ROLE gitea WITH LOGIN PASSWORD 'secure@123';
CREATE DATABASE giteadb;
GRANT ALL PRIVILEGES ON DATABASE giteadb TO gitea;
exit
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
nano /etc/nginx/sites-enabled/default
server {
listen 80;
index index.php index.html index.htm;
server_name debian.example.com;
location / {
proxy_pass http://localhost:3000;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
nginx -t
systemctl restart nginx ; systemctl status nginx
http://debian.example.com
_________________________________________________________________________________________________________________________
Tuesday, January 4, 2022
How to Install Gitea with PostgreSQL Nginx web server on Debian 11
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment