正式版SVN服务器配置清单


正式版SVN服务器配置清单,具体的操作指令,请看: http://rg4.net/archives/665.html

非常抱歉,我还不会用这个SyntaxHighlighter,结果这个格式全乱套了。所以若出现问题,请直接下载这个包:http://rg4.net/p/vps/svn.7z

/etc/httpd/conf.d/subversion.conf

[code]

LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so

#
# Example configuration to enable HTTP access for a directory
# containing Subversion repositories, "/var/www/svn". Each repository
# must be both:
#
# a) readable and writable by the 'apache' user, and
#
# b) labelled with the 'httpd_sys_content_t' context if using
# SELinux
#

#
# To create a new repository "http://localhost/repos/stuff" using
# this configuration, run as root:
#
# # cd /var/www/svn
# # svnadmin create stuff
# # chown -R apache.apache stuff
# # chcon -R -t httpd_sys_content_t stuff
#

Allow from all

DAV svn
SVNParentPath /srv/svn
AuthType Basic
AuthName "svn.agimvc.com"
AuthUserFile /srv/svn_conf/httpd_passwd
AuthzSVNAccessFile /srv/svn_conf/authz
Require valid-user

[/code]

/etc/nginx/nginx.conf

[code]
user www www;
worker_processes 2;

error_log /srv/log/nginx/error.log;

pid /srv/log/nginx/nginx.pid;

events {
use epoll;
worker_connections 4096;
}

http {
include mime.types;
default_type application/octet-stream;
server_tokens off;

sendfile on;
#tcp_nopush on;

keepalive_timeout 65;

include gzip.conf;

# All websites defined in here
include /etc/nginx/vhost/*.conf;
}
[/code]

/etc/nginx/gzip.conf

[code]
gzip on;
gzip_min_length 1000;
gzip_types text/plain text/css application/x-javascript;
[/code]

/etc/nginx/vhost/default.conf

[code]
server {

listen 80;
server_name localhost;

location / {
root /srv/www;
index index.html index.htm;
}

location ~ \.php$ {
root /srv/www;
fastcgi_pass unix:/dev/shm/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}

location ~ /\.ht {
deny all;
}
}
[/code]

/etc/init.d/nginx

[code]
#!/bin/sh
#
# nginx – this script starts and stops the nginx daemon
#
# chkconfig: – 85 15
# description: Nginx is an HTTP(S) server, HTTP(S) reverse \
# proxy and IMAP/POP3 proxy server
# processname: nginx
# config: /etc/nginx/nginx.conf
# config: /etc/sysconfig/nginx
# pidfile: /var/run/nginx.pid

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ “$NETWORKING” = “no” ] && exit 0

nginx="/usr/local/nginx/sbin/nginx"
prog=$(basename $nginx)

NGINX_CONF_FILE="/etc/nginx/nginx.conf"

[ -f /etc/sysconfig/nginx ] && . /etc/sysconfig/nginx

lockfile=/var/lock/subsys/nginx

make_dirs() {
# make required directories
user=$nginx -V 2>&1 | grep "configure arguments:" | sed 's/[^*]*--user=\([^ ]*\).*/\1/g' -
# if [ -z “grep $user /etc/passwd” ]; then
# useradd -M -s /bin/nologin $user
# fi
# options=$nginx -V 2>&1 | grep 'configure arguments:'
# for opt in $options; do
# if [ echo $opt | grep '.*-temp-path' ]; then
# value=echo $opt | cut -d "=" -f 2
# if [ ! -d “$value” ]; then
# # echo "creating" $value
# mkdir -p $value && chown -R $user $value
# fi
# fi
# done
}

start() {
[ -x $nginx ] || exit 5
[ -f $NGINX_CONF_FILE ] || exit 6
make_dirs
echo -n $"Starting $prog: "
daemon $nginx -c $NGINX_CONF_FILE
retval=$?
echo
[ $retval -eq 0 ] && touch $lockfile
return $retval
}

stop() {
echo -n $"Stopping $prog: "
killproc $prog -QUIT
retval=$?
echo
[ $retval -eq 0 ] && rm -f $lockfile
return $retval
}

restart() {
configtest || return $?
stop
sleep 1
start
}

reload() {
configtest || return $?
echo -n $"Reloading $prog: "
killproc $nginx -HUP
RETVAL=$?
echo
}

force_reload() {
restart
}

configtest() {
$nginx -t -c $NGINX_CONF_FILE
}

rh_status() {
status $prog
}

rh_status_q() {
rh_status >/dev/null 2>&1
}

case "$1" in
start)
rh_status_q && exit 0
$1
;;
stop)
rh_status_q || exit 0
$1
;;
restart|configtest)
$1
;;
reload)
rh_status_q || exit 7
$1
;;
force-reload)
force_reload
;;
status)
rh_status
;;
condrestart|try-restart)
rh_status_q || exit 0
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload|configtest}"
exit 2
esac
[/code]

/usr/local/php/etc/php-fpm.conf

[code]
[global]

