hashbangcode / vlad

Vlad - Vagrant LAMP Ansible Drupal
173 stars 53 forks source link

No easy way to edit the vhost root path? #208

Closed crittermike closed 9 years ago

crittermike commented 9 years ago

For example, say I need to sync my entire repo to the VM, which looks like this:

/src
    /modules
    /themes
/build
    /html (this is the docroot - custom modules/themes are symlinks to /src)

So I'd need to sync all of that, but I need to tell Apache that the actual vhost should point to /var/www/site/docroot/build/html instead of /var/www/site/docroot, right?

Or am I misunderstanding how this should work? In other words, it seems like right now it assumes that the synced folder is the site docroot, right? Can we break that assumption?

philipnorton42 commented 9 years ago

If I'm following you correctly then probably need to use the host_synced_folder configuration option to something like the following.

host_synced_folder: "./build/html"

However, I think the symlinks might confuse matters. In which case you might be better off syncing the whole directory.

There currently isn't a setting to alter the Apache docroot directory as it's hard coded to be /var/www/site/docroot. An interim solution could be to use a custom role (see http://vlad-docs.readthedocs.org/en/latest/usage/custom_roles/) in order to alter the Apache config after the fact using a lineinfile task.

There is work planned to alter Vlad to support multiple hosts and as part of this we will be altering this area to be more configurable.

crittermike commented 9 years ago

Part of it too is that there are files outside of the docroot (in /src/build) for example, which AREN'T symlinked into /build/html but which we need in the VM, such as the build scripts which need access to the DB for running DB updates and whatnot. (Yes, can move to using aliases, but that's just a wonky workaround). So even if the symlinks did hold up when syncing, that wouldn't really solve the issue.

Anyways, no worries, thanks again for all the hard work on Vlad. I'll keep an eye out for updates to allow multiple/arbitrary vhosts.

crittermike commented 9 years ago

If I were to try and work on that, any pointers on where to start?

philipnorton42 commented 9 years ago

First place that needs altering is the Apache role, located at vlad/vlad/playbooks/roles/apache.

philipnorton42 commented 9 years ago

I'm going to close this ticket in favour of a new 'meta-ticket'. This ticket proposes a new Apache setup structure which should resolve this issue. See it here : https://github.com/hashbangcode/vlad/issues/284