/*add by HanSyaun for showing code on article. start*/ /*add by HanSyaun for showing code on article. end*/

2017年10月24日 星期二

Perforce Server setup for Internet connection. (Success)


1.下載p4(Command Line)和P4d(Server)


https://www.lifewire.com/view-hidden-mac-folders-using-terminal-2260776
defaults write com.apple.finder AppleShowAllFiles TRUE
killall Finder

/usr/local/bin

p4 set p4client=my_client

2.關掉防火牆
3.將p4和p4d都用chmod +x變成可以執行檔,放在usr/local/bin,點兩下好像可以執行安裝?
4.查本機ip,router要指定本機ip做port forward,設完要重開。router設就好,modem不用設。
5.查自己的public ip準備給別人連。111.240.147.89
6.export P4PORT=111.240.147.89:1666  (設port,P4PORT大小寫好像有差)
7.打p4 info出錯
Hans-MacBook-Pro:~ yhs$ p4 info
Perforce client error:
Connect to server failed; check $P4PORT.
TCP connect to 111.240.147.89:1666 failed.

connect: 111.240.147.89:1666: Connection refused
8.執行p4d也出錯


Hans-MacBook-Pro:~ yhs$ p4d
Perforce server error:
Listen 111.240.147.89:1666 failed.
TCP listen on 111.240.147.89:1666 failed.

bind: 111.240.147.89:1666: Can't assign requested address
9.看到網路上說不指定ip的話會自己找可以用的?那就直接 export P4PORT=1666
Hans-MacBook-Pro:~ yhs$ export P4PORT=1666
Hans-MacBook-Pro:~ yhs$ p4 set
P4CLIENT=my_client (enviro)
P4CONFIG=.p4config (enviro) (config 'noconfig')

P4PORT=1666
10.p4 info還是出錯,不過這次connect是127.0.0.1,之前都是0.0.0.1?
Hans-MacBook-Pro:~ yhs$ p4 info
Perforce client error:
Connect to server failed; check $P4PORT.
TCP connect to 1666 failed.

connect: 127.0.0.1:1666: Connection refused
11.但是這次打p4d...竟然可以run!
Hans-MacBook-Pro:~ yhs$ p4d

Perforce Server starting...

而且外部電腦直接打ip連的到了!

12.當有人連進來,看的到ip和版本
Perforce Server starting...
Perforce server info:
2017/08/09 00:10:54 pid 1010 yhs@_____CLIENT_UNSET_____ 220.134.212.217 [P4V/NTX64/2014.3/1007540/v77] 'user-protects -m'
--- failed authentication check

Perforce server info:
2017/08/09 00:12:39 pid 1020 yhs@yhs_testP4Server 192.168.1.1 [P4V/MACOSX1011X86_64/2017.2/1518788/v81] 'user-protects -m'

--- failed authentication check


reference:
https://forums.perforce.com/index.php?/topic/5455-not-sure-how-to-make-computer-connect-server-via-internet/
我在perforce fourm的發問


https://stackoverflow.com/questions/26981465/hosting-perforce-server-on-internet
You can also try starting your server at 'p4d -p 1666' and see if it will listen on an address that is accessible by your partner's machine

https://forums.perforce.com/index.php?/topic/5210-can-only-connect-to-server-via-localhost-ip-times-out/page__hl__internet#entry21384

set client
https://stackoverflow.com/questions/33075662/how-to-set-client-root-in-perforce-p4-when-client-unknown-error-comes


http://support.hornington.com/kb/question.php?ID=451

https://books.google.com.tw/books?id=mlm61wb2v3MC&pg=PT327&lpg=PT327&dq=export+p4port&source=bl&ots=IZq_yMIpUy&sig=QIRgPZyUtdfZ82r-v1aP6mrvKIQ&hl=zh-TW&sa=X&ved=0ahUKEwjruJ7B68fVAhXHq5QKHcJEA30Q6AEIXjAH#v=onepage&q=export%20p4port&f=false

pdf
http://mycodetub.logdown.com/posts/200868-perforce-automatically-login-without-entering-the-password

myFreeBSD and a lot references
http://wiki.weithenn.org/cgi-bin/wiki.pl?Perforce-Version_Control_System

Accessing a home Perforce server over the Internet
http://answers.perforce.com/articles/KB/13219


沒有留言:

張貼留言