NOTEPAD

내 생각에는…

Menu
  • Test Page 1

월: 2015 9월

Ubuntu nginx uwsgi cgit

댓글 없음
| 미분류

Shell
1
2
3
4
5
6
# git 설치
sudo apt-get -y install git
# 빌드용 패키지 설치
sudo apt-get -y install build-essential autoconf automake libtool
# 빌드용 라이브러리 설치
sudo apt-get -y install libssl-dev

Shell
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
git clone git://git.zx2c4.com/cgit
cd cgit
git submodule init
git submodule update
make -j4
make install
# 설치되는 목록
install -m 0755 -d /var/www/htdocs/cgit
install -m 0755 cgit /var/www/htdocs/cgit/cgit.cgi
install -m 0755 -d /var/www/htdocs/cgit
install -m 0644 cgit.css /var/www/htdocs/cgit/cgit.css
install -m 0644 cgit.png /var/www/htdocs/cgit/cgit.png
install -m 0644 favicon.ico /var/www/htdocs/cgit/favicon.ico
install -m 0644 robots.txt /var/www/htdocs/cgit/robots.txt
install -m 0755 -d /usr/local/lib/cgit/filters
cp -r  filters/* /usr/local/lib/cgit/filters

Shell
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
sudo apt-get -y install nginx # -full ?
sudo apt-get -y install uwsgi uwsgi-plugin-python
 
cat <<EOF> /etc/uwsgi/apps-available/cgit.ini
[uwsgi]
master = true
plugins = cgi
#socket = /run/uwsgi/app/cgit/socket
uid = www-data
gid = www-data
procname-master = uwsgi cgit
processes = 1
threads = 2
cgi = /var/www/htdocs/cgit/cgit.cgi
EOF
 
ln -s /etc/uwsgi/apps-available/cgit.ini /etc/uwsgi/apps-enabled/
 
apt-get -y install highlight
 
vi /usr/local/lib/cgit/filters/syntax-highlighting.sh
#version 2 <-- comment
#version 3 <-- uncomment
 
cat <<EOF> /etc/cgitrc
css=/cgit.css
logo=/cgit.png
robots=noindex, nofollow
virtual-root=/
scan-path=/home/git
enable-git-config=1
source-filter=/usr/local/lib/cgit/filters/syntax-highlighting.sh
EOF
 
groupadd -g 999 git
useradd -m -s /usr/bin/git-shell -u 999 -g 999 git
usermod -a -G git www-data
 
cat <<EOF> /etc/nginx/sites-available# cat cgit
server {
   listen 80;
   server_name git.autologon.xyz;
   root /var/www/htdocs/cgit;
 
# Serve static files with nginx
location ~* ^.+(cgit.(css|png)|favicon.ico|robots.txt) {
     root //var/www/htdocs/cgit;
     expires 30d;
   }
   location / {
     try_files $uri @cgit;
   }
   location @cgit {
     gzip off;
     include uwsgi_params;
     uwsgi_modifier1 9;
     uwsgi_pass unix:/run/uwsgi/app/cgit/socket;
   }
}
EOF
 
ln -s /etc/nginx/sites-available/cgit /etc/nginx/sites-enabled/
 
chown -R git:git /home/git
chmod -R o-rwx /home/git
chmod -R g+rw /home/git
 
chown -R www-data:www-data /var/www
chmod -R o-rwx /var/www
chmod -R g+rw /var/www
 
service uwsgi start
service nginx start

Read More »

최근 글

  • Integrate Redmine + GIT with Docker #1
  • NGINX + Redmine: ERROR bad Request-Line or URI
  • Install Redmine
  • Install LDAP
  • Import LDAP Data

최근 댓글

  • 고동열 (libnfc 포팅)
  • 고동열 (libnfc 포팅)
  • bugiii (VPS Comparision)
  • 김병국 (VPS Comparision)
  • bugiii (VPS Comparision)

글 목록

  • 2018년 3월
  • 2017년 7월
  • 2017년 6월
  • 2016년 8월
  • 2016년 7월
  • 2016년 2월
  • 2016년 1월
  • 2015년 12월
  • 2015년 11월
  • 2015년 9월
  • 2015년 6월
  • 2015년 5월
  • 2015년 1월
  • 2014년 12월
  • 2014년 11월
  • 2014년 10월

카테고리

  • 미분류

그 밖의 기능

  • 로그인
  • 글 RSS
  • 댓글 RSS
  • WordPress.org

태그

android Arduino git kernel LDAP srp srp6a ubuntu

NOTEPAD 2019 . Powered by WordPress