Page 1 of 1

Cgit setup

Posted: Wed Apr 08, 2020 5:28 pm
by spadino
Hi guys! Recently switched to VestaCP from virtualmin; loving so far...

I need to setup a cgit server under a Vesta managed domain, git.mydonain.net, but I didn't have yet grasp how to do it.
Cgit configure itself as an Apache extension, under /etc/apache2/conf. I think that I should copy it's setup in my /home/$user/$mydomain/conf/web apache2 conf, but even if apache2 and nginx restart successfully, accessing http(s)://$mydonain/cgit give a 500 error...

Any clue?

Re: Cgit setup

Posted: Thu Apr 09, 2020 2:27 am
by spadino
So, managed with a new template. Here it is:

Code: Select all

<VirtualHost %ip%:%web_port%>

    ServerName %domain_idn%
    %alias_string%
    ServerAdmin %email%
    DocumentRoot %docroot%
    ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/
    ScriptAlias /cgit/ "/usr/lib/cgit/cgit.cgi/"
    RedirectMatch ^/cgit$ /cgit/
    Alias /cgit-css "/usr/share/cgit/"
    <Directory "/usr/lib/cgit/">
        AllowOverride None
        Options ExecCGI FollowSymlinks
        Require all granted
    </Directory>
    Alias /vstats/ %home%/%user%/web/%domain%/stats/
    Alias /error/ %home%/%user%/web/%domain%/document_errors/
    #SuexecUserGroup %user% %group%
    CustomLog /var/log/%web_system%/domains/%domain%.bytes bytes
    CustomLog /var/log/%web_system%/domains/%domain%.log combined
    ErrorLog /var/log/%web_system%/domains/%domain%.error.log
    <Directory %docroot%>
        AllowOverride All
        Options +Includes -Indexes +ExecCGI
        php_admin_value open_basedir %docroot%:%home%/%user%/tmp
        php_admin_value upload_tmp_dir %home%/%user%/tmp
        php_admin_value session.save_path %home%/%user%/tmp
        php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -f info@%domain_idn%"
    </Directory>
    <Directory %home%/%user%/web/%domain%/stats>
        AllowOverride All
    </Directory>

    <IfModule mod_ruid2.c>
        RMode config
        RUidGid %user% %group%
        RGroups www-data
    </IfModule>
    <IfModule itk.c>
        AssignUserID %user% %group%
    </IfModule>

    IncludeOptional %home%/%user%/conf/web/%web_system%.%domain%.conf*

</VirtualHost>
This reflect the default cgit setup in Debian 9.

Re: Cgit setup

Posted: Thu Apr 09, 2020 8:44 am
by grayfolk
If you use nginx no sense to use apache for cgit.
Try nginx config from here: https://gist.github.com/stran12/1394757