配置向导 http://www.e-learn.cn/tag/peizhixiangdao zh-hans Phabricator配置向导 http://www.e-learn.cn/topic/363347 <span>Phabricator配置向导</span> <span><span lang="" about="/user/189" typeof="schema:Person" property="schema:name" datatype="">怎甘沉沦</span></span> <span>2019-11-27 18:26:17</span> <div class="field field--name-body field--type-text-with-summary field--label-hidden field--item"> <span id="OSC_h1_1"></span> <h1> <span style="font-size:1.5em;">配置向导</span> </h1> <div> <p> 该文档包含了<span style="line-height:1.428571em;">Phabricator所需的最基本的配置指引。</span> </p> <span id="OSC_h2_2"></span> <h2> 前提 </h2> <p> 该文档假定你已经安装了所有必需的组件。如果没有,请查看安装向导。 </p> <p> 下一步: </p> <ul><li> 配置你的webserver(Apache,nginx或lighttpd) </li> <li> 通过浏览器访问Phabricator </li> <li> 按照指引完成设置 </li> </ul><span id="OSC_h2_3"></span> <h2> WEB服务器:配置Apache </h2> <div> 注意:下面是Apache配置指引。如果使用nginx或lighttpd,请滑动到其相应部分。 </div> <p> 运行Apache,并使用一个测试页来验证其是否正常工作。如果有问题,请查看Apache的帮助文档。确保mod_php和mod_rewrite启用,如果你设置SSL,请开启mod_ssl模块。 </p> <p> 如果你还没有设置一个域名指向你将要安装的主机上。你可以安装Phabricator到一个二级域名(如phabricator.example.com)上或一个完整域名上,但你不能安装到一个已经存在的网站的某个子目录下。输入你将要安装到的域名以确保Apache可以为其正常服务,并且DNS已经正确配置。 </p> <div> <span></span>注意:域名必须包含点(.),而不只是一个名称,如http://example/。否则,一些web浏览器将无法设置cookies。 </div> <p> 现在,可以创建一个VirtualHost条目(放置Phabricator到一个二级域名上)或编辑Directory条目的DocumentRoot。将如下所示: </p> <p> <br /></p> <p> httpd.conf </p> <p> </p> <pre class="brush:scala; toolbar: true; auto-links: false;"><code>&lt;VirtualHost *&gt; # 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] &lt;/VirtualHost&gt;</code></pre> <p></p> <p> 如果当前的Apache配置不能为你所放置的Phabricator文档目录服务,你需要添加如下的部分到httpd.conf中 </p> <p> </p> <pre class="brush:scala; toolbar: true; auto-links: false;"><code>&lt;Directory "/path/to/phabricator/webroot"&gt; Order allow,deny Allow from all &lt;/Directory&gt;</code></pre> <p></p> <p> 更改后,重启Apache,然后跳转到下面的设置步骤。 </p> <span id="OSC_h2_4"></span> <h2> <span></span>WEB服务器:配置nginx </h2> <div> NOTE: Follow these instructions to use nginx. To use Apache or lighttpd, scroll to their sections. </div> <p> For nginx, use a configuration like this: </p> <p> <span></span> </p> <p> nginx.conf </p> <p> </p> <pre class="brush:perl; toolbar: true; auto-links: false;"><code>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; } }</code></pre> <p></p> <span></span> <p> <br /></p> <p> Restart nginx after making your edits, then continue to "Setup" below. </p> <span id="OSC_h2_5"></span> <h2> WEB服务器:配置lighttpd </h2> <div> NOTE: Follow these instructions to use lighttpd. To use Apache or niginx, scroll up to their sections. </div> <p> For lighttpd, add a section like this to your lighttpd.conf: </p> <p> </p> <pre class="brush:php; toolbar: true; auto-links: false;"><code>$HTTP["host"] =~ "phabricator(\.example\.com)?" { server.document-root = "/path/to/phabricator/webroot" url.rewrite-once = ( "^(/rsrc/.*)$" =&gt; "$1", "^(/favicon.ico)$" =&gt; "$1", # This simulates QSA ("query string append") mode in apache "^(/[^?]*)\?(.*)" =&gt; "/index.php?__path__=$1&amp;$2", "^(/.*)$" =&gt; "/index.php?__path__=$1", ) }</code></pre> <p></p> <p> You should also ensure the following modules are listed in your server.modules list: </p> <div> <pre><code><span style="line-height:1.428571em;">mod_fastcgi</span> <span style="line-height:1.428571em;">mod_rewrite</span></code></pre> </div> <p> Finally, you should run the following commands to enable php support: </p> <p> </p> <pre class="brush:shell; toolbar: true; auto-links: false;"><code>$ sudo apt-get install php5-cgi # for ubuntu; other distros should be similar $ sudo lighty-enable-mod fastcgi-php</code></pre> <p></p> <p> <span></span>Restart lighttpd after making your edits, then continue below. </p> <span id="OSC_h2_6"></span> <h2> 设置 </h2> <p> 现在,输入你设置的域名。你将会看到设置指引。文档的余下部分为其他具体设置步骤的附加说明。 </p> <span id="OSC_h2_7"></span> <h2> 存储:配置MySQL </h2> <p> 设置中,你需要配置MySQL。运行MySQL,验证是否能正常连接。如果有问题,请参考MySQL的帮助文档。如果MySQL正常工作,你需要加载Phabricator的模式,运行命令: </p> <div> <pre><code>phabricator/ <span style="line-height:1.428571em;">$ ./bin/storage upgrade</span></code></pre> </div> <p> 如果你配置了一个无特权的用户以连接数据库,你将不得不重新设置为root用户或其他的管理员以使模式能被应用。 </p> <p>   </p> <div> <pre><code>phabricator/ <span style="line-height:1.428571em;">$ ./bin/storage upgrade --user &lt;user&gt; --password &lt;password&gt;</span></code></pre> </div> <p> You can avoid the prompt the script issues by passing the --force flag (for example, if you are scripting the upgrade process). </p> <div> <pre><code>phabricator/ <span style="line-height:1.428571em;">$ ./bin/storage upgrade --force</span></code></pre> </div> <div> NOTE: When you update Phabricator, run storage upgrade again to apply any new updates. </div> <span id="OSC_h2_8"></span> <h2> 下一步 </h2> <p> 继续: </p> <ul><li> <span style="line-height:1.428571em;">设置你的管理帐号和登陆/注册,请参见 </span><a href="http://www.phabricator.com/docs/phabricator/article/Configuring_Accounts_and_Registration.html" target="_blank" rel="nofollow">Configuring Accounts and Registration</a><span style="line-height:1.428571em;">; 或</span> </li> <li> <span style="line-height:1.428571em;">了解更高级的配置主题,请参见 </span><a href="http://www.phabricator.com/docs/phabricator/article/Configuration_User_Guide_Advanced_Configuration.html" target="_blank" rel="nofollow">Configuration User Guide: Advanced Configuration</a><span style="line-height:1.428571em;">; 或</span> </li> <li> <span style="line-height:1.428571em;">配置上传的文件和附件的存储位置,请参见 </span><a href="http://www.phabricator.com/docs/phabricator/article/Configuring_File_Storage.html" target="_blank" rel="nofollow">Configuring File Storage</a><span style="line-height:1.428571em;">; 或</span> </li> <li> <span style="line-height:1.428571em;">配置Phabricator以支持发送邮件,请参见 </span><a href="http://www.phabricator.com/docs/phabricator/article/Configuring_Outbound_Email.html" target="_blank" rel="nofollow">Configuring Outbound Email</a><span style="line-height:1.428571em;">; 或</span> </li> <li> <span style="line-height:1.428571em;">配置Phabricator以支持接收邮件,请参见 </span><a href="http://www.phabricator.com/docs/phabricator/article/Configuring_Inbound_Email.html" target="_blank" rel="nofollow">Configuring Inbound Email</a><span style="line-height:1.428571em;">; 或</span> </li> <li> <span style="line-height:1.428571em;">导入版本仓库,请参见 </span><a href="http://www.phabricator.com/docs/phabricator/article/Diffusion_User_Guide.html" target="_blank" rel="nofollow">Diffusion User Guide</a><span style="line-height:1.428571em;">; 或</span> </li> <li> <span style="line-height:1.428571em;">了解守护进程工作,请参见 </span><a href="http://www.phabricator.com/docs/phabricator/article/Managing_Daemons_with_phd.html" target="_blank" rel="nofollow">Managing Daemons with phd</a><span style="line-height:1.428571em;">; 或</span> </li> <li> <span style="line-height:1.428571em;">配置备份工作,请参见 </span><a href="http://www.phabricator.com/docs/phabricator/article/Configuring_Backups.html" target="_blank" rel="nofollow">Configuring Backups</a><span style="line-height:1.428571em;">; 或</span> </li> <li> 为Phabricator贡献力量,请参见<a href="http://www.phabricator.com/docs/phabricator/article/Contributor_Introduction.html" target="_blank" rel="nofollow">Contributor Introduction</a><span style="line-height:1.428571em;">.</span> </li> </ul></div> <div class="alert alert-success" role="alert"><p>来源:<code>oschina</code></p><p>链接:<code>https://my.oschina.net/u/813761/blog/127071</code></p></div></div> <div class="field field--name-field-tags field--type-entity-reference field--label-above"> <div class="field--label">标签</div> <div class="field--items"> <div class="field--item"><a href="/tag/phabricator" hreflang="zh-hans">Phabricator</a></div> <div class="field--item"><a href="/tag/facebook" hreflang="zh-hans">facebook</a></div> <div class="field--item"><a href="/tag/gongju" hreflang="zh-hans">工具</a></div> <div class="field--item"><a href="/tag/daimashencha" hreflang="zh-hans">代码审查</a></div> <div class="field--item"><a href="/tag/peizhixiangdao" hreflang="zh-hans">配置向导</a></div> </div> </div> Wed, 27 Nov 2019 10:26:17 +0000 怎甘沉沦 363347 at http://www.e-learn.cn