codecube是图形化的svn管理平台。这里你可以了解codecube是如何安装并配置的。
操作系统 CENTOS 5.5codecube
[点击取得codecube] 解压/data/tmp目录,方便管理
创建相关路径
yum -y install yum-utils yum -y install gcc gcc-c++ ncurses ncurses-devel autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel pcre-devel expat-devel cmake bison groupadd mysql useradd -g mysql mysql groupadd www useradd -g www www mkdir -pv /data/www chown www:www -R /data/www groupadd svn useradd -g svn svn mkdir -pv /data/svn chown svn:svn -R /data/svn mkdir -pv /data/tmp
wget https://www.cmake.org/files/v2.8/cmake-2.8.4.tar.gz tar zxvf cmake-2.8.4.tar.gz cd cmake-2.8.4 ./bootstrap make make install cd .. wget https://ftp.gnu.org/gnu/bison/bison-2.5.tar.gz tar zxvf bison-2.5.tar.gz cd bison-2.5 ./configure make make install cd .. tar xvf /data/tmp/codecube/mysql-5.5.17.tar.gz cd mysql-5.5.17/ cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \ -DMYSQL_UNIX_ADDR=/tmp/mysql.sock \ -DDEFAULT_CHARSET=utf8 \ -DDEFAULT_COLLATION=utf8_general_ci \ -DWITH_EXTRA_CHARSETS:STRING=utf8,gbk,gb2312 \ -DWITH_MYISAM_STORAGE_ENGINE=1 \ -DWITH_INNOBASE_STORAGE_ENGINE=1 \ -DWITH_MEMORY_STORAGE_ENGINE=1 \ -DWITH_READLINE=1 \ -DENABLED_LOCAL_INFILE=1 \ -DMYSQL_USER=mysql make make install ln -s /usr/local/mysql/lib/libmysqlclient.so.18 /usr/lib/libmysqlclient.so.18 cd support-files/ cp my-large.cnf /etc/my.cnf cp mysql.server /etc/rc.d/init.d/mysqld cd ../../ chown -R mysql:mysql /usr/local/mysql chmod +w /usr/local/mysql chmod +x /etc/init.d/mysqld #service mysqld start 失败的话运行下面命令 #/usr/local/mysql/scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data &
设置开机启动
chkconfig --add mysqld chkconfig mysqld on
tar xvf /data/tmp/codecube/httpd-2.2.22.tar.gz cd httpd-2.2.22/ cp -rf /data/tmp/codecube/cc/app/codecube/scripts/apache2_authn_allow . ./configure --prefix=/usr/local/apache2 -enable-dav -enable-so -enable-maintainer-mode -enable-rewrite --with-modules=apache2_authn_allow/ make make install # 安装模块 cd apache2_authn_allow make make install cd ../../
编辑httpd.conf
vim /usr/local/apache2/conf/httpd.conf在里面添加
LoadModule authn_allow_module modules/mod_authn_allow.so找到下面的内容
User daemon Group daemon DocumentRoot "/usr/local/apache2/htdocs" <Directory "/usr/local/apache2/htdocs">改为
User www Group www DocumentRoot "/data/svn" <Directory "/data/svn">站点认证配置
cp -f /data/tmp/codecube/cc/app/codecube/scripts/apache.conf /usr/local/apache2/conf/ cat >> httpd.conf <<"EOF" ServerName localhost Include conf/apache.conf EOF服务配置
vim /usr/local/apache2/bin/apachectl在第二行添加两行
# chkconfig: 2345 85 15 # description: Activates/Deactivates Apache Web Server复制脚本文件
cp -f /usr/local/apache2/bin/apachectl /etc/init.d/
设置开机启动
chkconfig --add httpd chkconfig httpd on
版本必须是1.6.16。把mod_authz_svn替换掉。
tar xvf /data/tmp/codecube/subversion-1.6.16.tar.bz2 cd subversion-1.6.16.tar.bz2 wget https://www.webdav.org/neon/neon-0.29.6.tar.gz tar xvzf neon-0.29.6.tar.gz mv neon-0.29.6 neon cp -rf /data/tmp/codecube/cc/app/codecube/scripts/subversion_authz_svn/* /data/tmp/subversion-1.6.16/subversion/mod_authz_svn ./configure --prefix=/usr/local/svn --with-apxs=/usr/local/apache2/bin/apxs make make install cd ../../安装完成后httpd.conf文件会自动增加模块
LoadModule dav_svn_module modules/mod_dav_svn.so LoadModule authz_svn_module modules/mod_authz_svn.so
如果前面都编译正确会显示一下三个so文件
ls /usr/local/apache2/modules/
httpd.exp mod_authn_allow.so mod_authz_svn.so mod_dav_svn.so
安装PHP参照lnmp服务器,php版本请选择装最新的php5.3.10
安装php的svn扩展
wget https://pear.php.net/go-pear.phar php go-pear.phar wget https://pecl.php.net/get/svn-1.0.1.tgz tar xvf svn-1.0.1.tgz cd svn-1.0.1 phpize ./configure --with-svn=/usr/local/svn --with-libdir=/usr/local/svn/lib make LDFLAGS=-L/usr/local/svn/lib make install cd ../编辑php.ini
cat >> /usr/local/php/etc/php.ini <<"EOF" extenstion=svn.so EOF设置开机启动
chkconfig --add php-fpm chkconfig php-fpm on
配置参照lnmp服务器
编译nginx的时候注意:
tar xvf /data/tmp/codecube/nginx-1.0.8.tar.gz cd nginx-1.0.8 cp -rf /data/tmp/codecube/cc/app/codecube/scripts/nginx_auth_mysql . ./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_ssl_module --add-module=nginx_auth_mysql make make install cd ../
codecube站点配置
cp -f /data/tmp/codecube/cc/app/codecube/scripts/nginx.conf /usr/local/nginx/conf/site/codecube.conf
nginx启动脚本
cat > /etc/init.d/nginx <<"EOF"
#!/bin/sh
#
# nginx - this script starts and stops the nginx daemin
#
# chkconfig: - 85 15
# description: Nginx is an HTTP(S) server, HTTP(S) reverse \
# proxy and IMAP/POP3 proxy server
# processname: nginx
# config: /usr/local/nginx/conf/nginx.conf
# pidfile: /usr/local/nginx/logs/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="/usr/local/nginx/conf/nginx.conf"
lockfile=/var/lock/subsys/nginx
start() {
[ -x $nginx ] || exit 5
[ -f $NGINX_CONF_FILE ] || exit 6
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
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
EOF
设置开机启动
chkconfig --add nginx chkconfig nginx on
mysql -uroot -p mysql> CREATE DATABSE codecube
cp -rf /data/tmp/codecube/cc /data/www /data/www/cc/app/base/cmd install codecube
cd /data/svn tar xvf /data/tmp/codecube/hook-runner.tar
访问站点
https://192.168.51.118:667如果访问不了检查下iptables是否为开启状态,关闭他。