Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple Vhosts #24

Open
heyMP opened this issue Mar 27, 2015 · 11 comments
Open

Multiple Vhosts #24

heyMP opened this issue Mar 27, 2015 · 11 comments

Comments

@heyMP
Copy link
Contributor

heyMP commented Mar 27, 2015

How are we adding mulitple vhosts for our different websites in this vagrant box. Typically, that was something that was handled through puppet or chef correct?

@jpat14 is working on a bash script that does it. I'm just wondering if that is something that can be handled by vagrant.

Something like: config.vm.hostname: ['nittany.psudug.dev', 'itnews.psudug.dev', 'coolwebsite.psudug.dev']

@heyMP heyMP added the question label Mar 27, 2015
@btopro
Copy link
Member

btopro commented Mar 27, 2015

thus far we've been going w/ the notion that chef / puppet to do stuff like that is overkill. All it does it tokenize input and then write an associated .conf file. Nothing a simple bash script could do. Brad might have some thoughts on one vs the other. In my pre-install routine for elmsln I take a generic host file and then use sed to search and replace one thing w/ the other. Might be a lightweight way of accomplishing multiple hosts on provision since I think the values in the provisioner are able to be passed in throughout the scripts.

@btopro
Copy link
Member

btopro commented Mar 27, 2015

@heyMP
Copy link
Contributor Author

heyMP commented Mar 27, 2015

That works. So the hope is you just maintain the domains.txt and the preinstall script will pick up all of those entries?

@btopro
Copy link
Member

btopro commented Mar 27, 2015

yea like take a copy of domains.txt and flash the name of it to the other domains / subdomains you choose

@jpat14
Copy link

jpat14 commented Mar 28, 2015

This solution is somewhat unconventional, but it works. You enter the docroot and it goes in and makes the domain config as well as edits the etc/hosts file https://github.com/itpsu1/itcomm-nittany-vagrant/blob/master/runfirst.sh

@btopro
Copy link
Member

btopro commented Mar 28, 2015

not a terrible approach in theory, like I said, i'm increasingly big on simple / compact vs packaging language upgrade hell. Writing each to its own .conf file would be better and then you wouldn't be overwriting other peopl'es files. if they said psu.edu it would be easy to smash this into psuedu.conf w/ the associated domain goodness in there.

I also don't know if the host file overwriting will go into the host machine or stay on the vagrant VM; assuming vagrant VM's /etc/hosts which is important as well but would need to be more of a 127.0.0.1 written to be pointed to for calls against the associated domain. This way it would be able to handle advagg / apc "remote" cache clears, etc.

@jpat14
Copy link

jpat14 commented Mar 28, 2015

As of right now, it's editing both host files (on the host machine and the vm), with the latter outputting a similar hosts file (a textfile) pointing to 127.0.0.1, which the vagrant instance can pick up and concatenates in a script available via the wizard. It wouldn't be difficult to come up with a naming convention to programmatically give the conf files separate names.

@btopro
Copy link
Member

btopro commented Mar 30, 2015

yeah, do that then :) conf files generally should be split into multiples for maintainability anyway and lower confusion when u start dealing w/ boatloads of domains

@jpat14
Copy link

jpat14 commented Apr 9, 2015

Is this still functionality we're looking to merge into nittany-vagrant?

@btopro
Copy link
Member

btopro commented Apr 9, 2015

might be in the advanced stuff i'd think, good to get a proposal for at least

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants