Note, that this recipe is not updated long time and could be outdated!
Got it.

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

Must prepare before:  Apache tīmekļa serveris

  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

    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 06:15
Last modified by Valdis Vītoliņš on 2021-04-13 14:29
 
Xwiki Powered
Creative Commons Attribution 3.0 Unported License