[文章作者:张宴 本文版本:v1.0 最后修改:2008.10.06 转载请注明原文链接:http://blog.zyan.cc/read.php/371.htm]

  今天花几分钟写的一个PHP小程序,用途是:无需给程序员开放服务器SSH帐号,只需通过Web浏览器即可从SVN版本库更新代码到Linux服务器的指定目录。如果有需要,可以给这段代码加个密码登录。

  1、假设www、www是Apache或Nginx服务器的用户名和组,/data0/www/是网页文件存放根目录,执行以下shell命令:
sudo -s
/usr/sbin/groupadd www -g 48
/usr/sbin/useradd -u 48 -g www www
mkdir -p /data0/www/
chown -R www:www /data0/www/
su www
cd /data0/www/
/usr/local/bin/svn checkout --username zhangyan --password 123456 http://xxx.xxx.xxx.xxx:8080/svn/web/trunk/


  2、创建文件svn_up.php:

  3、通过浏览器访问svn_up.php,显示以下内容(例):
  U    /data0/www/app/DataTransferService.php
  Updated to revision 561.



Tags: , ,
技术大类 » 其他Unix技术 | 评论(30) | 引用(1) | 阅读(50199)
xujie555
2012-5-21 13:50
coach factory outlet uses graceful accessories to match the classical logo of coach, which is the best combination of coach. The handmade coach products?can make you more charming and graceful.coach factory online provides people many coach goods. If you wish to snatch the coach handbag, then this best method is made for that you like for coach discount.coach factory outlet online is a fashion brand to ensure its quality. With designer coach shoulder bags, you will always attract people's attention. The bags will emphasize your personal style and taste.<br/>
xujie333
2012-5-21 15:15
coach outlet online Store guarantee that all the coach handbags offered are own high quality. In addition , all of them are sold at an unexpected low price.If you want to purchase, just visit their website.coach factory outlet is really sizzling kinds of shopping way for you. With the usage of the replica designer coach bags, you can surely be able to change your individual looks in a stunning manner.Coach bags on sale from the coach outlet are cheap or discount prices that you certainly will stand out from the crowd on your next camping trip!<br/>
coach88888888 Email
2012-8-13 17:53
If you desire to go to Coach Factory Outlet, but have no idea in which to go, you can research online. It is no doubt that there is drastically information and details about it for the reference.Coach Factory Online are loved by many people, when you walk in the street, you could see many people take coach styles.hat experts claim Coach Outlet Online shopping is in the changes they are available in.Coach Outlet will send you a coupon in the post to use in their upon only after you type a achieve. The Coach bags are customarily somewhat many than the ones in the stores.
sdsd Homepage
2012-11-28 14:13
MDHERTER
2012-11-28 15:53
GWETWE
2013-1-29 17:25
买轴承就到:www.jkzhoucheng.cn
GAWER
2013-1-29 17:37
买轴承就到:www.jkzhoucheng.cn
周梦康 Email Homepage
2013-8-1 14:09
stupid这样写了,我是B服务器更新SVN服务器A上的代码,我也先检出了,但是当我访问该php文件的时候,没有输出,我在本地测试也一样。 shuai哦,看到了,我的应该是/usr/local/svn/bin/svn
周梦康 Email Homepage
2013-8-1 15:02
还是不行。$handle = popen('svnserve --version','r');执行这一句还行;但是更新就不行,是权限问题吗?我在服务器上能svn up 成功
phpchengxuyuan@sina.com
2014-6-13 15:12
我的执行后返回Updating '/www/web/public': Updating '/www/web/public':不显示版本信息,也没把代码更新到服务器上,没有进行修改的文件就显示了当前的版本信息还是正确的版本信息,请问这个是为什么,宴哥?
申博百家乐领导娱乐新潮流,棋牌技术誉满全球。
[2014-6-13 16:03]
来源:郭伏足球资讯
内容:申博在线办理领导娱乐新潮流,棋牌技术誉满全球。http://sunbetshenbo.net
分页: 2/2 第一页 上页 1 2 最后页
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]