반응형

 

관련글. 

[임베디드/Raspberry Pi] - Raspberry pi를 git 서버로 사용하기


웹인터페이스까지 설치를 해주었더니 쓸만한 듯합니다.


필요한 패키지 설치

sudo sh -c 'echo "deb http://http.debian.net/debian wheezy-backports main" > /etc/apt/sources.list.d/wheezy-backports.list'

gpg --keyserver keyserver.ubuntu.com --recv 8B48AD6246925553

gpg --export --armor 8B48AD6246925553 | sudo apt-key add -

sudo apt-get update

sudo apt-get install wheezy-backports nginx nginx-common git gitweb fcgiwrap

 

Nginx 서버 설정

/etc/nginx/sites-available/gitweb 파일을 생성하여 아래 내용을 집어넣는다. 라즈베리파이의 아이피인 192.168.0.20과 포트 80을 사용하였다.

sudo nano /etc/nginx/sites-available/gitweb

server {

# Git repos are browsable at http://example.com:4321/

listen 80;

server_name 192.168.0.20;

 

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;

}

}

 

 

설정 적용하기

sudo ln -s /etc/nginx/sites-available/gitweb /etc/nginx/sites-enabled/gitweb

service nginx restart

 

테스트 해보기

라즈베리 파이에서 저장소를 하나 생성한 후..

pi@raspberrypi ~ $ git init --bare hello.git

Initialized empty Git repository in /home/pi/hello.git/

 

웹페이지에서 보이도록 추가작업이 필요합니다.

pi@raspberrypi ~ $ sudo ln -s /home/pi/hello.git /var/cache/git/hello.git

 

아래처럼 앞에 있는 주석 처리된 #을 지웁니다.

pi@raspberrypi ~ $ sudo nano /etc/gitweb.conf

# file with project list; by default, simply scan the projectroot dir.

$projects_list = $projectroot;

 

# stylesheet to use

@stylesheets = ("static/gitweb.css");

 

 

이제 피시에서 git 서버에 파일들을 올려봅니다.

$ git config --global user.name "webnautes"

$ git config --global user.email webnautes@nate.com

$ git init

$ git remote add origin pi@192.168.0.20:/home/pi/hello.git

$ git add .

$ git commit -m "init"

$ git push origin master

 

 

웹페이지에서 192.168.0.20에 접속해보면

 

 

 

참고

https://gist.github.com/bdsatish/8a784f290cc1fa9f6fef

http://www.raspipress.com/2014/06/tutorial-install-nginx-and-php-on-raspbian/

http://thesimplesynthesis.com/post/gpg-error-the-following-signatures-couldnt-be-verified-because-the-public-key-is-not-available

반응형

문제 발생시 지나치지 마시고 댓글 남겨주시면 가능한 빨리 답장드립니다.

도움이 되셨다면 토스아이디로 후원해주세요.
https://toss.me/momo2024


제가 쓴 책도 한번 검토해보세요 ^^

+ Recent posts