【问题标题】:Create a new virtualhost with phabricator virtualhost使用 phabricator virtualhost 创建一个新的虚拟主机
【发布时间】:2016-11-25 08:19:32
【问题描述】:

我在站点中有一个可用的虚拟主机 (etc/apache2/sites-available/phabricator.conf)

Alias /phabricator/ /var/www/phabricator/phabricator/webroot/
<VirtualHost *:80>`
ServerName test.net
DocumentRoot /var/www/phabricator/phabricator/webroot
RewriteEngine on
RewriteRule ^/rsrc/(.*)     -                       [L,QSA]
RewriteRule ^/favicon.ico   -                       [L,QSA]
RewriteRule ^(.*)$          /index.php?__path__=$1  [B,L,QSA]

<Directory "/var/www/phabricator/phabricator/webroot">
  Options Indexes FollowSymLinks
  Order allow,deny
  Allow from all
</Directory>

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log comb
</VirtualHost>

当我输入 url test.net 时,我被重定向到 phabricator 页面

我想添加一个新的虚拟主机指向 playframework 应用程序站点-available/default-ssl 我认为不是一个好文件,但每个地方都是同样的问题:

<VirtualHost *:8080>
   ProxyPreserveHost On
   ServerName tets.net
   ProxyPass  /excluded !
   ProxyPass /test2 http://127.0.0.1:9000/
  ProxyPassReverse /test2 http://127.0.0.1:9000/
</VirtualHost>

但是第二个虚拟主机永远不会工作我有这个错误:无法检索请求的 URL。 在 root 上,我在所有其他 url 上到达 phabricator 没有任何工作

【问题讨论】:

    标签: apache playframework-2.0 httpd.conf phabricator


    【解决方案1】:

    使用 ProxyPass 时始终匹配斜线

    确保 127.0.0.1:9000 可访问,一旦完成,请正确定义您的 proxypass 指令,匹配源和目标中的斜杠。也就是说,如果源是目录,则目标必须是目录,如果源是文件,则目标必须是文件,目录以 / 结尾,在这种情况下,由于http://127.0.0.1:9000 是目录,因此正确生成的 proxypass 指令看起来像:

    ProxyPass /test2/ http://127.0.0.1:9000/
    ProxyPassReverse /test2/ http://127.0.0.1:9000/
    

    【讨论】:

    • 不明白你的解释,无论如何它正在使用 simpy 开始以另一种方式作为窗口(在后台)播放:“nohup activator testProd”和“activator stage”谢谢!我通过服务器访问:9000 更安全
    猜你喜欢
    • 2012-02-03
    • 2014-08-23
    • 2012-01-29
    • 2022-09-27
    • 2014-09-06
    • 2010-10-07
    • 1970-01-01
    • 1970-01-01
    • 2011-11-03
    相关资源
    最近更新 更多