dongtu1789 2017-01-17 12:46
浏览 50

动态更改Apache的文档根目录 - 简单的A / B测试解决方案

I want to implement simplest possible split testing (A/B). Currently I have something like this

/public_web
  index.php    # this selects random version and redirects with all GET params 
    /A
      /vendor
      /web/
        /index.php
    /B
      /web/
        /index.php
    /C
      /web/
        /index.php

I want to be able to just copy a directory with all files to create another version for testing.

Currently it's working fine with few exception - the URLs and security.

The document root normally would be /A/web so public url is i.e. www.site.com, but in order to run split tests like I want to, I need to put document root to /public/web so the url of the site is actually www.site.com/A/web ( and /B/web and C/web etc )

So I'm looking for a way to change Apache's document root ( or it can be nginx ) dynamically. Is that possible? Can I write simple script to make choices which folder should be document root for each session?

I have a gut feel that it's not possible because it would need to keep session, but maybe some sort of load balancer software that keeps session can do it?

The A/B script is ultra simple select random version from list of available directories and use it as document root.

I know that there are other ways of running split testing, but I'm just interested if it's possible do it like stated above.

Many thanks

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 Oracle中如何从clob类型截取特定字符串后面的字符
    • ¥15 想通过pywinauto自动电机应用程序按钮,但是找不到应用程序按钮信息
    • ¥15 MATLAB中streamslice问题
    • ¥15 如何在炒股软件中,爬到我想看的日k线
    • ¥15 51单片机中C语言怎么做到下面类似的功能的函数(相关搜索:c语言)
    • ¥15 seatunnel 怎么配置Elasticsearch
    • ¥15 PSCAD安装问题 ERROR: Visual Studio 2013, 2015, 2017 or 2019 is not found in the system.
    • ¥15 (标签-MATLAB|关键词-多址)
    • ¥15 关于#MATLAB#的问题,如何解决?(相关搜索:信噪比,系统容量)
    • ¥500 52810做蓝牙接受端