Author: Jin
Date: 20140827
System: CentOS release 6.5 (Final)html
參考:http://www.cnblogs.com/itech/archive/2011/08/19/2146058.html
windows安裝
http://www.cnblogs.com/itech/archive/2011/08/15/2139516.htmllinux
1.建立用戶
useradd -d /usr/local/perforce -m perforce
passwd perforcevim
2.安裝
1).安裝
http://filehost.perforce.com/perforce/r14.1/bin.linux26x86_64/
su - perforce
mkdir p4root
mkdir log
mkdir bin && cd bin
wget http://filehost.perforce.com/perforce/r14.1/bin.linux26x86_64/p4d && chmod 755 p4d
wget http://filehost.perforce.com/perforce/r14.1/bin.linux26x86_64/p4 && chmod 755 p4windows
2)配置
# vim p4server001.ini安全
1 # and it need be $USERHOME/$P4SERVERNAME.ini 2 USER=perforce 3 USERHOME=/usr/local/perforce 4 5 P4USER=perforce 6 P4PASSWD=123.com 7 P4SERVERNAME=p4server001 8 9 p4=$USERHOME/bin/p4 10 p4d=$USERHOME/bin/p4d 11 12 P4PORT=192.168.1.220:1666 13 P4ROOT=$USERHOME/p4root 14 JOURNAL=$USERHOME/journal 15 LOG=$USERHOME/log/p4server001.log
3.啓動
1) 啓動腳本
# vim /etc/init.d/p4server001bash
1 #!/bin/bash 2 # 3 # chkconfig:1235 80 80 4 # description: p4server001 daemon 5 # 6 7 PATH=/sbin:/bin:/usr/bin:/usr/sbin 8 9 # Source in the configs... 10 . /usr/local/perforce/p4server001.ini 11 12 SU="su $USER -c" 13 LOCKFILE=$USERHOME/$P4SERVERNAME.lock 14 15 start() { 16 STARTCMD="$p4d -d -v server=$SERVERLEVEL,track=$TRACKLEVEL -p $P4PORT -r $P4ROOT -L $LOG -J $JOURNAL" 17 $SU "$STARTCMD" 2>&1 18 touch $LOCKFILE 19 $SU "logger p4d starting" 20 echo "p4d was started on" `hostname -s` 21 } 22 stop() { 23 STOPCMD="$p4 -p $P4PORT -u $P4USER admin stop" 24 echo $P4PASSWD | $p4 -p $P4PORT -u $P4USER login 25 $SU "$STOPCMD" 2>&1 26 rm $LOCKFILE 27 $SU "logger p4d stopping" 28 echo "p4d was stopped on" `hostname -s` 29 } 30 31 status() { 32 if [ -f $LOCKFILE ]; 33 then 34 echo p4d status: running 35 else 36 echo p4d status: stopped 37 fi 38 } 39 40 case "$1" in 41 42 'start') 43 start 44 ;; 45 46 'stop') 47 stop 48 ;; 49 50 'status') 51 status 52 ;; 53 *) 54 echo "Usage: p4server001 { start | stop | status }" 55 ;; 56 57 esac
# chmod 755 /etc/init.d/p4server001
2)啓動
使用root啓動
[root@gs01 ~]# /etc/init.d/p4server001 start
p4d was started on gs0
[root@gs01 ~]# /etc/init.d/p4server001 status
p4d status: running
4.開機啓動
[root@gs01 ~]# chkconfig --add p4server001
[root@gs01 ~]# chkconfig p4server001 on
[root@gs01 ~]# chkconfig p4server001 --list
p4server001 0:off 1:on 2:on 3:on 4:on 5:on 6:off服務器
5.設置
1)管理員帳號
第一個登陸的帳號,會提示是否做爲管理員,登陸時能夠本身建立帳號。ide
2)開啓utf8字符支持
p4d -xi工具
3)客戶端配置
[perforce@gs01 ~]$ cat client.ini
export P4PORT=192.168.1.220:1666 #P4所在的主機
export P4CLIENT=gs01 #指定了與perforce服務器交流的client是什麼
export P4USER=perforce #P4用戶名
export P4PASSWD=123.com #P4密碼
export P4CHARSET=utf8 #調用命令時使用的字符集
# . client.ini
p4 -u $P4USER -C $P4CHARSET loginthis
修改客戶端配置,好比
如今的狀況,從開發版本切換出一個release版本 如何修改
p4 -u $P4USER client
Stream: //Server/Relese0811
或者windows圖形界面修改work space
4)安全等級
默認安全等級爲0,鏈接到服務器就能夠本身建立帳號,建立workspace
$ p4 -u jin login
$ p4 counter -f security 1
You don't have permission for this operation.
使用圖形界面工具p4admin修改
關閉任何用戶的write權限
從write修改成list
好像仍是能夠建立
5)權限管理http://www.cnblogs.com/itech/archive/2011/08/15/2139695.html