Question

I used puphpet.com to quickly set up a Wheezy VM. The VM works great but I'd love the add another virtual host to Apache.

According to the puphpet documentation:

I have completely rewritten PuPHPet to take advantage of a built-in configuration tool for Puppet called Hiera. Simply look inside your downloaded folder and open puppet/hieradata/common.yaml. This is the magical file that controls everything!

However my download doesn't include the puppet/hieradata folder nor the common.yaml file.

I tried creating the above folder and files, but they aren't acknowledged when executing vagrant reload.

Was it helpful?

Solution

I need to spend a day or two to go through and update my out-of-date documentation!

The yaml file is now in puphpet/config.yaml

Search for the vhost key and copy/paste any existing one and change the key.

Then run $ vagrant provision and you'll be all set!

OTHER TIPS

You can do this in a two diffrent ways:

Edit your puphpet/config.yaml and add another vhost.

puphpet/config.yaml:

asxnyytgdo1d: (remember to change this key)
            servername: temp.krzysiek
            docroot: /var/www/temp
            port: '80'
            custom_fragment: ''
            directories:
                6ecw5mx7fg1d: (change this aswell)
                    provider: directory
                    path: /var/www/temp
                    options:
                        - Indexes
                        - FollowSymlinks
                        - MultiViews
                    allow_override:
                        - All
                    require:
                        - 'all granted'
                    custom_fragment: ''
            ssl_cert: ''
            ssl_key: ''
            ssl_chain: ''
            ssl_certs_dir: ''

OR

Go to https://puphpet.com and Drang'n'Drop your puphpet/config.yaml file, add vhost then redownload.

THEN

run vagrant reload --provision

https://docs.vagrantup.com/v2/cli/reload.html You don't modify directly Vagrantfile but Vagrantfile reads puphpet/config.yaml.

Vagrantfile:

configValues = YAML.load_file("#{dir}/puphpet/config.yaml")

After you should see changes.

That part of the documentation of PuPHPet dosent looks pretty clear. The manifest produces the following file puphpet.zip. Inside that file the first folder, wich is compose of some strange characters contains the necessary manifest files or HieraData config files:

puphpet.zip\ux2Jk1\puphpet
-- config.yaml
puphpet.zip\ux2Jk1\puphpet\puppet
-- hiera.yaml
-- manifest.pp
-- Puppetfile

I understand that HieraData refers to the collection of files previously mentioned and located inside the puppet folder on the puphpet.zip file. If you want to add another virtual host, you can do it manually by modifying the vhosts section of the config.yaml file and then tweak the vagrantfile to reflect this change. This type of change can mess-up (really bad) the configuration. So i recommend do it through the PuPHPet Web GUI. If you can't find the manifest files inside your puphpet.zip, maybe another service (like an antivirus) is swapping them, but that is just me speculating.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top