Hello,
I have been trying to host a web site on a spare computer using Guix System, which has been pretty straightforward and easy! I thought I'd challenge myself and try to set up git hosting on the same machine, and that is going a little less smoothly... I was hoping someone could point me in the right direction.

Most of my configuration so far has been based on whatever I could glean from the Guix manual and the explanations in this helpful blog post by Karl Hallsby: https://raven.hallsby.com/running-your-website-using-guix-system.html

but... the cgit service isn't cooperating at all, and my knowledge is not good enough to troubleshoot what's going wrong. I can run the nginx service for my main web site, or the cgit service, but not both at the same time. I've attached what my services look like in the main configuration file (I replace "website" with my domain when I want to test it). Does anyone know what could be the problem?

Thank you.
;; Certbot (SSL certification)                                                  
                  
(service certbot-service-type
         (certbot-configuration
          (email "[email protected]")
          (certificates
           (list
            (certificate-configuration
             (name "website")
             (domains '("website.org" "www.website.org")))
            (certificate-configuration
             (name "cgit")
             (domains '("git.website.org")))))))
(service dhcpcd-service-type)
;; OpenSSH                                                                      
                  
(service openssh-service-type
         (openssh-configuration
          (openssh openssh-sans-x)
          (port-number 2222)))
;; NGINX (web hosting)                                                          
                  
(service nginx-service-type
         (nginx-configuration
          (server-blocks
           (list
            (nginx-server-configuration
             (listen '("443 ssl"))
             (server-name '("website.org"))
             (ssl-certificate
              "/etc/certs/website/fullchain.pem")
             (ssl-certificate-key
              "/etc/certs/website/privkey.pem")
             (root "/srv/http/website.org"))))))
;; CGit (git hosting)                                                           
                  
(service cgit-service-type
         (cgit-configuration
          (repository-directory "/srv/git/")
          (nginx
           (list
            (nginx-server-configuration
             (listen '("443 ssl"))
             (server-name '("git.website.org"))
             (ssl-certificate
              "/etc/certs/website/fullchain.pem")
             (ssl-certificate-key
              "/etc/certs/website/privkey.pem")
             (locations
              (list
               (nginx-location-configuration
                (uri "~ ^/share/cgit/")
                (body `(("root " ,cgit ";"))))
               (nginx-named-location-configuration
                (name "cgit")
                (body `(("fastcgi_param SCRIPT_FILENAME " ,cgit 
"/lib/cgit/cgit.cgi;")
                        "fastcgi_param PATH_INFO $uri;"
                        "fastcgi_param QUERY_STRING $args;"
                        "fastcgi_param HTTP_HOST $server_name;"
                        "fastcgi_pass 127.0.0.1:9000;"))))))))))

Reply via email to