配置向导
该文档包含了Phabricator所需的最基本的配置指引。
前提
该文档假定你已经安装了所有必需的组件。如果没有,请查看安装向导。
下一步:
- 配置你的webserver(Apache,nginx或lighttpd)
- 通过浏览器访问Phabricator
- 按照指引完成设置
WEB服务器:配置Apache
运行Apache,并使用一个测试页来验证其是否正常工作。如果有问题,请查看Apache的帮助文档。确保mod_php和mod_rewrite启用,如果你设置SSL,请开启mod_ssl模块。
如果你还没有设置一个域名指向你将要安装的主机上。你可以安装Phabricator到一个二级域名(如phabricator.example.com)上或一个完整域名上,但你不能安装到一个已经存在的网站的某个子目录下。输入你将要安装到的域名以确保Apache可以为其正常服务,并且DNS已经正确配置。
现在,可以创建一个VirtualHost条目(放置Phabricator到一个二级域名上)或编辑Directory条目的DocumentRoot。将如下所示:
httpd.conf
<VirtualHost *>
# Change this to the domain which points to your host.
ServerName phabricator.example.com
# Change this to the path where you put 'phabricator' when you checked it
# out from GitHub when following the Installation Guide.
#
# Make sure you include "/webroot" at the end!
DocumentRoot /path/to/phabricator/webroot
RewriteEngine on
RewriteRule ^/rsrc/(.*) - [L,QSA]
RewriteRule ^/favicon.ico - [L,QSA]
RewriteRule ^(.*)$ /index.php?__path__=$1 [B,L,QSA]
</VirtualHost>
如果当前的Apache配置不能为你所放置的Phabricator文档目录服务,你需要添加如下的部分到httpd.conf中
<Directory "/path/to/phabricator/webroot">
Order allow,deny
Allow from all
</Directory>
更改后,重启Apache,然后跳转到下面的设置步骤。
WEB服务器:配置nginx
For nginx, use a configuration like this:
nginx.conf
server {
server_name phabricator.example.com;
root /path/to/phabricator/webroot;
try_files $uri $uri/ /index.php;
location / {
index index.php;
if ( !-f $request_filename )
{
rewrite ^/(.*)$ /index.php?__path__=/$1 last;
break;
}
}
location /index.php {
fastcgi_pass localhost:9000;
fastcgi_index index.php;
#required if PHP was built with --enable-force-cgi-redirect
fastcgi_param REDIRECT_STATUS 200;
#variables to make the $_SERVER populate in PHP
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
fastcgi_param REMOTE_ADDR $remote_addr;
}
}
Restart nginx after making your edits, then continue to "Setup" below.
WEB服务器:配置lighttpd
For lighttpd, add a section like this to your lighttpd.conf:
$HTTP["host"] =~ "phabricator(\.example\.com)?" {
server.document-root = "/path/to/phabricator/webroot"
url.rewrite-once = (
"^(/rsrc/.*)$" => "$1",
"^(/favicon.ico)$" => "$1",
# This simulates QSA ("query string append") mode in apache
"^(/[^?]*)\?(.*)" => "/index.php?__path__=$1&$2",
"^(/.*)$" => "/index.php?__path__=$1",
)
}
You should also ensure the following modules are listed in your server.modules list:
mod_fastcgi mod_rewrite
Finally, you should run the following commands to enable php support:
$ sudo apt-get install php5-cgi # for ubuntu; other distros should be similar
$ sudo lighty-enable-mod fastcgi-php
Restart lighttpd after making your edits, then continue below.
设置
现在,输入你设置的域名。你将会看到设置指引。文档的余下部分为其他具体设置步骤的附加说明。
存储:配置MySQL
设置中,你需要配置MySQL。运行MySQL,验证是否能正常连接。如果有问题,请参考MySQL的帮助文档。如果MySQL正常工作,你需要加载Phabricator的模式,运行命令:
phabricator/ $ ./bin/storage upgrade
如果你配置了一个无特权的用户以连接数据库,你将不得不重新设置为root用户或其他的管理员以使模式能被应用。
phabricator/ $ ./bin/storage upgrade --user <user> --password <password>
You can avoid the prompt the script issues by passing the --force flag (for example, if you are scripting the upgrade process).
phabricator/ $ ./bin/storage upgrade --force
下一步
继续:
- 设置你的管理帐号和登陆/注册,请参见 Configuring Accounts and Registration; 或
- 了解更高级的配置主题,请参见 Configuration User Guide: Advanced Configuration; 或
- 配置上传的文件和附件的存储位置,请参见 Configuring File Storage; 或
- 配置Phabricator以支持发送邮件,请参见 Configuring Outbound Email; 或
- 配置Phabricator以支持接收邮件,请参见 Configuring Inbound Email; 或
- 导入版本仓库,请参见 Diffusion User Guide; 或
- 了解守护进程工作,请参见 Managing Daemons with phd; 或
- 配置备份工作,请参见 Configuring Backups; 或
- 为Phabricator贡献力量,请参见Contributor Introduction.
来源:oschina
链接:https://my.oschina.net/u/813761/blog/127071