Warning

If it is not explicitly told in following recipe, setting up services are described for Ubuntu 20.04 server, but applications are described for Xubuntu 20.04 workstation. If you use different Ubuntu version or Linux distribution, settings as well as content, names and places of configuration files may be different!
Got it.

Git servera uzstādīšana caur Apache tīmekļa serveri

  1. Iespējo Apache WebDAV moduli:

    sudo a2enmod dav_fs
  2. root lietotājs izveido failu /etc/apache2/conf.d/git ar saturu:

    <Location /git/public/>
      DAV on
    </Location>
    <Location /git/readable>
      DAV on
      AuthType Basic
      AuthName "Need username and password to push changes"
      AuthUserFile /etc/apache2/git-passwd
      AuthGroupFile /etc/apache2/git-group
      <LimitExcept GET PROPFIND OPTIONS REPORT>
        Require group writers
      </LimitExcept>
    </Location>
    <Location /git/private>
      DAV on
      AuthType Basic
      AuthName "Need username and password"
      AuthUserFile /etc/apache2/git-passwd
      AuthGroupFile /etc/apache2/git-group
      Require group readers
    </Location>

    kur public ir publiski pieejama mape (git projekts), readable ir anonīmi lasāma, bet rakstāma ar vārdu un paroli, private ir tikai ar vārdu un paroli lasāma mape.

  3. Pievieno lietotājus:

    htpasswd -c /etc/apache2/git-passwd student
  4. Izveido /etc/apache2/git-group failu ar saturu:

    readers: teacher
    writers: student
  5. Izveido mapi:

    sudo mkdir /var/www/git
  6. Izmaina pieejas tiesības:

    chown -R www-data:www-data /var/www/git
    Information

    Mapju īpašnieku un pieejas tiesību iestatījumus nosaka konkrētās projekta vajadzības, bet ja izmanto git pieeju caur Apache, tad mapei noteikti nepieciešams norādīt www-data grupu

  7. Pārstartē Apache:

    sudo /etc/init.d/apache2 restart

Zināmās problēmas

  • Izmantojot HTTP/HTTPS nevar aizgrūst izmaiņas ar Eclipse. Tā vietā var izmantot grūšanu caur SSH.

Alternatīvas


 
 
Tags Programmēšana
Created by Valdis Vītoliņš on 2014-08-12 03:15
Last modified by Valdis Vītoliņš on 2025-05-10 17:45
XWiki Powered
Creative Commons Attribution 3.0 Unported License