29Ekim Açık Kaynak açılış Akademik Bilişim 2012 Akademik Bilişim 2012 Uşak akgül all Alt+Ctrl+Delete altlinux Anatolya installer apache apache2 arm AtlantiS autoindex backup bağlantı banana bash bash script belediye betik bind9 boot bootloader bootparametre böl burg cache canlicdrom cdrom centos CHKUSER chrome clone clonezilla CloneZilla ile Remote Disk Clone işlemi cron crontab çöp dd denizaltı denizaltı kablo Desteği destek Dil Disk disk eklemek disket dizin şifreleme django djb dkim dns DNS sistemi docker Domain download drbl dvd e-posta eğitim eklenti EniXma eposta eQmail esxi ev ev almak fail2ban fake fakemail feed feedbro ffmpeg find Firefox format fortran free FreeBSD freenas ftp full backup Gazze Genel Gentoo Getgnu.org gezegen git github gitweb Gmail gnupg Gökşin Akdeniz görev Görsel gpg grub grub2 günlük Güvenlik Hacker harddisk hizmet hosting id_rsa imap index indimail indir internet ipv4 ipv6 iso israil İşletim Sistemi kablo KAMP kernel kernellogo kesin çözüm key klonlamak komut konsol koruma lampp. httpd lilo link linux liste listeci listmanager live livecd LKD loader login logo LVM mail mail hosting Mail-in-a-Box mailcow mailman mailserver mandriva-tr.org matrax Mint mirror mlmmj modül MTA multisite mustafa akgül Mustafa Akgül Özgür Yazılım Yaz Kampı. Abant İzzet Baysal Üniversitesi Müteahhit mx MySQL netinternet Netqmail network nfs nginx ngrok not.py online radyo opendkim openssl önyükleme özgür yazılım panel pano pardus parola paste patch paylaşım pdf perl pfsense pfsense full backup phpmyadmin pi plan Planet planetplanet plesk pop3 poste.io postfix postfixadmin proje proxy putty python qmail qmailtoaster randmap Ras webserver Raspberry pi Raspberry Pi raspi rawdisk recovery remote repository resim resimler rss rsync rsyncd rsyncd etiketi s/qmail Saldırı Samba screen script sendonly smtp server senronizasyon server servis shell sistem Slackarm slackware Slackware slackware-live slackware.org.tr slackware arşiv httrack truva linux hatıralar slacky.eu SMF SMF türkçe karakter problemi smtp sosyal ağ spam spf sql backup sqlite sqlite3 sqlite3 to wordpress ssh ssh_key ssh-key SSL ssl sertifika subversion sudo sunucu svn swap swapfile syslinux system system images şifreleme takasfile Tatil Tavuk Teneke Kebabı Tenekede Tavuk theme thunderbird TightVNC tmux Tokat Kebabı tokat kebabı sobası etiketi Trash Trash-cli Truva Linux truvalinux Turkcell tuxweet Türkçe türkiye ubuntu unban UNIX uzak varnish veri Virtualbox vmware Vodafone vps Vsftp vsftpd Wampp web Web server web Sunucu webp webserver webserver Akıllı Tahta wget WINN Windows wordpress Wordpress wordpress multisite www xampp Xnest yansı yansılama yansılamak yapıştır yazmak Yedekleme Yemek zulüm

Centos 7 + Nginx + Gitweb Kurulumu

Centos Nginx ve Git Kurulumu

Dijitalocean üzerinde popüler linux dağıtımlarının sistem image leri var.
Bu imagesler ile Birkaç dakilka içerisinde VPS (Virtual Private Server) oluşturup kullanıma hazır hale gerilmekte.
Bloğumda Git kurulumu konusunda yardım isteyen zafer bey için hemde Benim için tecrübe olacağını düşündüğümden Centos droplet oluşturdum.
Elbette oluşturduğum Droplet fazla uzun ömürlü olmayacak. sanırım bu gece silerim kendisini :)

Zafer bey ile e-posta yazışmalarında Centos üzerinde Nginx kullandığını ve Git için gitweb kurulumuna ihtiyacı olduğunu belirtti.
Bende Daha önceki yazımda işe Rasppberry Pi üzerinde Pratik Gitweb kurulumunu anlatmıştım. Sistemler farklı oluğundan zafer bey gitweb Kurulumunu yapamamış.
Bende hafta sonunu değerlendirmek için bu çalışmayı yaptım.

Girizgahı fazla uzatmadan Yaptığım işlemleri anlatayım.

Centos bilindiği gibi Yum paket yönecisini kullanmaktadır.

Yazıda hazır Droplet kullandığım için üzerinde kurulu hemen hemen hiçbir şey yok.
Bu nedenle tüm gerekli paketleri bizim kurmamız gerekli.

Öncelikle sistemi güncelleyelim.