pid = /srv/log/php-fpm/run.pid
error_log = /srv/log/php-fpm/error.log
log_level = warning
emergency_restart_threshold = 60
emergency_restart_interval = 60s
process_control_timeout = 30
process.max = 20
rlimit_files = 1024
events.mechanism = epoll

[www]

user = www
group = www
listen = "/dev/shm/php-fpm.sock"
pm = static
pm.start_servers = 10
pm.max_children = 50
rlimit_files = 1024
chdir = /srv/www
[/code]

/etc/init.d/php-fpm

[code]
#!/bin/bash
#
# Startup script for the PHP-FPM server.
#
# chkconfig: 345 85 15
# description: PHP is an HTML-embedded scripting language
# processname: php-fpm
# config: /usr/local/php/etc/php.ini

# Source function library.
. /etc/rc.d/init.d/functions

PHP_PATH=/usr/local/php
DESC="php-fpm daemon"
NAME=php-fpm
# php-fpm路径
DAEMON=$PHP_PATH/sbin/$NAME
# 配置文件路径
CONFIGFILE=$PHP_PATH/etc/php-fpm.conf
# PID文件路径(在php-fpm.conf设置)
PIDFILE=/srv/log/php-fpm/run.pid
SCRIPTNAME=/etc/init.d/$NAME

# Gracefully exit if the package has been removed.
test -x $DAEMON || exit 0

rh_start() {
$DAEMON -y $CONFIGFILE || echo -n " already running"
}

rh_stop() {
kill -QUIT cat $PIDFILE || echo -n " not running"
}

rh_reload() {
kill -HUP cat $PIDFILE || echo -n " can't reload"
}

case "$1" in
start)
echo -n "Starting $DESC: $NAME"
rh_start
echo "."
;;
stop)
echo -n "Stopping $DESC: $NAME"
rh_stop
echo "."
;;
reload)
echo -n "Reloading $DESC configuration…"
rh_reload
echo "reloaded."
;;
restart)
echo -n "Restarting $DESC: $NAME"
rh_stop
sleep 1
rh_start
echo "."
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|restart|reload}" >&2
exit 3
;;
esac
exit 0
[/code]

svnadmin/data/config.tpl.ini

[code][Subversion]
SVNAuthFile=/srv/svn_conf/authz

[Repositories:svnclient]
SVNParentPath=/srv/svn
SvnExecutable=/usr/bin/svn
SvnAdminExecutable=/usr/bin/svnadmin

[Users:passwd]
SVNUserFile=/srv/svn_conf/httpd_passwd

[Users:digest]
SVNUserDigestFile=/srv/svn_conf/passwd
SVNDigestRealm=SVN Privat
[/code]

/etc/init.d/dropbox

[code]#!/bin/sh
# chkconfig: 345 85 15
# description: Startup script for dropbox daemon
#
# processname: dropboxd
# pidfile: /var/run/dropbox.pid
# config: /etc/sysconfig/dropbox
#

### BEGIN INIT INFO
# Provides: dropboxd
# Required-Start: $local_fs $network $syslog
# Required-Stop: $local_fs $syslog
# Should-Start: $syslog
# Should-Stop: $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start up the Dropbox file syncing daemon
# Description: Dropbox is a filesyncing sevice provided by dropbox.com
# This service starts up the dropbox daemon.
### END INIT INFO

# Source function library.
. /etc/rc.d/init.d/functions

# To configure, add line with DROPBOX_USERS="user1 user2" to /etc/sysconfig/dropbox
# Probably should use a dropbox group in /etc/groups instead.
[ -f /etc/sysconfig/dropbox ] && . /etc/sysconfig/dropbox

prog=dropboxd
lockfile=${LOCKFILE-/var/lock/subsys/$prog}
config=${CONFIG-/etc/sysconfig/dropbox}
RETVAL=0

start() {
echo -n $"Starting $prog"

if [ -z $DROPBOX_USERS ] ; then
echo -n ": unconfigured: $config"
echo_failure
echo
rm -f ${lockfile} ${pidfile}
RETURN=6
return $RETVAL
fi

for dbuser in $DROPBOX_USERS; do
daemon –user $dbuser /bin/sh -c "/$dbuser/.dropbox-dist/dropboxd&"
done

RETVAL=$?
echo
[ $RETVAL = 0 ] && touch ${lockfile}
return $RETVAL
}

status() {
for dbuser in $DROPBOX_USERS; do
dbpid=pgrep -u $dbuser dropbox
if [ -z $dbpid ] ; then
echo "dropboxd for USER $dbuser: not running."
else
echo "dropboxd for USER $dbuser: running (pid $dbpid)"
fi
done
}

stop() {
echo -n $"Stopping $prog"
for dbuser in $DROPBOX_USERS; do
killproc /$dbuser/.dropbox-dist/dropbox
done
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}
}

# See how we were called.
case "$1" in
start)
start
;;
status)
status
;;
stop)
stop
;;
restart)
stop
start
;;
*)
echo $"Usage: $prog {start|status|stop|restart}"
RETVAL=3
esac

exit $RETVAL
[/code]

Leave a comment

Your email address will not be published. Required fields are marked *