Page MenuHomePhabricator

Ability to map additional dirs & apache vhosts
Closed, ResolvedPublic

Description

Please add an ability to easily (per .settings.yaml) map additional host dirs to remote. For example:

synced_folders:
  '/vagrant/mystuff': '/host/dir/mystuff'  # guest-dir: host-dir

Additionally, some of these dirs or their subdirs should be mappable as vhosts in apache with default lenient permissions to allow quick testing of minor php/js code without adding junk to the local mediawiki git repo:

apache_folders:
  'mystuff': '/vagrant/mystuff/www'  # vhost: guest-dir

Version: unspecified
Severity: enhancement

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:37 AM
bzimport set Reference to bz67572.
bzimport added a subscriber: Unknown Object (MLST).

Bulk unassigning bugs from Ori.

bd808 triaged this task as Lowest priority.Dec 2 2014, 2:05 AM

This can be fairly easily accomplished with customizations via a local Vagrantfile-extra.rb and possibly a custom role if a vhost needs to be created.

Wouldn't that require knowing all the complexities of dir mappings, etc? Could you give an example of the code for the vagrantfile-extra.rb?

Change 176943 had a related patch set uploaded (by BryanDavis):
Add example of mounting a local directory under web root

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

Patch-For-Review

Change 176943 merged by jenkins-bot:
Add example of mounting a local directory under web root

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

Wouldn't that require knowing all the complexities of dir mappings, etc? Could you give an example of the code for the vagrantfile-extra.rb?

Vagrant.configure('2') do |config|
  config.vm.synced_folder '../extra', '/var/www/extra'
end

I have added this example to the support/Vagrantfile-extra.rb example file that ships with MW-V in https://gerrit.wikimedia.org/r/#/c/176943/

does it mean that the ../extra dir will be available as localhost:8080/extra ?

does it mean that the ../extra dir will be available as localhost:8080/extra ?

Yes. I put some additional comments in the example file that explain this a bit more. The choice to mount at /var/www/extra was based on a prior knowledge of the default vhost setup for the VM's apache server.

I covered this very topic in the recent tech talk on MW-V. I've got an open task (T76493) to get the slides and video of that talk uploaded to commons so more people can find it.

Yurik claimed this task.

Thanks!