亚洲最大看欧美片,亚洲图揄拍自拍另类图片,欧美精品v国产精品v呦,日本在线精品视频免费

  • 站長(zhǎng)資訊網(wǎng)
    最全最豐富的資訊網(wǎng)站

    centos上搭建SVN并將項(xiàng)目同步到PHP項(xiàng)目的系統(tǒng)根目錄的方法詳解

    下面由Centos入門教程欄目給大家介紹centos上搭建SVN并將項(xiàng)目同步到PHP項(xiàng)目的系統(tǒng)根目錄的方法,希望對(duì)需要的朋友有所幫助!

    centos上搭建SVN并將項(xiàng)目同步到PHP項(xiàng)目的系統(tǒng)根目錄的方法詳解

    一、SVN安裝

    這里采用yum安裝方式:

    1、rpm -qa subversion //檢查是否安裝了低版本的SVN

    2、yum remove subversion //如果存儲(chǔ)舊版本,卸載舊版本SVN

    3、開始安裝yum -y install subversion

    安裝好后查看版本svnserve –version

    4、創(chuàng)建版本倉(cāng)庫(kù):

    mkdir -p /data/svn/project                                 svnadmin create /data/svn/project/

    查看/data/svn/project 文件夾可以發(fā)現(xiàn)有conf, db,format,hooks, locks, README.txt等文件,說(shuō)明一個(gè)SVN庫(kù)已經(jīng)建立。

    5、配置權(quán)限

       cd /data/svn/project/conf/            //進(jìn)入配置目錄      vim svnserve.conf                    //編輯配置文件,加入下面五行內(nèi)容 ``` [general] ### The anon-access and auth-access options control access to the`` ### repository for unauthenticated (a.k.a. anonymous) users and ### authenticated users, respectively. ### Valid values are "write", "read", and "none". ### Setting the value to "none" prohibits both reading and writing; ### "read" allows read-only access, and "write" allows complete  ### read/write access to the repository. ### The sample settings below are the defaults and specify that anonymous ### users have read-only access to the repository, while authenticated ### users have read and write access to the repository. # anon-access = read # auth-access = write anon-access = none auth-access = write password-db = passwd authz-db = authz realm = /data/svn/project ```

    6、編輯密碼文件,添加用戶test 密碼123456:

    vim passwd   ### This file is an example password file for svnserve. ### Its format is similar to that of svnserve.conf. As shown in the ### example below it contains one section labelled [users]. ### The name and password for each user follow, one account per line. [users] # harry = harryssecret # sally = sallyssecret test = 123456

    7、編輯權(quán)限文件,添加用戶test權(quán)限

    vim authz [groups] # harry_and_sally = harry,sally # harry_sally_and_joe = harry,sally,&joe [/] test = rw

    8、配置防火墻

    vi /etc/sysconfig/iptables

    加入:

    ``` -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp -dport 3690 -j ACCEPT ```

    重啟防火墻:service iptables restart

    9、啟動(dòng)SVN:svnserve -d -r /data/svn/

    查看端口狀態(tài):netstat -ln | grep 3690

    二、給svn添加鉤子同步文件到PHP測(cè)試環(huán)境 (這里PHP項(xiàng)目目錄為/var/www/html/project/)

    1、進(jìn)入版本庫(kù)下的hooks目錄

    cd /data/svn/project/hooks/

    2、將post-commit.tmpl 復(fù)制為 post-commit

    cp post-commit.tmpl post-commit

    3、給post-commit可執(zhí)行權(quán)限

    chmod 0777 post-commit

    4、編輯post-commit,注釋掉#mailer.py……這一行,添加下面四行,編碼問(wèn)題,如果錯(cuò)誤的話可能導(dǎo)致無(wú)法同步 成功,可選的有en_US.UTF-8、zh_CN.UTF-8、zh_CN.GB2312,可以一個(gè)個(gè)試。

    vi post-commit #mailer.py commit "$REPOS" "$REV" /path/to/mailer.conf export.GB2312 SVN=/usr/bin/svn STATIC_DIR=/var/www/html/project/ ${SVN} update  ${STATIC_DIR} --username "test" --password "123456"

    5、在提交之前,進(jìn)行一次checkout代碼到指定目錄

    svn checkout svn://localhost/project /var/www/html/project/

    注:如果一直出錯(cuò):“由于連接方在一段時(shí)間后沒(méi)有正確答復(fù)或連接的主機(jī)沒(méi)有反應(yīng),連接嘗試失敗”;可能是網(wǎng)絡(luò)端口開放設(shè)置問(wèn)題,因?yàn)槎丝趩?wèn)題導(dǎo)致無(wú)法成功checkout項(xiàng)目,可以進(jìn)入阿里云看看看看有沒(méi)有允許3690的端口,如果沒(méi)有3690的端口就添加一條安全組規(guī)則。

    贊(0)
    分享到: 更多 (0)
    網(wǎng)站地圖   滬ICP備18035694號(hào)-2    滬公網(wǎng)安備31011702889846號(hào)