Daha Sonra Nginx ve Bizim için gerekli olan paketleri kurmamızı sağlayacak EPEL deposunu ekleyelim.
[root@centos-7-x64 ~]# yum -y update

[root@centos-7-x64 ~]# yum -y install epel-release
Loaded plugins: fastestmirror
.....
Installed:
epel-release.noarch 0:7-5

Complete!
[root@centos-7-x64 ~]#

Bu adımdan sonra paketlerimizi kuralım.
[root@centos-7-x64 ~]# yum -y install nginx

Gitweb Perl ile yazıldığından Nginx tarafında gerekli spawn-fcgi paketinı kuralım.
[root@centos-7-x64 ~]# yum -y install spawn-fcgi

Gitweb için gerekli olan fcgiwrap paketini derleyip sisteme kurmamız gerekli.
Link. https://www.howtoforge.com/perfect-server-centos-6.1-x86_64-with-nginx-ispconfig-3-p5

bunun için daha önce sistemimizde kurulu bulunmayan Development Tools grup paketlerin kurmalıyız.

Önce paket grup listelerini alalım.
[root@centos-7-x64 ~]# yum grouplist
Loaded plugins: fastestmirror
Available Groups:
......
CIFS file server
Compatibility Libraries
Console Internet Tools
Desktop
Desktop Platform
Desktop Platform Development
Development Tools
Eclipse
.....
[root@centos-7-x64 ~]#

Biz Development Tools paketini kurarken Git Paketide kuruluyor. Yani ayrıca Git kurmamız gerekmiyor :D
[root@centos-7-x64 ~]# yum -y groupinstall "Development Tools"
Loaded plugins: fastestmirror
........
.......

Complete!
[root@centos-7-x64 ~]#

Şimdi spawn-fcgi socket oluşturması için wrapper yazmamız gerekli.
nano /etc/sysconfig/spawn-fcgi

Açılan dosyanın içeriğini düzenleyin.
# You must set some working options before the "spawn-fcgi" service will work.
# If SOCKET points to a file, then this file is cleaned up by the init script.
#
# See spawn-fcgi(1) for all possible options.
#
# Example :
#SOCKET=/var/run/php-fcgi.sock
#OPTIONS="-u nginx -g nginx -s $SOCKET -S -M 0600 -C 32 -F 1 -P /var/run/spawn-fcgi.pid -- /usr/bin/php-cgi"
FCGI_SOCKET=/var/run/fcgiwrap.socket
FCGI_PROGRAM=/usr/local/sbin/fcgiwrap
FCGI_USER=nginx
FCGI_GROUP=nginx
FCGI_EXTRA_OPTIONS="-M 0770"
OPTIONS="-u $FCGI_USER -g $FCGI_GROUP -s $FCGI_SOCKET -S $FCGI_EXTRA_OPTIONS -F 1 -P /var/run/spawn-fcgi.pid -- $FCGI_PROGRAM"
# bitiş


Başlangıç servislerine ekleyelim
[root@truvacloud ~]# chkconfig --levels 235 nginx on
Note: Forwarding request to 'systemctl enable nginx.service'.
ln -s '/usr/lib/systemd/system/nginx.service' '/etc/systemd/system/multi-user.target.wants/nginx.service'
[root@truvacloud ~]# chkconfig --levels 235 spawn-fcgi on

gerekli servisler start oluyormu kontrol amaçlı olarak
sistemi yeniden başlatalım.
[root@truvacloud ~]# reboot

Gitweb paketini kuralım Devel Paketleri ile kurulmamış.
Not: Debian da default olarak git ile beraber kurulmaktadır.
[root@truvacloud ~]# yum -y install gitweb
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.imt-systems.com
* epel: mirror.23media.de
.....
--> Finished Dependency Resolution

Dependencies Resolved
.......
Install 1 Package (+2 Dependent packages)
...........
Installed:
gitweb.noarch 0:1.8.3.1-4.el7 ...........

Complete!
[root@truvacloud ~]#

Şimdi sırada fcgiwrap kurulumu var:
Link : http://klofver.tumblr.com/post/43260701373/install-gitweb-on-nginx
$ cd /usr/local/src/
$ git clone git://github.com/gnosek/fcgiwrap.git
$ cd fcgiwrap
$ yum install fcgi-devel make automake autoconf
$ autoreconf -i
$ ./configure
$ make
$ make install

Önce Paket kaynağını indirelim.
[root@truvacloud ~]# cd
[root@truvacloud ~]# git clone git://github.com/gnosek/fcgiwrap.git
Cloning into 'fcgiwrap'...
remote: Counting objects: 270, done.
remote: Total 270 (delta 0), reused 0 (delta 0), pack-reused 270
Receiving objects: 100% (270/270), 62.89 KiB | 0 bytes/s, done.
Resolving deltas: 100% (139/139), done.
[root@truvacloud ~]#

