本文共 1480 字,大约阅读时间需要 4 分钟。
www-user, daemon-user, vcs-user
本次配置计划使用两个用户
其中www-user和daemon-user使用既有用apache
php-fpm本身配置的帐号是apache
这里daemon-user也直接使用apache用户。
./bin/config set phd.user apache
计划使用git作为用户名
./bin/config set diffusion.ssh-user git
创建用户并设置
useradd gitusermod -p NP gitusermod -s /bin/sh git
配置sudo
执行命令 visudo增加如下内容
git ALL=(apache) SETENV: NOPASSWD: /usr/bin/git-http-backend,/usr/bin/git,/usr/bin/git-upload-pack,/usr/bin/git-receive-pack,/usr/bin/svnserve,/usr/bin/svn
注意,如果存在
Defaults requiretty
则需要将它注释掉(在行首增加 # )
./bin/config set diffusion.ssh-port 2222
cp ./resources/sshd/phabricator-ssh-hook.sh /usr/libexec/phabricator-ssh-hook.shchmod 755 /usr/libexec/phabricator-ssh-hook.shcp ./resources/sshd/sshd_config.phabricator.example /etc/ssh/sshd_config.phabricator
编辑配置文件
vi /etc/ssh/sshd_config.phabricator
AuthorizedKeysCommand /usr/libexec/phabricator-ssh-hook.shAuthorizedKeysCommandUser gitAllowUsers git
vi /usr/libexec/phabricator-ssh-hook.sh
# NOTE: Replace this with the username that you expect users to connect with.VCSUSER="git"# NOTE: Replace this with the path to your Phabricator directory.ROOT="/opt/phabricator"
/usr/sbin/sshd -f /etc/ssh/sshd_config.phabricator
出现错误信息:Could not load host key: /etc/ssh/ssh_host_dsa_key解决方法:
ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key
一路回车即可
然后再次启动
./bin/phd restart
如果有权限问题,设置目录权限chown -R apache. /var/tmp/phd
chown -R apache. /var/repo
转载地址:http://jdaal.baihongyu.com/