在nginx的server配置中增長linux
client_max_body_size 100M;nginx
linux多實例apache+svn部署shell
1.首先建立多實例目錄apache
svnadmin create /svn/psm/vim
svnadmin create /svn/sh/ 服務器
2.賦予權限:wordpress
chmod -R 777 /svn/psm /svn/shsvn
chown -R apache.apache /svn/psm /svn/shpost
3.修改用戶權限:ui
vim /svn/psm/conf/svnserve.conf
anon-access = none
auth-access = write
4.整合Apache
vi /etc/httpd/conf.d/subversion.conf 加入如下:
多少個實例就添加幾個location
<Location /psm>
DAV svn
SVNPath /svn/psm
AuthType Basic
AuthName "svn"
AuthUserFile /var/www/svn/project/conf/passwd
Require valid-user
</Location>
5.啓動svn
svnserver -d --listen-port 3690 -r /svn/sh
svnserver -d --listen-port 3691 -r /svn/psm
6.配置用戶信息
htpasswd -c passwd qinyj
導入項目: svn import /www/download/psm_server -m "psm_server" http://svn.qinyj.top/comparent/ --force-log
svn import /www/downloadsh -m "sh" http://svn.qinyj.top/comparent/ --force-log
svn co http://svn.qinyj.top/sh psm #checkout代碼。
svn up svn目錄 --username aaa svn代碼目錄。 #更新代碼庫。會根據隱藏文件.svn 與服務器更新代碼,若是本地工做目錄沒有會Add。
svn ci -m "備註信息" --username aaa svn代碼目錄。#提交到代碼庫。或者到svn目錄裏面svn ci -m "備註" --username aaa
7.更新提交腳本
[ ! -d /code/wordpress ] && mkdir -p /code/wordpress && svn co http://svn.${svn_name}.top/sh/wordpress/ /code/wordpress && exit 1 || cd /code/wordpress #檢查有沒有建立工做目錄
cd /code/wordpress #進入到工做目錄
update_svn()
{
svn update --username ${svn_name}
if [ $? -ne 0 ];then
echo "svn update failed"
exit 1
fi
VERSION=`svn info |awk -F"[ ]+" '/Revision/{print $2}'`
TEMP="`date +%Y%m%d`${VERSION}"
NUM=`echo ${TEMP}+1|bc`
echo -e "####################\nsvn update complete"
}
svn_commit (){VERSION=`svn info |awk -F"[ ]+" '/Revision/{print $2}'` echo "cd /code/wordpress" cd /code/wordpress [ ! -d /root/shell_log ] && mkdir -p /root/shell_log mkdir -p /root/shell_log/${VERSION} svn status |awk '{if($1=="!") print $0}' |cut -b 9- >/root/shell_log/${VERSION}/svn_del.log svn status |awk '{if($1=="?") print $0}' |cut -b 9- >/root/shell_log/${VERSION}/svn_add.log svn status |awk '{if($1=="M") print $0}' |cut -b 9- >/root/shell_log/${VERSION}/svn_change.log while read line ;do svn delete "$line" ;done </root/shell_log/${VERSION}/svn_del.log && echo "svn delete complete" while read line ;do svn add "$line" ;done </root/shell_log/${VERSION}/svn_add.log && echo "svn add complete" svn commit -m "`date +%Y%m%d%H%M%S`" --username ${svn_name} && echo "svn commit complete" #刪除認證文件 rm -f /root/.subversion/auth/svn.simple/*}