Kuralım
[root@truvacloud fcgiwrap]# autoreconf -i
[root@truvacloud fcgiwrap]# ./configure
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for FCGX_Init in -lfcgi... no
configure: error: FastCGI library is missing
[root@truvacloud fcgiwrap]#

Ops hata verdi :)
fcgi-devel paketini kurmamışım :D
[root@truvacloud fcgiwrap]# yum install fcgi-devel make automake autoconf -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.imt-systems.com
* epel: mirror.23media.de
.....
Complete!
[root@truvacloud fcgiwrap]#

Şimdi yeniden Başlayalım.
[root@truvacloud fcgiwrap]# autoreconf -i
[root@truvacloud fcgiwrap]# ./configure
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for FCGX_Init in -lfcgi... yes
checking for systemd... no
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for unistd.h... (cached) yes
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
checking for pid_t... yes
checking for size_t... yes
checking for ssize_t... yes
checking vfork.h usability... no
checking vfork.h presence... no
checking for vfork.h... no
checking for fork... yes
checking for vfork... yes
checking for working fork... yes
checking for working vfork... (cached) yes
checking whether lstat correctly handles trailing slash... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for strchr... yes
checking for strdup... yes
checking for strrchr... yes
checking for dup2... yes
checking for putenv... yes
checking for select... yes
checking for setenv... yes
checking for strerror... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h
[root@truvacloud fcgiwrap]#

Şimdi Derleyip Kuralım.
[root@truvacloud fcgiwrap]# make
cc -std=gnu99 -Wall -Wextra -Werror -pedantic -O2 -g3 fcgiwrap.c -lfcgi -o fcgiwrap
[root@truvacloud fcgiwrap]#
[root@truvacloud fcgiwrap]# make install
install -d -m 755 /usr/local/sbin
install -m 755 fcgiwrap /usr/local/sbin
install -d -m 755 /usr/local/man/man8
install -m 644 fcgiwrap.8 /usr/local/man/man8
[root@truvacloud fcgiwrap]#

Gitweb Yapılandırma Dosyasını Düzenleyelim.
[root@truvacloud fcgiwrap]# nano /etc/gitweb.conf

Projlerinizin bulunduğu yeri belirten bu satırı düzenleyin.
our $projectroot = “/home/git/”

Gitweb için Nginx Yapılandırma dosyası subdomain olarak çalışacak şekilde. Örnekte adres olarak: git.example.com
[root@truvacloud fcgiwrap]# nano /etc/nginx/conf.d/00-gitweb.conf

 
server {
server_name git.example.com;
listen 80;
access_log /var/log/nginx/gitweb.access.log;
error_log /var/log/nginx/gitweb.error.log;
charset utf-8;
location /gitweb.cgi {
fastcgi_pass unix:/run/fcgiwrap.socket;
fastcgi_param PATH_INFO $uri;
fastcgi_param GITWEB_CONFIG /etc/gitweb.conf;
fastcgi_param SCRIPT_FILENAME /var/www/git/gitweb.cgi;
include fastcgi_params;
}
location / {
root /var/www/git/;
index gitweb.cgi;
}
}

 

Son olarak sizinde sistemi denemeniz için centos dropleti açık bırakacağım.

sunucu ip adresi 46.101.204.41

eğer gitweb arayüzünü görebilmek istiyorsanız

kendi sisteminizde /etc/hosts dosyasına bu satırı ekleyip kaydedin.
46.101.204.41 git.example.com

 

Tarayınıcınız adres satırına git.example.com yazın.

iyi eğlenceler.

Not: 28 Kasım 2015 Saat: 22:00 itibarı ile Droplet silinmiştir.

Nginx-HTTP-Server-on-Fedora

Nginx-HTTP-Server-on-Fedora-Gitweb-git.example.com

Nginx-HTTP-Server-on-Fedora-Gitweb-git.example.com-zangetsu

Nginx-HTTP-Server-on-Fedora-Gitweb-git.example.com-zangetsu-commitdiff

Yorum Gönder

  1. Eline sağlık, detaylı ve güzel bir anlatım olmuş ancak bir o kadarda korkutucu :) Linux'un bu özelliğini sevmiyorum, altı üstü kuracağımız küçük bir uygulama ancak burun için kod derleme ve hata ayıklama sürecine kadar gidiyoruz. PPA depoları sayesinde bu sıkıntı azalmış olsada halen insanın karşısına çıkıyor.

    Bu konuda çok deneyimim olmadğı için henüz bir deneme yapmadım. Bir sanal makine kurup onun üzerinde deneme yapmayı planlıyorum. Tekrardan çok teşekkür ederim.

    YanıtlaSil

[blogger][facebook][disqus][spotim]

Author Name

İletişim Formu

Ad

E-posta *

Mesaj *

Blogger tarafından desteklenmektedir.