我這里使用的是ubuntu16.04的系統(tǒng)。
使用docker進(jìn)行安裝
我們使用https://hub.docker.com/r/redpointgames/phabricator/ 中提供的鏡像。
在則這個(gè)鏡像中已經(jīng)為我們提供了多種插件,不過需要我們自己提供一個(gè)mysql數(shù)據(jù)庫(kù)的地址。
所以我們可以先使用docker安裝一個(gè)mysql數(shù)據(jù)庫(kù)。可以參考:https://www.jb51.net/article/148880.htm
按照上面的教程,我們安裝了mysql,賬號(hào)為root,密碼為123456
通過
docker inspect <container id> |grep IPAddress
我們可以知道m(xù)ysql這個(gè)容器的ip地址。加入我們查到的這個(gè)容器的私有ip為172.17.0.2。
下面我們就可以來使用docker安裝phabricator了。
docker pull redpointgames/phabricator # 拉取最新版的phabricator
啟動(dòng)
docker run --name phabricator -p 443:443 -p 332:22 -p 8891:80 -v /root/phabricator/backup:/repos -e PHABRICATOR_HOST=xxxxxx:8891 -e MYSQL_HOST=172.17.0.2 -e MYSQL_USER=root -e MYSQL_PASS=123456 -e PHABRICATOR_REPOSITORY_PATH=/repos -e PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin -it redpointgames/phabricator /bin/bash /app/init.sh
其中xxxx為你服務(wù)器的外網(wǎng)ip,這個(gè)就可以通過http://xxxxx:8891來訪問你服務(wù)器上docker部署的phabricator了。不過記得開啟安全組。
安裝完成后,我們就可以通過外網(wǎng)ip
加端口號(hào)8891來訪問了。
這時(shí)我們添加的用戶,會(huì)默認(rèn)為系統(tǒng)的管理員,就可以登錄到后臺(tái)進(jìn)行其他的設(shè)置了。但是先不要推出這個(gè)頁(yè)面。因?yàn)橐M(jìn)行一些設(shè)置才行。
如果你第一次訪問不是這個(gè)界面, 我們也可以在控制臺(tái)通過命令 的方式添加用戶.
進(jìn)入容器
cd /srv/phabricator/phabricator
./bin/accountadmin
如果你的管理員用戶退出來了,提示下面的信息了
This Phabricator install is not configured with any enabled authentication providers which can be used to log in. If you have accidentally locked yourself out by disabling all providers, you can use phabricator/bin/auth recover <username>
to recover access to an administrative account.
你應(yīng)該運(yùn)行命令
進(jìn)入容器
cd /srv/phabricator/phabricator
./bin/auth recover luanpeng(在網(wǎng)頁(yè)中創(chuàng)建的管理員賬號(hào))
會(huì)提示通過一個(gè)網(wǎng)頁(yè)進(jìn)入。
Use this link to recover access to the "luanpeng" account from the web interface:
http://xxxxxx:8891/login/once/recover/1/xxxxxxxxxx/
After logging in, you can use the "Auth" application to add or restore authentication providers and allow normal logins to succeed.
根據(jù)提示進(jìn)行操作
在主頁(yè)左側(cè)欄選擇Auth,進(jìn)入下圖
允許用戶登錄注冊(cè)
到此為止,phabricator就安裝完畢了
如果你不想使用docker安裝,可以自己獨(dú)立部署。不過步驟比較繁瑣,所以建議還是通過docker部署。
使用安裝腳本安裝
創(chuàng)建安裝腳本。打開網(wǎng)址將網(wǎng)頁(yè)中的腳本內(nèi)容復(fù)制到新建的sh文件中,https://secure.phabricator.com/source/phabricator/browse/master/scripts/install/install_ubuntu.sh
將網(wǎng)址中的腳本文件下載下來,或者直接在本地創(chuàng)建一個(gè)sh文件,將網(wǎng)頁(yè)上的sh代碼復(fù)制下來。形成本地的安裝腳本install_ubuntu.sh
創(chuàng)建安裝目錄/home/luanpeng/work/phabricator
將安裝腳本拷貝到安裝目錄,執(zhí)行腳本
sh install_ubuntu.sh
執(zhí)行腳安裝本按照屏幕提示進(jìn)行操作。腳本會(huì)自動(dòng)幫你安裝git, apache, mysql, php…等一系列工具。
注意:在安裝mysql時(shí),會(huì)有幾次讓你輸入root密碼的提示。這里推薦將密碼設(shè)置為空,以方便后面的使用。
下載Phabricator以及其依賴包
$ cd somewhere/ # pick some install directory 切換到安裝目錄
somewhere/ $ git clone git://github.com/facebook/libphutil.git
somewhere/ $ git clone git://github.com/facebook/arcanist.git
somewhere/ $ git clone git://github.com/facebook/phabricator.git
WEB服務(wù)器:配置Apache
加入sverver name
(1)修改httpd.conf,這個(gè)文件在剛裝完Apache時(shí)應(yīng)該是空的。(2.4.x版本在/etc/apache2路徑下創(chuàng)建httpd.conf文件即可)
加入如下內(nèi)容: ServerName localhost
(2)保存退出。
2.驗(yàn)證Apache安裝
(1)重啟Apache服務(wù)
/etc/init.d/apache2 restart
(2)驗(yàn)證頁(yè)面
打開瀏覽器,在地址欄中輸入 localhost。看是否會(huì)出現(xiàn)“It works”的字樣,如果出現(xiàn)代表Apache運(yùn)行正常。否則,就需要去查看一下httpd.conf是否配置正確了。
更新Phabricator
由于Phabricator一直處于發(fā)展?fàn)顟B(tài),所以你應(yīng)該經(jīng)常更新它。如何更新:
- 停止webserver的運(yùn)行
- 運(yùn)行g(shù)it拉取libphutil/,arcanist/,phabricator
- 運(yùn)行phabricator/bin/storage upgrade
- 重新啟動(dòng)webserver
總結(jié)
以上就是這篇文章的全部?jī)?nèi)容了,希望本文的內(nèi)容對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,謝謝大家對(duì)腳本之家的支持。如果你想了解更多相關(guān)內(nèi)容請(qǐng)查看下面相關(guān)鏈接