WebPagetest Forums
installing below doc root - Printable Version

+- WebPagetest Forums (https://www.webpagetest.org/forums)
+-- Forum: WebPagetest (/forumdisplay.php?fid=7)
+--- Forum: Private Instances (/forumdisplay.php?fid=12)
+--- Thread: installing below doc root (/showthread.php?tid=11142)

installing below doc root - bhopps - 05-18-2012 05:52 AM

is there a way to modify the settings to use a subdirectory of document root? ie if my doc root is /var/www and i have webpagetest in /var/www/webpagetest what file(s) would i have to modify?

RE: installing below doc root - pmeenan - 05-19-2012 01:08 AM

No, right now there are too many paths in the code that are absolute so it isn't possible. It's been on my list to look at for a while but it hasn't happened yet.

RE: installing below doc root - braincracking - 07-30-2012 07:46 PM


I also wanted to install WPT in a sub-directory and spent many hours to modify the source code. It mostly works for the pages I'm used to see, but I think a 2nd view could find 404

Features :
- the sub-directory is configured via settings.ini
- default to empty string
- should not conflict with $GLOBALS['cdnPath']
- probably 90% of all the urls are now prefixed with $GLOBALS['basePath']

Missing / Dangers :
- tested only the pages I need to see, but that should cover most of the
- Works For Me© : tested on 2 different servers for now, but never tested anywhere else
- CSS are not dynamic so the sub-directory is hardcoded. I did not took the time to re-generate them via PHP, but that's what should be done
- tried to have all rewrite rules to be relative instead of absolute
eg: RewriteRule ^result/([a-zA-Z0-9_]+)$ ./result/$1/ [R]
It mostly worked but at the end I finally had to turn off HTTP_MOD_REWRITE to have all work fine
- should probably better use a makeURL() function rather than just prefixing strings

So, the time-consuming code is made, but lacks more testings on other environments
Do you want to try to merge this version with the HEAD ? How do you want me to provide the code ?

RE: installing below doc root - pmeenan - 08-01-2012 04:43 AM

If you can send me a patch/diff against the HEAD I can look it over, merge the changes in and see if I can track down any cases where it isn't handled.

Sorry it's scattered all over the place, it sort of grew over 5 years and hasn't been refactored since.

RE: installing below doc root - braincracking - 08-01-2012 07:23 PM

The fact this project exists is good enough Smile

please find attached the .patch file ( diff -wupr )
The file was renamed as .txt to pass the forum submit form

RE: installing below doc root - pmeenan - 08-03-2012 12:57 AM

Awesome, thanks. I'll go through it and merge. It will probably be a few days before I get to it bu much appreciated. I may see if I can refactor them all to use a central function while I'm in there.

RE: installing below doc root - jlong - 12-19-2012 05:42 AM

Is there any update on running webpage test under a subdirectory?

RE: installing below doc root - pmeenan - 12-19-2012 06:48 AM

Umm, the update is that I haven't done any work on it yet but hopefully in the next quarter or so I will be able to tackle it. It's mostly just grunt work going through all of the code and changing any absolute URLs.