virtualmin domain subversion svn hook post-commit public_html

1.

services--Subversion Repositories--creat a svn name as sitesvn

2.

添加 服务器端 只读 svn update 用户

Edit Users -- Add a website FTP access user --

Username -- This email address is being protected from spambots. You need JavaScript enabled to view it.

Password -- 123456

Other user permissions

Subversion login enabled?

Read-only access to repositories

Allowed repos

sitesvn


添加 远程可写 用户

Edit Users -- Add a website FTP access user --

Username -- This email address is being protected from spambots. You need JavaScript enabled to view it.

Password -- 123456

Other user permissions

Subversion login enabled?

Read/write access to repositories

Allowed repos

sitesvn


3

enable ssl for site

Edit Virtual Server -- Enabled features -- SSL website enabled?


4

use ssh

su as root

清空 文件夹

cd /home/yourdomain/public_html

rm -rf *


cd /home/mydomain/svn/sitesvn/hooks

cp post-commit.tmpl post-commit

vi post-commit


#!/bin/sh
svn update /home/yourdomain/public_html --username=server --password=123456 --non-interactive >> /home/yourdomain/logs/subversion_log


cd /home/yourdomain/logs


touch subversion_log


切换用户为 mydomain 运行 svn checkout

su domainuser


svn co https://yourdomain/svn/sitesvn/ /home/yourdomain/public_html --username=server --password=123456

p

yes

yes


不是必须 容易出错

chown apache:yourdomain /home/yourdomain/svn/sitesvn/hooks/post-commit
chown apache:yourdomain /home/yourdomain/logs/subversion_log
chown -R apache:yourdomain /home/yourdomain/public_html/.svn

 

chmod 770 /home/yourdomain/svn/sitesvn/hooks/post-commit
chmod 770 /home/yourdomain/logs/subversion_log
chmod 770 /home/yourdomain/public_html/.svn


Last modified onSunday, 14 October 2012 04:07

Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php on line 169
  • Published in Webmin
  • Read 2078 times

Notice: Only variables should be assigned by reference in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php on line 478
back to top