Page MenuHomePhabricator

Make it easier to access Vagrant from another VM
Closed, ResolvedPublic

Description

The main use case for this would be browser testing, e.g. with the modern.ie VMs.

This is my current method: in the IE VM add

10.0.2.2 whatever

to the host file; in the vagrant VM set

$wgServer = "http://whatever:8080";

in LocalSettings.php, and you can access the MediaWiki installation from the IE VM via http://whatever:8080.

Obviously this would be a lot easier if I didn't have to edit $wgServer every time I want to switch browsers; could we just add something like

if ( isset( $_SERVER['SERVER_NAME'] ) ) {

$wgServer = 'http://' . $_SERVER['SERVER_NAME'] . ':8080';

} else {

$wgServer = "http://127.0.0.1:8080";

}

to the default mw-vagrant LocalSettings file?
(Making the port configurable in the vagrantfile would be even better, for people who run multiple vagrants, but that's another issue.)


Version: unspecified
Severity: enhancement

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 3:13 AM
bzimport set Reference to bz66399.

This also blocks the use of vagrant share to share a local wiki with a remote colleague using Vagrant Cloud https://vagrantcloud.com/.

Change 154941 had a related patch set uploaded by BryanDavis:
Set $wgServer from inbound request

https://gerrit.wikimedia.org/r/154941

Change 154941 merged by jenkins-bot:
Set $wgServer from inbound request

https://gerrit.wikimedia.org/r/154941

Change 286952 had a related patch set uploaded (by BryanDavis):
Always set $wgServer from inbound request

https://gerrit.wikimedia.org/r/286952

Change 286952 merged by jenkins-bot:
Always set $wgServer from inbound request

https://gerrit.wikimedia.org/r/286952