Install Gogs di Debian 8 dengan Let’s Encrypt

Jika Gitlab terlalu “berat”, maka tersedia alternatif lain yaitu Gogs. Bagaimana cara install Gogs di Debian 8? Berikut caranya :

1. Matikan Apache

sudo service apache2 stop

2. Download skrip installasi

wget https://pastebin.com/raw/g253b8dN -O installgogs.sh
chmod +x installgogs.sh

3. Pasang Let’s Encrypt

sudo add-apt-repository ppa:certbot/certbot
sudo nano /etc/apt/sources.list
tambahkan line
deb http://ftp.debian.org/debian jessie-backports main
sudo apt-get update
sudo apt-get install letsencrypt -t jessie-backports

4. Implementasikan Let’s Encrypt

sudo systemctl stop nginx
sudo letsencrypt certonly --email <your-email-address> -d <your-domain-name>
select opsi kedua
sudo systemctl start nginx

5. Ubah konfigurasi Gogs

nano /etc/nginx/sites-available/gogs.conf

server {
    listen          ip-address:80;
    server_name     domain-name;

    listen 443 ssl;
    server_name domain-name;ssl_certificate /etc/letsencrypt/live/domain-name/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/domain-name/privkey.pem;

    proxy_set_header X-Real-IP  $remote_addr; # pass on real client IP

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

 

Leave a Reply

Your email address will not be published. Required fields are marked *