Skip to content
This repository has been archived by the owner on Jan 1, 2020. It is now read-only.

Vagrantfile double quotes for Apache config should be single quotes #395

Closed
grafro opened this issue Oct 26, 2016 · 0 comments
Closed

Vagrantfile double quotes for Apache config should be single quotes #395

grafro opened this issue Oct 26, 2016 · 0 comments
Milestone

Comments

@grafro
Copy link

grafro commented Oct 26, 2016

The double quotes for the Apache config in the Vagrantfile leads to placing the log-dirs to /, which does normally not work because there are no write-permissions for Apache in /.

The Apache config in the Vagrantfile is in double quotes, so the shell will try to expand {APACHE_LOG_DIR}, but that's empty. So in my view, it would be correct to enclose the expression "<VirtualHost *:80> ... </VirtualHost>" in single quotes, so the shell does not try to expand {APACHE_LOG_DIR} like shown below:

# Configure Apache
  echo '<VirtualHost *:80>
    DocumentRoot /var/www/public
    AllowEncodedSlashes On
    <Directory /var/www/public>
        Options +Indexes +FollowSymLinks
        DirectoryIndex index.php index.html
        Order allow,deny
        Allow from all
        AllowOverride All
    </Directory>
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>' > /etc/apache2/sites-available/000-default.conf

If I'm completely wrong here please feel free to close the issue.

@weierophinney weierophinney added this to the 3.0.3 milestone Oct 31, 2017
weierophinney added a commit that referenced this issue Oct 31, 2017
Per #395, usage of double-quotes attempts to expand the string
`${APACHE_LOG_DIR}` within the vhost definition. Since that value may or
may not be set, and, if set, may not be correct for the vagrant image,
single quotes must be used to prevent expansion.

Tested and verified.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants