aboutsummaryrefslogtreecommitdiff
path: root/content/blog/2023-09-15-self-hosting-gitweb.org
diff options
context:
space:
mode:
authorChristian Cleberg <hello@cleberg.net>2024-03-29 01:30:23 -0500
committerChristian Cleberg <hello@cleberg.net>2024-03-29 01:30:23 -0500
commit41bd0ad58e44244fe67cb36e066d4bb68738516f (patch)
tree205e844650144648e58700df2b632c89298904d4 /content/blog/2023-09-15-self-hosting-gitweb.org
parent797a1404213173791a5f4126a77ad383ceb00064 (diff)
downloadcleberg.net-41bd0ad58e44244fe67cb36e066d4bb68738516f.tar.gz
cleberg.net-41bd0ad58e44244fe67cb36e066d4bb68738516f.tar.bz2
cleberg.net-41bd0ad58e44244fe67cb36e066d4bb68738516f.zip
massive re-write from org-publish to weblorg
Diffstat (limited to 'content/blog/2023-09-15-self-hosting-gitweb.org')
-rw-r--r--content/blog/2023-09-15-self-hosting-gitweb.org72
1 files changed, 72 insertions, 0 deletions
diff --git a/content/blog/2023-09-15-self-hosting-gitweb.org b/content/blog/2023-09-15-self-hosting-gitweb.org
new file mode 100644
index 0000000..fb40743
--- /dev/null
+++ b/content/blog/2023-09-15-self-hosting-gitweb.org
@@ -0,0 +1,72 @@
+#+title: Self-Hosting GitWeb via Nginx
+#+date: 2023-09-15
+#+description: A guide to self-hosting GitWeb using the Nginx web server.
+#+filetags: :selfhosting:
+
+* Overview
+[[https://git-scm.com/book/en/v2/Git-on-the-Server-GitWeb][GitWeb]] is a
+simple web-based visualizer for git repositories. By default, GitWeb
+will only run with the =lighttpd= or =webrick= web servers.
+
+However, this guide will show you how to keep GitWeb running in the
+background and display information for all repositories in a chosen
+directory.
+
+See below for the final result:
+
+#+caption: Gitweb
+[[https://img.cleberg.net/blog/20230915-gitweb/gitweb.png]]
+
+* Install Dependencies
+To start, you'll need install the following packages:
+
+#+begin_src sh
+sudo apt install git gitweb fcgiwrap nginx
+#+end_src
+
+* Configure Nginx
+Once installed, create an Nginx configuration file.
+
+#+begin_src sh
+sudo nano /etc/nginx/sites-available/git.example.com
+#+end_src
+
+#+begin_src conf
+server {
+ listen 80;
+ server_name example.com;
+
+ location /index.cgi {
+ root /usr/share/gitweb/;
+ include fastcgi_params;
+ gzip off;
+ fastcgi_param SCRIPT_NAME $uri;
+ fastcgi_param GITWEB_CONFIG /etc/gitweb.conf;
+ fastcgi_pass unix:/var/run/fcgiwrap.socket;
+ }
+
+ location / {
+ root /usr/share/gitweb/;
+ index index.cgi;
+ }
+}
+#+end_src
+
+To make the configuration active, you need to symlink it and then
+restart Nginx.
+
+#+begin_src sh
+sudo ln -s /etc/nginx/sites-available/git.example.com /etc/nginx/sites-enabled/git.example.com
+sudo systemctl restart nginx.service
+#+end_src
+
+The GitWeb application should now be available via the URL you set in
+the Nginx configuration above.
+
+* Customize GitWeb
+If you need to, you can customize many things about Gitweb by editing
+the [[https://git-scm.com/docs/gitweb.conf][gitweb.conf]] file.
+
+#+begin_src sh
+sudo nano /etc/gitweb.conf
+#+end_src