|
4 | 4 | VAGRANTFILE_API_VERSION = '2'
|
5 | 5 |
|
6 | 6 | @script = <<SCRIPT
|
| 7 | +# Fix for https://bugs.launchpad.net/ubuntu/+source/livecd-rootfs/+bug/1561250 |
| 8 | +if ! grep -q "ubuntu-xenial" /etc/hosts; then |
| 9 | + echo "127.0.0.1 ubuntu-xenial" >> /etc/hosts |
| 10 | +fi |
| 11 | +
|
| 12 | +# Install dependencies |
7 | 13 | add-apt-repository ppa:ondrej/php
|
8 | 14 | apt-get update
|
9 | 15 | apt-get install -y apache2 git curl php7.0 php7.0-bcmath php7.0-bz2 php7.0-cli php7.0-curl php7.0-intl php7.0-json php7.0-mbstring php7.0-opcache php7.0-soap php7.0-sqlite3 php7.0-xml php7.0-xsl php7.0-zip libapache2-mod-php7.0
|
10 |
| -sed -i 's!/var/www/html!/var/www/public!g' /etc/apache2/sites-available/000-default.conf |
11 | 16 |
|
12 |
| -echo "<Directory /var/www/public> |
13 |
| - Options +Indexes +FollowSymLinks |
14 |
| - DirectoryIndex index.php index.html |
15 |
| - Order allow,deny |
16 |
| - Allow from all |
17 |
| - AllowOverride All |
18 |
| -</Directory>" > /etc/apache2/conf-enabled/htaccess.conf |
| 17 | +# Configure Apache |
| 18 | +echo "<VirtualHost *:80> |
| 19 | + DocumentRoot /var/www/public |
| 20 | + AllowEncodedSlashes On |
19 | 21 |
|
| 22 | + <Directory /var/www/public> |
| 23 | + Options +Indexes +FollowSymLinks |
| 24 | + DirectoryIndex index.php index.html |
| 25 | + Order allow,deny |
| 26 | + Allow from all |
| 27 | + AllowOverride All |
| 28 | + </Directory> |
| 29 | +
|
| 30 | + ErrorLog ${APACHE_LOG_DIR}/error.log |
| 31 | + CustomLog ${APACHE_LOG_DIR}/access.log combined |
| 32 | +</VirtualHost>" > /etc/apache2/sites-available/000-default.conf |
20 | 33 | a2enmod rewrite
|
21 | 34 | service apache2 restart
|
22 |
| -curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer |
23 |
| -if ! grep "cd /var/www" /home/ubuntu/.profile > /dev/null; then |
| 35 | +
|
| 36 | +if [ -e /usr/local/bin/composer ]; then |
| 37 | + /usr/local/bin/composer self-update |
| 38 | +else |
| 39 | + curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer |
| 40 | +fi |
| 41 | +
|
| 42 | +# Reset home directory of vagrant user |
| 43 | +if ! grep -q "cd /var/www" /home/ubuntu/.profile; then |
24 | 44 | echo "cd /var/www" >> /home/ubuntu/.profile
|
25 | 45 | fi
|
| 46 | +
|
26 | 47 | echo "** [ZF] Run the following command to install dependencies, if you have not already:"
|
27 | 48 | echo " vagrant ssh -c 'composer install'"
|
28 | 49 | echo "** [ZF] Visit http://localhost:8080 in your browser for to view the application **"
|
|
0 commit comments