diff options
author | Christian Cleberg <hello@cleberg.net> | 2024-04-27 17:01:13 -0500 |
---|---|---|
committer | Christian Cleberg <hello@cleberg.net> | 2024-04-27 17:01:13 -0500 |
commit | 74992aaa27eb384128924c4a3b93052961a3eaab (patch) | |
tree | d5193997d72a52f7a6d6338ea5da8a6c80b4eddc /content/blog/2023-09-15-self-hosting-gitweb.md | |
parent | 3def68d80edf87e28473609c31970507d9f03467 (diff) | |
download | cleberg.net-74992aaa27eb384128924c4a3b93052961a3eaab.tar.gz cleberg.net-74992aaa27eb384128924c4a3b93052961a3eaab.tar.bz2 cleberg.net-74992aaa27eb384128924c4a3b93052961a3eaab.zip |
test conversion back to markdown
Diffstat (limited to 'content/blog/2023-09-15-self-hosting-gitweb.md')
-rw-r--r-- | content/blog/2023-09-15-self-hosting-gitweb.md | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/content/blog/2023-09-15-self-hosting-gitweb.md b/content/blog/2023-09-15-self-hosting-gitweb.md new file mode 100644 index 0000000..5dca508 --- /dev/null +++ b/content/blog/2023-09-15-self-hosting-gitweb.md @@ -0,0 +1,78 @@ ++++ +date = 2023-09-15 +title = "Self-Hosting Gitweb via Nginx" +description = "" +draft = false ++++ + +# Overview + +[GitWeb](https://git-scm.com/book/en/v2/Git-on-the-Server-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: + + + +# Install Dependencies + +To start, you\'ll need install the following packages: + +```sh +sudo apt install git gitweb fcgiwrap nginx +``` + +# Configure Nginx + +Once installed, create an Nginx configuration file. + +```sh +sudo nano /etc/nginx/sites-available/git.example.com +``` + +``` 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; + } +} +``` + +To make the configuration active, you need to symlink it and then +restart Nginx. + +```sh +sudo ln -s /etc/nginx/sites-available/git.example.com /etc/nginx/sites-enabled/git.example.com +sudo systemctl restart nginx.service +``` + +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 [gitweb.conf](https://git-scm.com/docs/gitweb.conf) file. + +```sh +sudo nano /etc/gitweb.conf +``` |