Created
January 2, 2012 08:12
-
-
Save beheadedmyway/1549832 to your computer and use it in GitHub Desktop.
Gitweb on Centos behind Nginx with init script.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# gitweb | |
# | |
# chkconfig: 235 20 80 | |
# description: start and stop gitweb | |
# processname: gitweb | |
# pidfle: /var/run/gitweb.pid | |
# Source function library. | |
. /etc/rc.d/init.d/functions | |
PROG=gitweb | |
PID=/var/run/gitweb.pid | |
case "$1" in | |
start) | |
echo -n "Starting $PROG services" | |
export FCGI_SOCKET_PATH=127.0.0.1:9002 | |
nohup /var/www/nginx/cgi-bin/gitweb/gitweb.fcgi < /dev/null > /dev/null 2>&1 & | |
echo "" | |
;; | |
stop) | |
echo -n "Shutting down $PROG services: " | |
pkill -9 -f gitweb | |
echo "" | |
;; | |
restart) | |
echo -n "Restarting $PROG services: " | |
stop | |
start | |
;; | |
*) | |
echo "Usage: <servicename> {start|stop|restart}" | |
exit 1 | |
;; | |
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
server_name git.MYSITE.com; | |
location / { | |
index gitweb.fcgi | |
root /var/www/nginx/cgi-bin/gitweb; | |
include /etc/nginx/fastcgi_params; | |
fastcgi_pass 127.0.0.1:9002; | |
} | |
location /static { | |
root /var/www/nginx/cgi-bin/gitweb/; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment