Ubuntu nginx uwsgi cgit
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 |
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 |
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 |