- 将tar包放到linux伺服器上
- 解壓tar包,tar zxvf rpc.rstatd.....
- 打開解壓的檔案夾 cd rpc.rstatd....
4.編譯
編譯時報錯:
[root@VM_74_238_centos rpc.rstatd-4.0.1]# ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
/usr/local/src/rpc.rstatd-4.0.1/missing: Unknown `--run' option
Try `/usr/local/src/rpc.rstatd-4.0.1/missing --help' for more information
configure: WARNING: `missing' script is too old or missing
checking for gawk... gawk
checking whether make sets $(MAKE)... no
checking for gawk... (cached) gawk
checking for gcc... no
checking for cc... no
checking for cl... no
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.
未安裝gcc包,使用yum安裝,yum install gcc
5. make
報錯:[root@VM_74_238_centos rpc.rstatd-4.0.1]# make
-bash: make: command not found
檢視環境變量的路徑:
[root@VM_74_238_centos rpc.rstatd-4.0.1]# echo $PATH
/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
已經添加,考慮make安裝包是否未安裝,yum install make
6. make install
7. 啟動 rpc.rstatd
報錯:Cannot register service: RPC: Unable to receive; errno = Connection refused......
這個錯誤是因為伺服器沒有開啟端口映射的功能,需要安裝portmap
解決辦法: yum install portmap
确認的linux版本,如果是6.0及以上,rpcbind替代了portmap
啟動rpcbind
# /etc/rc.d/init.d/rpcbind start