├── .gitignore ├── LICENSE.txt ├── Vagrantfile ├── bin ├── link-to-bento.ps1 └── link-to-bento.sh ├── http ├── preseed-hyperv.cfg └── preseed.cfg ├── readme.md └── scripts ├── amd64.sh └── arm.sh /.gitignore: -------------------------------------------------------------------------------- 1 | .vagrant 2 | *.box 3 | *.log 4 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /Vagrantfile: -------------------------------------------------------------------------------- 1 | # -*- mode: ruby -*- 2 | # vi: set ft=ruby : 3 | 4 | 5 | Vagrant.configure("2") do |config| 6 | config.vm.box = "bento/ubuntu-22.04" 7 | config.vm.provider "parallels" do |v| 8 | v.memory = 4096 9 | v.cpus = 4 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /bin/link-to-bento.ps1: -------------------------------------------------------------------------------- 1 | # https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-7 2 | # Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser 3 | 4 | New-Item -Path ..\bento\packer_templates\ubuntu\scripts\homestead.sh -ItemType SymbolicLink -Value .\scripts\amd64.sh -Force 5 | New-Item -Path ..\bento\packer_templates\ubuntu\scripts\homestead-arm.sh -ItemType SymbolicLink -Value .\scripts\arm.sh -Force 6 | New-Item -Path ..\bento\packer_templates\ubuntu\http\preseed.cfg -ItemType SymbolicLink -Value .\http\preseed.cfg -Force 7 | New-Item -Path ..\bento\packer_templates\ubuntu\http\preseed-hyperv.cfg -ItemType SymbolicLink -Value .\http\preseed-hyperv.cfg -Force 8 | 9 | # AMD64 10 | ((Get-Content -path ..\bento\packer_templates\ubuntu\ubuntu-20.04-amd64.json -Raw) -replace 'scripts/cleanup.sh', 'scripts/homestead.sh') | Set-Content -NoNewline -Path ..\bento\packer_templates\ubuntu\ubuntu-20.04-amd64.json 11 | ((Get-Content -path ..\bento\packer_templates\ubuntu\ubuntu-20.04-amd64.json -Raw) -replace '"memory": "1024"', '"memory": "2084"') | Set-Content -NoNewline -Path ..\bento\packer_templates\ubuntu\ubuntu-20.04-amd64.json 12 | ((Get-Content -path ..\bento\packer_templates\ubuntu\ubuntu-20.04-amd64.json -Raw) -replace '"disk_size": "65536"', '"disk_size": "131072"') | Set-Content -NoNewline -Path ..\bento\packer_templates\ubuntu\ubuntu-20.04-amd64.json 13 | ((Get-Content -path ..\bento\packer_templates\ubuntu\ubuntu-20.04-amd64.json -Raw) -replace '"boot_wait": "5s"', '"boot_wait": "3s"') | Set-Content -NoNewline -Path ..\bento\packer_templates\ubuntu\ubuntu-20.04-amd64.json 14 | ((Get-Content -path ..\bento\packer_templates\ubuntu\ubuntu-20.04-amd64.json -Raw) -replace '"type": "hyperv-iso",', '"type": "hyperv-iso","configuration_version": "9.0",') | Set-Content -NoNewline -Path ..\bento\packer_templates\ubuntu\ubuntu-20.04-amd64.json 15 | 16 | # ARM64 17 | ((Get-Content -path ..\bento\packer_templates\ubuntu\ubuntu-20.04-arm64.json -Raw) -replace 'scripts/cleanup.sh', 'scripts/homestead-arm.sh') | Set-Content -NoNewline -Path ..\bento\packer_templates\ubuntu\ubuntu-20.04-arm64.json 18 | ((Get-Content -path ..\bento\packer_templates\ubuntu\ubuntu-20.04-arm64.json -Raw) -replace '"memory": "1024"', '"memory": "2084"') | Set-Content -NoNewline -Path ..\bento\packer_templates\ubuntu\ubuntu-20.04-arm64.json 19 | ((Get-Content -path ..\bento\packer_templates\ubuntu\ubuntu-20.04-arm64.json -Raw) -replace '"disk_size": "65536"', '"disk_size": "131072"') | Set-Content -NoNewline -Path ..\bento\packer_templates\ubuntu\ubuntu-20.04-arm64.json 20 | ((Get-Content -path ..\bento\packer_templates\ubuntu\ubuntu-20.04-arm64.json -Raw) -replace '"boot_wait": "5s"', '"boot_wait": "3s"') | Set-Content -NoNewline -Path ..\bento\packer_templates\ubuntu\ubuntu-20.04-arm64.json 21 | ((Get-Content -path ..\bento\packer_templates\ubuntu\ubuntu-20.04-arm64.json -Raw) -replace '"type": "hyperv-iso",', '"type": "hyperv-iso","configuration_version": "9.0",') | Set-Content -NoNewline -Path ..\bento\packer_templates\ubuntu\ubuntu-20.04-arm64.json 22 | -------------------------------------------------------------------------------- /bin/link-to-bento.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | /bin/ln -f scripts/amd64.sh ../bento/packer_templates/scripts/ubuntu/homestead_amd64.sh 4 | /bin/ln -f scripts/arm.sh ../bento/packer_templates/scripts/ubuntu/homestead_arm.sh 5 | 6 | echo " " > ../bento/packer_templates/scripts/_common/motd.sh 7 | sed -i 's/${var.os_name}\/cleanup_${var.os_name}.sh/ubuntu\/homestead_amd64.sh/' ../bento/packer_templates/pkr-builder.pkr.hcl 8 | # Set disk_size 9 | sed -i 's/65536/524288/' ../bento/packer_templates/pkr-variables.pkr.hcl 10 | 11 | 12 | 13 | #sed -i 's/scripts\/cleanup.sh/scripts\/homestead.sh/' ../packer_templates/pkr-builder.pkr.hcl 14 | #sed -i 's/"cpus": "1"/"cpus": "2"/' ../bento/packer_templates/ubuntu/ubuntu-20.04-amd64.json 15 | #sed -i 's/"boot_wait": "5s"/"boot_wait": "3s"/' ../bento/packer_templates/ubuntu/ubuntu-20.04-amd64.json 16 | #sed -i 's/"memory": "1024"/"memory": "2048"/' ../bento/packer_templates/ubuntu/ubuntu-20.04-amd64.json 17 | #sed -i 's/"disk_size": "65536"/"disk_size": "524288"/' ../bento/packer_templates/ubuntu/ubuntu-20.04-amd64.json 18 | #sed -i '/\/_common\/motd.sh/d' ../bento/packer_templates/ubuntu/ubuntu-20.04-amd64.json 19 | 20 | ## Run for ARM 21 | #sed -i 's/scripts\/cleanup.sh/scripts\/homestead-arm.sh/' ../bento/packer_templates/ubuntu/ubuntu-20.04-arm64.json 22 | #sed -i 's/"boot_wait": "5s"/"boot_wait": "3s"/' ../bento/packer_templates/ubuntu/ubuntu-20.04-arm64.json 23 | #sed -i 's/"memory": "1024"/"memory": "2048"/' ../bento/packer_templates/ubuntu/ubuntu-20.04-arm64.json 24 | #sed -i 's/"disk_size": "65536"/"disk_size": "524288"/' ../bento/packer_templates/ubuntu/ubuntu-20.04-arm64.json 25 | #sed -i '/\/_common\/motd.sh/d' ../bento/packer_templates/ubuntu/ubuntu-20.04-arm64.json 26 | -------------------------------------------------------------------------------- /http/preseed-hyperv.cfg: -------------------------------------------------------------------------------- 1 | choose-mirror-bin mirror/http/proxy string 2 | d-i base-installer/kernel/override-image string linux-server 3 | d-i clock-setup/utc boolean true 4 | d-i clock-setup/utc-auto boolean true 5 | d-i finish-install/reboot_in_progress note 6 | d-i grub-installer/only_debian boolean true 7 | d-i grub-installer/with_other_os boolean true 8 | d-i grub-installer/no_nvram boolean true 9 | d-i mirror/country string manual 10 | d-i mirror/http/directory string /ubuntu/ 11 | d-i mirror/http/hostname string archive.ubuntu.com 12 | d-i mirror/http/proxy string 13 | d-i partman-auto-lvm/new_vg_name string homestead-vg 14 | d-i partman-auto-lvm/guided_size string 60GB 15 | d-i partman-auto/choose_recipe select atomic 16 | d-i partman-auto/method string lvm 17 | d-i partman-lvm/confirm boolean true 18 | d-i partman-lvm/confirm boolean true 19 | d-i partman-lvm/confirm_nooverwrite boolean true 20 | d-i partman-lvm/device_remove_lvm boolean true 21 | d-i partman/choose_partition select finish 22 | d-i partman/confirm boolean true 23 | d-i partman/confirm_nooverwrite boolean true 24 | d-i partman/confirm_write_new_label boolean true 25 | d-i partman-partitioning/no_bootable_gpt_biosgrub boolean false 26 | d-i partman-partitioning/no_bootable_gpt_efi boolean false 27 | d-i partman-efi/non_efi_system boolean true 28 | d-i passwd/user-fullname string vagrant 29 | d-i passwd/user-uid string 1000 30 | d-i passwd/user-password password vagrant 31 | d-i passwd/user-password-again password vagrant 32 | d-i passwd/username string vagrant 33 | d-i pkgsel/include string openssh-server ntp linux-tools-$(uname -r) linux-cloud-tools-$(uname -r) linux-cloud-tools-common cifs-utils software-properties-common ifupdown 34 | d-i pkgsel/install-language-support boolean false 35 | d-i pkgsel/update-policy select none 36 | d-i pkgsel/upgrade select full-upgrade 37 | d-i time/zone string UTC 38 | d-i user-setup/allow-password-weak boolean true 39 | d-i user-setup/encrypt-home boolean false 40 | tasksel tasksel/first multiselect standard, server 41 | 42 | -------------------------------------------------------------------------------- /http/preseed.cfg: -------------------------------------------------------------------------------- 1 | choose-mirror-bin mirror/http/proxy string 2 | d-i base-installer/kernel/override-image string linux-server 3 | d-i clock-setup/utc boolean true 4 | d-i clock-setup/utc-auto boolean true 5 | d-i finish-install/reboot_in_progress note 6 | d-i grub-installer/only_debian boolean true 7 | d-i grub-installer/with_other_os boolean true 8 | d-i mirror/country string manual 9 | d-i mirror/http/directory string /ubuntu/ 10 | d-i mirror/http/hostname string archive.ubuntu.com 11 | d-i mirror/http/proxy string 12 | d-i partman-auto-lvm/new_vg_name string homestead-vg 13 | d-i partman-auto-lvm/guided_size string 60GB 14 | d-i partman-auto/choose_recipe select atomic 15 | d-i partman-auto/method string lvm 16 | d-i partman-lvm/confirm boolean true 17 | d-i partman-lvm/confirm boolean true 18 | d-i partman-lvm/confirm_nooverwrite boolean true 19 | d-i partman-lvm/device_remove_lvm boolean true 20 | d-i partman/choose_partition select finish 21 | d-i partman/confirm boolean true 22 | d-i partman/confirm_nooverwrite boolean true 23 | d-i partman/confirm_write_new_label boolean true 24 | d-i passwd/user-fullname string vagrant 25 | d-i passwd/user-uid string 1000 26 | d-i passwd/user-password password vagrant 27 | d-i passwd/user-password-again password vagrant 28 | d-i passwd/username string vagrant 29 | d-i pkgsel/include string openssh-server cryptsetup build-essential libssl-dev libreadline-dev zlib1g-dev linux-source dkms nfs-common linux-headers-$(uname -r) perl cifs-utils software-properties-common rsync ifupdown 30 | d-i pkgsel/install-language-support boolean false 31 | d-i pkgsel/update-policy select none 32 | d-i pkgsel/upgrade select full-upgrade 33 | d-i time/zone string UTC 34 | d-i user-setup/allow-password-weak boolean true 35 | d-i user-setup/encrypt-home boolean false 36 | tasksel tasksel/first multiselect standard, server 37 | 38 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # Laravel Settler 2 | 3 | The scripts that build the Laravel Homestead development environment. 4 | 5 | End result can be found at https://app.vagrantup.com/laravel/boxes/homestead 6 | 7 | ## Usage 8 | 9 | You probably don't want this repo, follow instructions at https://laravel.com/docs/homestead instead. 10 | 11 | If you know what you are doing: 12 | 13 | * Clone [chef/bento](https://github.com/chef/bento) into same top level folder as this repo. 14 | * Run `./bin/link-to-bento.sh` 15 | * Run `cd ../bento` and work there for the remainder. 16 | * Follow normal [Packer](https://github.com/chef/bento?tab=readme-ov-file#using-packer) practice of building `ubuntu/ubuntu-20.04-amd64.json` 17 | -------------------------------------------------------------------------------- /scripts/amd64.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | export DEBIAN_FRONTEND=noninteractive 3 | 4 | ARCH=$(arch) 5 | 6 | SKIP_PHP=false 7 | SKIP_MYSQL=false 8 | SKIP_MARIADB=true 9 | SKIP_POSTGRESQL=false 10 | 11 | echo "### Settler Build Configuration ###" 12 | echo "ARCH = ${ARCH}" 13 | echo "SKIP_PHP = ${SKIP_PHP}" 14 | echo "SKIP_MYSQL = ${SKIP_MYSQL}" 15 | echo "SKIP_MARIADB = ${SKIP_MARIADB}" 16 | echo "SKIP_POSTGRESQL = ${SKIP_POSTGRESQL}" 17 | echo "### Settler Build Configuration ###" 18 | 19 | # Update Package List 20 | apt-get update 21 | 22 | # Update System Packages 23 | apt-get upgrade -y 24 | 25 | # Force Locale 26 | echo "LC_ALL=en_US.UTF-8" >> /etc/default/locale 27 | locale-gen en_US.UTF-8 28 | 29 | apt-get install -y software-properties-common curl gnupg debian-keyring debian-archive-keyring apt-transport-https \ 30 | ca-certificates 31 | 32 | # Install Some PPAs 33 | apt-add-repository ppa:ondrej/php -y 34 | 35 | # Prepare keyrings directory 36 | sudo mkdir -p /etc/apt/keyrings 37 | 38 | # NodeJS 39 | curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg 40 | echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_21.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list 41 | 42 | # PostgreSQL 43 | curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo gpg --dearmor -o /etc/apt/keyrings/postgresql.gpg 44 | sudo sh -c 'echo "deb [signed-by=/etc/apt/keyrings/postgresql.gpg] https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' 45 | 46 | ## Update Package Lists 47 | apt-get update -y 48 | 49 | # Install Some Basic Packages 50 | apt-get install -y build-essential dos2unix gcc git git-lfs libmcrypt4 libpcre3-dev libpng-dev chrony unzip make pv \ 51 | python3-pip re2c supervisor unattended-upgrades whois vim cifs-utils bash-completion zsh graphviz avahi-daemon tshark 52 | 53 | # Set My Timezone 54 | ln -sf /usr/share/zoneinfo/UTC /etc/localtime 55 | 56 | # Install docker-ce 57 | curl -fsSL https://get.docker.com | bash -s 58 | 59 | # Enable vagrant user to run docker commands 60 | usermod -aG docker vagrant 61 | 62 | # Install docker-compose 63 | curl \ 64 | -L "https://github.com/docker/compose/releases/download/2.23.0/docker-compose-$(uname -s)-$(uname -m)" \ 65 | -o /usr/local/bin/docker-compose 66 | chmod +x /usr/local/bin/docker-compose 67 | 68 | # Configure feature tracking path 69 | mkdir -p /home/vagrant/.homestead-features 70 | 71 | if "$SKIP_PHP"; then 72 | echo "SKIP_PHP is being used, so we're not installing PHP" 73 | else 74 | # Install Generic PHP packages 75 | apt-get install -y --allow-change-held-packages \ 76 | php-imagick php-memcached php-redis php-xdebug php-dev imagemagick mcrypt 77 | 78 | # PHP 5.6 79 | apt-get install -y --allow-change-held-packages \ 80 | php5.6-bcmath php5.6-bz2 php5.6-cgi php5.6-cli php5.6-common php5.6-curl php5.6-dba php5.6-dev php5.6-enchant \ 81 | php5.6-fpm php5.6-gd php5.6-gmp php5.6-imap php5.6-interbase php5.6-intl php5.6-json php5.6-ldap php5.6-mbstring \ 82 | php5.6-mcrypt php5.6-mysql php5.6-odbc php5.6-opcache php5.6-pgsql php5.6-phpdbg php5.6-pspell php5.6-readline \ 83 | php5.6-recode php5.6-snmp php5.6-soap php5.6-sqlite3 php5.6-sybase php5.6-tidy php5.6-xml php5.6-xmlrpc php5.6-xsl \ 84 | php5.6-zip php5.6-imagick php5.6-memcached php5.6-redis 85 | 86 | # Configure php.ini for CLI 87 | sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/5.6/cli/php.ini 88 | sed -i "s/display_errors = .*/display_errors = On/" /etc/php/5.6/cli/php.ini 89 | sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/5.6/cli/php.ini 90 | sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/5.6/cli/php.ini 91 | 92 | # Configure Xdebug 93 | echo "xdebug.remote_enable = 1" >> /etc/php/5.6/mods-available/xdebug.ini 94 | echo "xdebug.remote_connect_back = 1" >> /etc/php/5.6/mods-available/xdebug.ini 95 | echo "xdebug.remote_port = 9000" >> /etc/php/5.6/mods-available/xdebug.ini 96 | echo "xdebug.max_nesting_level = 512" >> /etc/php/5.6/mods-available/xdebug.ini 97 | echo "opcache.revalidate_freq = 0" >> /etc/php/5.6/mods-available/opcache.ini 98 | 99 | # Configure php.ini for FPM 100 | sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/5.6/fpm/php.ini 101 | sed -i "s/display_errors = .*/display_errors = On/" /etc/php/5.6/fpm/php.ini 102 | sed -i "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/" /etc/php/5.6/fpm/php.ini 103 | sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/5.6/fpm/php.ini 104 | sed -i "s/upload_max_filesize = .*/upload_max_filesize = 100M/" /etc/php/5.6/fpm/php.ini 105 | sed -i "s/post_max_size = .*/post_max_size = 100M/" /etc/php/5.6/fpm/php.ini 106 | sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/5.6/fpm/php.ini 107 | 108 | printf "[openssl]\n" | tee -a /etc/php/5.6/fpm/php.ini 109 | printf "openssl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/5.6/fpm/php.ini 110 | 111 | printf "[curl]\n" | tee -a /etc/php/5.6/fpm/php.ini 112 | printf "curl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/5.6/fpm/php.ini 113 | 114 | # Configure FPM 115 | sed -i "s/user = www-data/user = vagrant/" /etc/php/5.6/fpm/pool.d/www.conf 116 | sed -i "s/group = www-data/group = vagrant/" /etc/php/5.6/fpm/pool.d/www.conf 117 | sed -i "s/listen\.owner.*/listen.owner = vagrant/" /etc/php/5.6/fpm/pool.d/www.conf 118 | sed -i "s/listen\.group.*/listen.group = vagrant/" /etc/php/5.6/fpm/pool.d/www.conf 119 | sed -i "s/;listen\.mode.*/listen.mode = 0666/" /etc/php/5.6/fpm/pool.d/www.conf 120 | 121 | touch /home/vagrant/.homestead-features/php56 122 | 123 | # PHP 7.0 124 | apt-get install -y --allow-change-held-packages \ 125 | php7.0-bcmath php7.0-bz2 php7.0-cgi php7.0-cli php7.0-common php7.0-curl php7.0-dba php7.0-dev php7.0-enchant \ 126 | php7.0-fpm php7.0-gd php7.0-gmp php7.0-imap php7.0-interbase php7.0-intl php7.0-json php7.0-ldap php7.0-mbstring \ 127 | php7.0-mcrypt php7.0-mysql php7.0-odbc php7.0-opcache php7.0-pgsql php7.0-phpdbg php7.0-pspell php7.0-readline \ 128 | php7.0-recode php7.0-snmp php7.0-soap php7.0-sqlite3 php7.0-sybase php7.0-tidy php7.0-xml php7.0-xmlrpc php7.0-xsl \ 129 | php7.0-zip php7.0-imagick php7.0-memcached php7.0-redis 130 | 131 | # Configure php.ini for CLI 132 | sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/7.0/cli/php.ini 133 | sed -i "s/display_errors = .*/display_errors = On/" /etc/php/7.0/cli/php.ini 134 | sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/7.0/cli/php.ini 135 | sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/7.0/cli/php.ini 136 | 137 | # Configure Xdebug 138 | echo "xdebug.remote_enable = 1" >> /etc/php/7.0/mods-available/xdebug.ini 139 | echo "xdebug.remote_connect_back = 1" >> /etc/php/7.0/mods-available/xdebug.ini 140 | echo "xdebug.remote_port = 9000" >> /etc/php/7.0/mods-available/xdebug.ini 141 | echo "xdebug.max_nesting_level = 512" >> /etc/php/7.0/mods-available/xdebug.ini 142 | echo "opcache.revalidate_freq = 0" >> /etc/php/7.0/mods-available/opcache.ini 143 | 144 | # Configure php.ini for FPM 145 | sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/7.0/fpm/php.ini 146 | sed -i "s/display_errors = .*/display_errors = On/" /etc/php/7.0/fpm/php.ini 147 | sed -i "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/" /etc/php/7.0/fpm/php.ini 148 | sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/7.0/fpm/php.ini 149 | sed -i "s/upload_max_filesize = .*/upload_max_filesize = 100M/" /etc/php/7.0/fpm/php.ini 150 | sed -i "s/post_max_size = .*/post_max_size = 100M/" /etc/php/7.0/fpm/php.ini 151 | sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/7.0/fpm/php.ini 152 | 153 | printf "[openssl]\n" | tee -a /etc/php/7.0/fpm/php.ini 154 | printf "openssl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/7.0/fpm/php.ini 155 | printf "[curl]\n" | tee -a /etc/php/7.0/fpm/php.ini 156 | printf "curl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/7.0/fpm/php.ini 157 | 158 | # Configure FPM 159 | sed -i "s/user = www-data/user = vagrant/" /etc/php/7.0/fpm/pool.d/www.conf 160 | sed -i "s/group = www-data/group = vagrant/" /etc/php/7.0/fpm/pool.d/www.conf 161 | sed -i "s/listen\.owner.*/listen.owner = vagrant/" /etc/php/7.0/fpm/pool.d/www.conf 162 | sed -i "s/listen\.group.*/listen.group = vagrant/" /etc/php/7.0/fpm/pool.d/www.conf 163 | sed -i "s/;listen\.mode.*/listen.mode = 0666/" /etc/php/7.0/fpm/pool.d/www.conf 164 | 165 | touch /home/vagrant/.homestead-features/php70 166 | 167 | # PHP 7.1 168 | apt-get install -y --allow-change-held-packages \ 169 | php7.1-bcmath php7.1-bz2 php7.1-cgi php7.1-cli php7.1-common php7.1-curl php7.1-dba php7.1-dev php7.1-enchant \ 170 | php7.1-fpm php7.1-gd php7.1-gmp php7.1-imap php7.1-interbase php7.1-intl php7.1-json php7.1-ldap php7.1-mbstring \ 171 | php7.1-mcrypt php7.1-mysql php7.1-odbc php7.1-opcache php7.1-pgsql php7.1-phpdbg php7.1-pspell php7.1-readline \ 172 | php7.1-recode php7.1-snmp php7.1-soap php7.1-sqlite3 php7.1-sybase php7.1-tidy php7.1-xdebug php7.1-xml php7.1-xmlrpc \ 173 | php7.1-xsl php7.1-zip php7.1-imagick php7.1-memcached php7.1-redis 174 | 175 | # Configure php.ini for CLI 176 | sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/7.1/cli/php.ini 177 | sed -i "s/display_errors = .*/display_errors = On/" /etc/php/7.1/cli/php.ini 178 | sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/7.1/cli/php.ini 179 | sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/7.1/cli/php.ini 180 | 181 | # Configure Xdebug 182 | echo "xdebug.remote_enable = 1" >> /etc/php/7.1/mods-available/xdebug.ini 183 | echo "xdebug.remote_connect_back = 1" >> /etc/php/7.1/mods-available/xdebug.ini 184 | echo "xdebug.remote_port = 9000" >> /etc/php/7.1/mods-available/xdebug.ini 185 | echo "xdebug.max_nesting_level = 512" >> /etc/php/7.1/mods-available/xdebug.ini 186 | echo "opcache.revalidate_freq = 0" >> /etc/php/7.1/mods-available/opcache.ini 187 | 188 | # Configure php.ini for FPM 189 | sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/7.1/fpm/php.ini 190 | sed -i "s/display_errors = .*/display_errors = On/" /etc/php/7.1/fpm/php.ini 191 | sed -i "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/" /etc/php/7.1/fpm/php.ini 192 | sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/7.1/fpm/php.ini 193 | sed -i "s/upload_max_filesize = .*/upload_max_filesize = 100M/" /etc/php/7.1/fpm/php.ini 194 | sed -i "s/post_max_size = .*/post_max_size = 100M/" /etc/php/7.1/fpm/php.ini 195 | sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/7.1/fpm/php.ini 196 | 197 | printf "[openssl]\n" | tee -a /etc/php/7.1/fpm/php.ini 198 | printf "openssl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/7.1/fpm/php.ini 199 | printf "[curl]\n" | tee -a /etc/php/7.1/fpm/php.ini 200 | printf "curl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/7.1/fpm/php.ini 201 | 202 | # Configure FPM 203 | sed -i "s/user = www-data/user = vagrant/" /etc/php/7.1/fpm/pool.d/www.conf 204 | sed -i "s/group = www-data/group = vagrant/" /etc/php/7.1/fpm/pool.d/www.conf 205 | sed -i "s/listen\.owner.*/listen.owner = vagrant/" /etc/php/7.1/fpm/pool.d/www.conf 206 | sed -i "s/listen\.group.*/listen.group = vagrant/" /etc/php/7.1/fpm/pool.d/www.conf 207 | sed -i "s/;listen\.mode.*/listen.mode = 0666/" /etc/php/7.1/fpm/pool.d/www.conf 208 | 209 | touch /home/vagrant/.homestead-features/php71 210 | 211 | # PHP 7.2 212 | apt-get install -y --allow-change-held-packages \ 213 | php7.2-bcmath php7.2-bz2 php7.2-dba php7.2-enchant php7.2-fpm php7.2-imap php7.2-interbase php7.2-intl \ 214 | php7.2-mbstring php7.2-phpdbg php7.2-soap php7.2-sybase php7.2-xsl php7.2-zip php7.2-cgi php7.2-cli php7.2-common \ 215 | php7.2-curl php7.2-dev php7.2-gd php7.2-gmp php7.2-json php7.2-ldap php7.2-mysql php7.2-odbc php7.2-opcache \ 216 | php7.2-pgsql php7.2-pspell php7.2-readline php7.2-recode php7.2-snmp php7.2-sqlite3 php7.2-tidy php7.2-xdebug \ 217 | php7.2-xml php7.2-xmlrpc php7.2-imagick php7.2-memcached php7.2-redis 218 | 219 | # Configure php.ini for CLI 220 | sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/7.2/cli/php.ini 221 | sed -i "s/display_errors = .*/display_errors = On/" /etc/php/7.2/cli/php.ini 222 | sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/7.2/cli/php.ini 223 | sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/7.2/cli/php.ini 224 | 225 | # Configure Xdebug 226 | echo "xdebug.mode = debug" >> /etc/php/7.2/mods-available/xdebug.ini 227 | echo "xdebug.discover_client_host = true" >> /etc/php/7.2/mods-available/xdebug.ini 228 | echo "xdebug.client_port = 9003" >> /etc/php/7.2/mods-available/xdebug.ini 229 | echo "xdebug.max_nesting_level = 512" >> /etc/php/7.2/mods-available/xdebug.ini 230 | echo "opcache.revalidate_freq = 0" >> /etc/php/7.2/mods-available/opcache.ini 231 | 232 | # Configure php.ini for FPM 233 | sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/7.2/fpm/php.ini 234 | sed -i "s/display_errors = .*/display_errors = On/" /etc/php/7.2/fpm/php.ini 235 | sed -i "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/" /etc/php/7.2/fpm/php.ini 236 | sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/7.2/fpm/php.ini 237 | sed -i "s/upload_max_filesize = .*/upload_max_filesize = 100M/" /etc/php/7.2/fpm/php.ini 238 | sed -i "s/post_max_size = .*/post_max_size = 100M/" /etc/php/7.2/fpm/php.ini 239 | sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/7.2/fpm/php.ini 240 | 241 | printf "[openssl]\n" | tee -a /etc/php/7.2/fpm/php.ini 242 | printf "openssl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/7.2/fpm/php.ini 243 | printf "[curl]\n" | tee -a /etc/php/7.2/fpm/php.ini 244 | printf "curl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/7.2/fpm/php.ini 245 | 246 | # Configure FPM 247 | sed -i "s/user = www-data/user = vagrant/" /etc/php/7.2/fpm/pool.d/www.conf 248 | sed -i "s/group = www-data/group = vagrant/" /etc/php/7.2/fpm/pool.d/www.conf 249 | 250 | sed -i "s/listen\.owner.*/listen.owner = vagrant/" /etc/php/7.2/fpm/pool.d/www.conf 251 | sed -i "s/listen\.group.*/listen.group = vagrant/" /etc/php/7.2/fpm/pool.d/www.conf 252 | sed -i "s/;listen\.mode.*/listen.mode = 0666/" /etc/php/7.2/fpm/pool.d/www.conf 253 | 254 | touch /home/vagrant/.homestead-features/php72 255 | 256 | # PHP 7.3 257 | apt-get install -y --allow-change-held-packages \ 258 | php7.3 php7.3-bcmath php7.3-bz2 php7.3-cgi php7.3-cli php7.3-common php7.3-curl php7.3-dba php7.3-dev php7.3-enchant \ 259 | php7.3-fpm php7.3-gd php7.3-gmp php7.3-imap php7.3-interbase php7.3-intl php7.3-json php7.3-ldap php7.3-mbstring \ 260 | php7.3-mysql php7.3-odbc php7.3-opcache php7.3-pgsql php7.3-phpdbg php7.3-pspell php7.3-readline php7.3-recode \ 261 | php7.3-snmp php7.3-soap php7.3-sqlite3 php7.3-sybase php7.3-tidy php7.3-xdebug php7.3-xml php7.3-xmlrpc php7.3-xsl \ 262 | php7.3-zip php7.3-imagick php7.3-memcached php7.3-redis 263 | 264 | # Configure php.ini for CLI 265 | sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/7.3/cli/php.ini 266 | sed -i "s/display_errors = .*/display_errors = On/" /etc/php/7.3/cli/php.ini 267 | sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/7.3/cli/php.ini 268 | sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/7.3/cli/php.ini 269 | 270 | # Configure Xdebug 271 | echo "xdebug.mode = debug" >> /etc/php/7.3/mods-available/xdebug.ini 272 | echo "xdebug.discover_client_host = true" >> /etc/php/7.3/mods-available/xdebug.ini 273 | echo "xdebug.client_port = 9003" >> /etc/php/7.3/mods-available/xdebug.ini 274 | echo "xdebug.max_nesting_level = 512" >> /etc/php/7.3/mods-available/xdebug.ini 275 | echo "opcache.revalidate_freq = 0" >> /etc/php/7.3/mods-available/opcache.ini 276 | 277 | # Configure php.ini for FPM 278 | sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/7.3/fpm/php.ini 279 | sed -i "s/display_errors = .*/display_errors = On/" /etc/php/7.3/fpm/php.ini 280 | sed -i "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/" /etc/php/7.3/fpm/php.ini 281 | sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/7.3/fpm/php.ini 282 | sed -i "s/upload_max_filesize = .*/upload_max_filesize = 100M/" /etc/php/7.3/fpm/php.ini 283 | sed -i "s/post_max_size = .*/post_max_size = 100M/" /etc/php/7.3/fpm/php.ini 284 | sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/7.3/fpm/php.ini 285 | 286 | printf "[openssl]\n" | tee -a /etc/php/7.3/fpm/php.ini 287 | printf "openssl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/7.3/fpm/php.ini 288 | printf "[curl]\n" | tee -a /etc/php/7.3/fpm/php.ini 289 | printf "curl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/7.3/fpm/php.ini 290 | 291 | # Configure FPM 292 | sed -i "s/user = www-data/user = vagrant/" /etc/php/7.3/fpm/pool.d/www.conf 293 | sed -i "s/group = www-data/group = vagrant/" /etc/php/7.3/fpm/pool.d/www.conf 294 | sed -i "s/listen\.owner.*/listen.owner = vagrant/" /etc/php/7.3/fpm/pool.d/www.conf 295 | sed -i "s/listen\.group.*/listen.group = vagrant/" /etc/php/7.3/fpm/pool.d/www.conf 296 | sed -i "s/;listen\.mode.*/listen.mode = 0666/" /etc/php/7.3/fpm/pool.d/www.conf 297 | 298 | touch /home/vagrant/.homestead-features/php73 299 | 300 | # PHP 7.4 301 | apt-get install -y --allow-change-held-packages \ 302 | php7.4 php7.4-bcmath php7.4-bz2 php7.4-cgi php7.4-cli php7.4-common php7.4-curl php7.4-dba php7.4-dev \ 303 | php7.4-enchant php7.4-fpm php7.4-gd php7.4-gmp php7.4-imap php7.4-interbase php7.4-intl php7.4-json php7.4-ldap \ 304 | php7.4-mbstring php7.4-mysql php7.4-odbc php7.4-opcache php7.4-pgsql php7.4-phpdbg php7.4-pspell php7.4-readline \ 305 | php7.4-snmp php7.4-soap php7.4-sqlite3 php7.4-sybase php7.4-tidy php7.4-xdebug php7.4-xml php7.4-xmlrpc php7.4-xsl \ 306 | php7.4-zip php7.4-imagick php7.4-memcached php7.4-redis 307 | 308 | # Configure php.ini for CLI 309 | sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/7.4/cli/php.ini 310 | sed -i "s/display_errors = .*/display_errors = On/" /etc/php/7.4/cli/php.ini 311 | sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/7.4/cli/php.ini 312 | sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/7.4/cli/php.ini 313 | 314 | # Configure Xdebug 315 | echo "xdebug.mode = debug" >> /etc/php/7.4/mods-available/xdebug.ini 316 | echo "xdebug.discover_client_host = true" >> /etc/php/7.4/mods-available/xdebug.ini 317 | echo "xdebug.client_port = 9003" >> /etc/php/7.4/mods-available/xdebug.ini 318 | echo "xdebug.max_nesting_level = 512" >> /etc/php/7.4/mods-available/xdebug.ini 319 | echo "opcache.revalidate_freq = 0" >> /etc/php/7.4/mods-available/opcache.ini 320 | 321 | # Configure php.ini for FPM 322 | sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/7.4/fpm/php.ini 323 | sed -i "s/display_errors = .*/display_errors = On/" /etc/php/7.4/fpm/php.ini 324 | sed -i "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/" /etc/php/7.4/fpm/php.ini 325 | sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/7.4/fpm/php.ini 326 | sed -i "s/upload_max_filesize = .*/upload_max_filesize = 100M/" /etc/php/7.4/fpm/php.ini 327 | sed -i "s/post_max_size = .*/post_max_size = 100M/" /etc/php/7.4/fpm/php.ini 328 | sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/7.4/fpm/php.ini 329 | 330 | printf "[openssl]\n" | tee -a /etc/php/7.4/fpm/php.ini 331 | printf "openssl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/7.4/fpm/php.ini 332 | printf "[curl]\n" | tee -a /etc/php/7.4/fpm/php.ini 333 | printf "curl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/7.4/fpm/php.ini 334 | 335 | # Configure FPM 336 | sed -i "s/user = www-data/user = vagrant/" /etc/php/7.4/fpm/pool.d/www.conf 337 | sed -i "s/group = www-data/group = vagrant/" /etc/php/7.4/fpm/pool.d/www.conf 338 | sed -i "s/listen\.owner.*/listen.owner = vagrant/" /etc/php/7.4/fpm/pool.d/www.conf 339 | sed -i "s/listen\.group.*/listen.group = vagrant/" /etc/php/7.4/fpm/pool.d/www.conf 340 | sed -i "s/;listen\.mode.*/listen.mode = 0666/" /etc/php/7.4/fpm/pool.d/www.conf 341 | 342 | touch /home/vagrant/.homestead-features/php74 343 | 344 | # PHP 8.0 345 | apt-get install -y --allow-change-held-packages \ 346 | php8.0 php8.0-bcmath php8.0-bz2 php8.0-cgi php8.0-cli php8.0-common php8.0-curl php8.0-dba php8.0-dev \ 347 | php8.0-enchant php8.0-fpm php8.0-gd php8.0-gmp php8.0-imap php8.0-interbase php8.0-intl php8.0-ldap \ 348 | php8.0-mbstring php8.0-mysql php8.0-odbc php8.0-opcache php8.0-pgsql php8.0-phpdbg php8.0-pspell php8.0-readline \ 349 | php8.0-snmp php8.0-soap php8.0-sqlite3 php8.0-sybase php8.0-tidy php8.0-xdebug php8.0-xml php8.0-xmlrpc php8.0-xsl \ 350 | php8.0-zip php8.0-imagick php8.0-memcached php8.0-redis 351 | 352 | # Configure php.ini for CLI 353 | sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/8.0/cli/php.ini 354 | sed -i "s/display_errors = .*/display_errors = On/" /etc/php/8.0/cli/php.ini 355 | sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/8.0/cli/php.ini 356 | sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/8.0/cli/php.ini 357 | 358 | # Configure Xdebug 359 | echo "xdebug.mode = debug" >> /etc/php/8.0/mods-available/xdebug.ini 360 | echo "xdebug.discover_client_host = true" >> /etc/php/8.0/mods-available/xdebug.ini 361 | echo "xdebug.client_port = 9003" >> /etc/php/8.0/mods-available/xdebug.ini 362 | echo "xdebug.max_nesting_level = 512" >> /etc/php/8.0/mods-available/xdebug.ini 363 | echo "opcache.revalidate_freq = 0" >> /etc/php/8.0/mods-available/opcache.ini 364 | 365 | # Configure php.ini for FPM 366 | sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/8.0/fpm/php.ini 367 | sed -i "s/display_errors = .*/display_errors = On/" /etc/php/8.0/fpm/php.ini 368 | sed -i "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/" /etc/php/8.0/fpm/php.ini 369 | sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/8.0/fpm/php.ini 370 | sed -i "s/upload_max_filesize = .*/upload_max_filesize = 100M/" /etc/php/8.0/fpm/php.ini 371 | sed -i "s/post_max_size = .*/post_max_size = 100M/" /etc/php/8.0/fpm/php.ini 372 | sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/8.0/fpm/php.ini 373 | 374 | printf "[openssl]\n" | tee -a /etc/php/8.0/fpm/php.ini 375 | printf "openssl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/8.0/fpm/php.ini 376 | printf "[curl]\n" | tee -a /etc/php/8.0/fpm/php.ini 377 | printf "curl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/8.0/fpm/php.ini 378 | 379 | # Configure FPM 380 | sed -i "s/user = www-data/user = vagrant/" /etc/php/8.0/fpm/pool.d/www.conf 381 | sed -i "s/group = www-data/group = vagrant/" /etc/php/8.0/fpm/pool.d/www.conf 382 | sed -i "s/listen\.owner.*/listen.owner = vagrant/" /etc/php/8.0/fpm/pool.d/www.conf 383 | sed -i "s/listen\.group.*/listen.group = vagrant/" /etc/php/8.0/fpm/pool.d/www.conf 384 | sed -i "s/;listen\.mode.*/listen.mode = 0666/" /etc/php/8.0/fpm/pool.d/www.conf 385 | 386 | touch /home/vagrant/.homestead-features/php80 387 | 388 | # PHP 8.1 389 | apt-get install -y --allow-change-held-packages \ 390 | php8.1 php8.1-bcmath php8.1-bz2 php8.1-cgi php8.1-cli php8.1-common php8.1-curl php8.1-dba php8.1-dev \ 391 | php8.1-enchant php8.1-fpm php8.1-gd php8.1-gmp php8.1-imap php8.1-interbase php8.1-intl php8.1-ldap \ 392 | php8.1-mbstring php8.1-mysql php8.1-odbc php8.1-opcache php8.1-pgsql php8.1-phpdbg php8.1-pspell php8.1-readline \ 393 | php8.1-snmp php8.1-soap php8.1-sqlite3 php8.1-sybase php8.1-tidy php8.1-xdebug php8.1-xml php8.1-xmlrpc php8.1-xsl \ 394 | php8.1-zip php8.1-imagick php8.1-memcached php8.1-redis 395 | 396 | # Configure php.ini for CLI 397 | sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/8.1/cli/php.ini 398 | sed -i "s/display_errors = .*/display_errors = On/" /etc/php/8.1/cli/php.ini 399 | sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/8.1/cli/php.ini 400 | sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/8.1/cli/php.ini 401 | 402 | # Configure Xdebug 403 | echo "xdebug.mode = debug" >> /etc/php/8.1/mods-available/xdebug.ini 404 | echo "xdebug.discover_client_host = true" >> /etc/php/8.1/mods-available/xdebug.ini 405 | echo "xdebug.client_port = 9003" >> /etc/php/8.1/mods-available/xdebug.ini 406 | echo "xdebug.max_nesting_level = 512" >> /etc/php/8.1/mods-available/xdebug.ini 407 | echo "opcache.revalidate_freq = 0" >> /etc/php/8.1/mods-available/opcache.ini 408 | 409 | # Configure php.ini for FPM 410 | sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/8.1/fpm/php.ini 411 | sed -i "s/display_errors = .*/display_errors = On/" /etc/php/8.1/fpm/php.ini 412 | sed -i "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/" /etc/php/8.1/fpm/php.ini 413 | sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/8.1/fpm/php.ini 414 | sed -i "s/upload_max_filesize = .*/upload_max_filesize = 100M/" /etc/php/8.1/fpm/php.ini 415 | sed -i "s/post_max_size = .*/post_max_size = 100M/" /etc/php/8.1/fpm/php.ini 416 | sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/8.1/fpm/php.ini 417 | 418 | printf "[openssl]\n" | tee -a /etc/php/8.1/fpm/php.ini 419 | printf "openssl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/8.1/fpm/php.ini 420 | printf "[curl]\n" | tee -a /etc/php/8.1/fpm/php.ini 421 | printf "curl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/8.1/fpm/php.ini 422 | 423 | # Configure FPM 424 | sed -i "s/user = www-data/user = vagrant/" /etc/php/8.1/fpm/pool.d/www.conf 425 | sed -i "s/group = www-data/group = vagrant/" /etc/php/8.1/fpm/pool.d/www.conf 426 | sed -i "s/listen\.owner.*/listen.owner = vagrant/" /etc/php/8.1/fpm/pool.d/www.conf 427 | sed -i "s/listen\.group.*/listen.group = vagrant/" /etc/php/8.1/fpm/pool.d/www.conf 428 | sed -i "s/;listen\.mode.*/listen.mode = 0666/" /etc/php/8.1/fpm/pool.d/www.conf 429 | 430 | touch /home/vagrant/.homestead-features/php81 431 | 432 | # PHP 8.2 433 | apt-get install -y --allow-change-held-packages \ 434 | php8.2 php8.2-bcmath php8.2-bz2 php8.2-cgi php8.2-cli php8.2-common php8.2-curl php8.2-dba php8.2-dev \ 435 | php8.2-enchant php8.2-fpm php8.2-gd php8.2-gmp php8.2-imap php8.2-interbase php8.2-intl php8.2-ldap \ 436 | php8.2-mbstring php8.2-mysql php8.2-odbc php8.2-opcache php8.2-pgsql php8.2-phpdbg php8.2-pspell php8.2-readline \ 437 | php8.2-snmp php8.2-soap php8.2-sqlite3 php8.2-sybase php8.2-tidy php8.2-xml php8.2-xsl \ 438 | php8.2-zip php8.2-imagick php8.2-memcached php8.2-redis php8.2-xmlrpc php8.2-xdebug 439 | 440 | # Configure php.ini for CLI 441 | sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/8.2/cli/php.ini 442 | sed -i "s/display_errors = .*/display_errors = On/" /etc/php/8.2/cli/php.ini 443 | sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/8.2/cli/php.ini 444 | sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/8.2/cli/php.ini 445 | 446 | # Configure Xdebug 447 | echo "xdebug.mode = debug" >> /etc/php/8.2/mods-available/xdebug.ini 448 | echo "xdebug.discover_client_host = true" >> /etc/php/8.2/mods-available/xdebug.ini 449 | echo "xdebug.client_port = 9003" >> /etc/php/8.2/mods-available/xdebug.ini 450 | echo "xdebug.max_nesting_level = 512" >> /etc/php/8.2/mods-available/xdebug.ini 451 | echo "opcache.revalidate_freq = 0" >> /etc/php/8.2/mods-available/opcache.ini 452 | 453 | # Configure php.ini for FPM 454 | sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/8.2/fpm/php.ini 455 | sed -i "s/display_errors = .*/display_errors = On/" /etc/php/8.2/fpm/php.ini 456 | sed -i "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/" /etc/php/8.2/fpm/php.ini 457 | sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/8.2/fpm/php.ini 458 | sed -i "s/upload_max_filesize = .*/upload_max_filesize = 100M/" /etc/php/8.2/fpm/php.ini 459 | sed -i "s/post_max_size = .*/post_max_size = 100M/" /etc/php/8.2/fpm/php.ini 460 | sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/8.2/fpm/php.ini 461 | 462 | printf "[openssl]\n" | tee -a /etc/php/8.2/fpm/php.ini 463 | printf "openssl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/8.2/fpm/php.ini 464 | printf "[curl]\n" | tee -a /etc/php/8.2/fpm/php.ini 465 | printf "curl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/8.2/fpm/php.ini 466 | 467 | # Configure FPM 468 | sed -i "s/user = www-data/user = vagrant/" /etc/php/8.2/fpm/pool.d/www.conf 469 | sed -i "s/group = www-data/group = vagrant/" /etc/php/8.2/fpm/pool.d/www.conf 470 | sed -i "s/listen\.owner.*/listen.owner = vagrant/" /etc/php/8.2/fpm/pool.d/www.conf 471 | sed -i "s/listen\.group.*/listen.group = vagrant/" /etc/php/8.2/fpm/pool.d/www.conf 472 | sed -i "s/;listen\.mode.*/listen.mode = 0666/" /etc/php/8.2/fpm/pool.d/www.conf 473 | 474 | touch /home/vagrant/.homestead-features/php82 475 | 476 | # PHP 8.3 477 | apt-get install -y --allow-change-held-packages \ 478 | php8.3 php8.3-bcmath php8.3-bz2 php8.3-cgi php8.3-cli php8.3-common php8.3-curl php8.3-dba php8.3-dev \ 479 | php8.3-enchant php8.3-fpm php8.3-gd php8.3-gmp php8.3-imap php8.3-interbase php8.3-intl php8.3-ldap \ 480 | php8.3-mbstring php8.3-mysql php8.3-odbc php8.3-opcache php8.3-pgsql php8.3-phpdbg php8.3-pspell php8.3-readline \ 481 | php8.3-snmp php8.3-soap php8.3-sqlite3 php8.3-sybase php8.3-tidy php8.3-xml php8.3-xsl \ 482 | php8.3-zip php8.3-imagick php8.3-memcached php8.3-redis php8.3-xmlrpc php8.3-xdebug 483 | 484 | # Configure php.ini for CLI 485 | sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/8.3/cli/php.ini 486 | sed -i "s/display_errors = .*/display_errors = On/" /etc/php/8.3/cli/php.ini 487 | sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/8.3/cli/php.ini 488 | sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/8.3/cli/php.ini 489 | 490 | # Configure Xdebug 491 | echo "xdebug.mode = debug" >> /etc/php/8.3/mods-available/xdebug.ini 492 | echo "xdebug.discover_client_host = true" >> /etc/php/8.3/mods-available/xdebug.ini 493 | echo "xdebug.client_port = 9003" >> /etc/php/8.3/mods-available/xdebug.ini 494 | echo "xdebug.max_nesting_level = 512" >> /etc/php/8.3/mods-available/xdebug.ini 495 | echo "opcache.revalidate_freq = 0" >> /etc/php/8.3/mods-available/opcache.ini 496 | 497 | # Configure php.ini for FPM 498 | sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/8.3/fpm/php.ini 499 | sed -i "s/display_errors = .*/display_errors = On/" /etc/php/8.3/fpm/php.ini 500 | sed -i "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/" /etc/php/8.3/fpm/php.ini 501 | sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/8.3/fpm/php.ini 502 | sed -i "s/upload_max_filesize = .*/upload_max_filesize = 100M/" /etc/php/8.3/fpm/php.ini 503 | sed -i "s/post_max_size = .*/post_max_size = 100M/" /etc/php/8.3/fpm/php.ini 504 | sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/8.3/fpm/php.ini 505 | 506 | printf "[openssl]\n" | tee -a /etc/php/8.3/fpm/php.ini 507 | printf "openssl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/8.3/fpm/php.ini 508 | printf "[curl]\n" | tee -a /etc/php/8.3/fpm/php.ini 509 | printf "curl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/8.3/fpm/php.ini 510 | 511 | # Configure FPM 512 | sed -i "s/user = www-data/user = vagrant/" /etc/php/8.3/fpm/pool.d/www.conf 513 | sed -i "s/group = www-data/group = vagrant/" /etc/php/8.3/fpm/pool.d/www.conf 514 | sed -i "s/listen\.owner.*/listen.owner = vagrant/" /etc/php/8.3/fpm/pool.d/www.conf 515 | sed -i "s/listen\.group.*/listen.group = vagrant/" /etc/php/8.3/fpm/pool.d/www.conf 516 | sed -i "s/;listen\.mode.*/listen.mode = 0666/" /etc/php/8.3/fpm/pool.d/www.conf 517 | 518 | touch /home/vagrant/.homestead-features/php83 519 | 520 | # Disable old PHP FPM 521 | systemctl disable php5.6-fpm 522 | systemctl disable php7.0-fpm 523 | systemctl disable php7.1-fpm 524 | systemctl disable php7.2-fpm 525 | systemctl disable php7.3-fpm 526 | systemctl disable php7.4-fpm 527 | systemctl disable php8.0-fpm 528 | systemctl disable php8.1-fpm 529 | systemctl disable php8.2-fpm 530 | 531 | update-alternatives --set php /usr/bin/php8.3 532 | update-alternatives --set php-config /usr/bin/php-config8.3 533 | update-alternatives --set phpize /usr/bin/phpize8.3 534 | 535 | # Install Composer 536 | curl -sS https://getcomposer.org/installer | php 537 | mv composer.phar /usr/local/bin/composer 538 | chown -R vagrant:vagrant /home/vagrant/.config 539 | 540 | # Install Global Packages 541 | sudo su vagrant <<'EOF' 542 | /usr/local/bin/composer global require "laravel/envoy=^2.0" 543 | /usr/local/bin/composer global require "laravel/installer=^5.0" 544 | /usr/local/bin/composer global config --no-plugins allow-plugins.slince/composer-registry-manager true 545 | /usr/local/bin/composer global require "slince/composer-registry-manager=^2.0" 546 | EOF 547 | 548 | # Install Apache 549 | apt-get install -y apache2 libapache2-mod-fcgid 550 | sed -i "s/www-data/vagrant/" /etc/apache2/envvars 551 | 552 | # Enable FPM 553 | a2enconf php8.3-fpm 554 | 555 | # Assume user wants mode_rewrite support 556 | sudo a2enmod rewrite 557 | 558 | # Turn on HTTPS support 559 | sudo a2enmod ssl 560 | 561 | # Turn on proxy & fcgi 562 | sudo a2enmod proxy proxy_fcgi 563 | 564 | # Turn on headers support 565 | sudo a2enmod headers actions alias 566 | 567 | # Add Mutex to config to prevent auto restart issues 568 | if [ -z "$(grep '^Mutex posixsem$' /etc/apache2/apache2.conf)" ] 569 | then 570 | echo 'Mutex posixsem' | sudo tee -a /etc/apache2/apache2.conf 571 | fi 572 | 573 | a2dissite 000-default 574 | systemctl disable apache2 575 | 576 | # Install Nginx 577 | apt-get install -y --allow-downgrades --allow-remove-essential --allow-change-held-packages nginx 578 | 579 | rm /etc/nginx/sites-enabled/default 580 | rm /etc/nginx/sites-available/default 581 | 582 | # Create a configuration file for Nginx overrides. 583 | mkdir -p /home/vagrant/.config/nginx 584 | chown -R vagrant:vagrant /home/vagrant 585 | touch /home/vagrant/.config/nginx/nginx.conf 586 | ln -sf /home/vagrant/.config/nginx/nginx.conf /etc/nginx/conf.d/nginx.conf 587 | 588 | # Setup Some PHP-FPM Options 589 | sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/8.0/fpm/php.ini 590 | sed -i "s/display_errors = .*/display_errors = On/" /etc/php/8.0/fpm/php.ini 591 | sed -i "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/" /etc/php/8.0/fpm/php.ini 592 | sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/8.0/fpm/php.ini 593 | sed -i "s/upload_max_filesize = .*/upload_max_filesize = 100M/" /etc/php/8.0/fpm/php.ini 594 | sed -i "s/post_max_size = .*/post_max_size = 100M/" /etc/php/8.0/fpm/php.ini 595 | sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/8.0/fpm/php.ini 596 | 597 | printf "[openssl]\n" | tee -a /etc/php/8.0/fpm/php.ini 598 | printf "openssl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/8.0/fpm/php.ini 599 | 600 | printf "[curl]\n" | tee -a /etc/php/8.0/fpm/php.ini 601 | printf "curl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/8.0/fpm/php.ini 602 | 603 | # Disable XDebug On The CLI 604 | sudo phpdismod -s cli xdebug 605 | 606 | # Set The Nginx & PHP-FPM User 607 | sed -i "s/user www-data;/user vagrant;/" /etc/nginx/nginx.conf 608 | sed -i "s/# server_names_hash_bucket_size.*/server_names_hash_bucket_size 64;/" /etc/nginx/nginx.conf 609 | sed -i "s/sendfile on;/sendfile on; client_max_body_size 100M;/" /etc/nginx/nginx.conf 610 | 611 | sed -i "s/user = www-data/user = vagrant/" /etc/php/8.0/fpm/pool.d/www.conf 612 | sed -i "s/group = www-data/group = vagrant/" /etc/php/8.0/fpm/pool.d/www.conf 613 | 614 | sed -i "s/listen\.owner.*/listen.owner = vagrant/" /etc/php/8.0/fpm/pool.d/www.conf 615 | sed -i "s/listen\.group.*/listen.group = vagrant/" /etc/php/8.0/fpm/pool.d/www.conf 616 | sed -i "s/;listen\.mode.*/listen.mode = 0666/" /etc/php/8.0/fpm/pool.d/www.conf 617 | 618 | service nginx restart 619 | service php8.3-fpm restart 620 | 621 | # Add Vagrant User To WWW-Data 622 | usermod -a -G www-data vagrant 623 | id vagrant 624 | groups vagrant 625 | 626 | # Install wp-cli 627 | curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar 628 | chmod +x wp-cli.phar 629 | mv wp-cli.phar /usr/local/bin/wp 630 | 631 | # Add Composer Global Bin To Path 632 | printf "\nPATH=\"$(sudo su - vagrant -c 'composer config -g home 2>/dev/null')/vendor/bin:\$PATH\"\n" | tee -a /home/vagrant/.profile 633 | fi 634 | 635 | # Install Node 636 | apt-get install -y nodejs 637 | /usr/bin/npm install -g npm 638 | /usr/bin/npm install -g gulp-cli 639 | /usr/bin/npm install -g bower 640 | /usr/bin/npm install -g yarn 641 | /usr/bin/npm install -g grunt-cli 642 | 643 | # Install SQLite 644 | apt-get install -y sqlite3 libsqlite3-dev 645 | 646 | if "$SKIP_MYSQL"; then 647 | echo "SKIP_MYSQL is being used, so we're not installing MySQL" 648 | apt-get install -y mysql-client 649 | else 650 | # Install MySQL 651 | echo "mysql-server mysql-server/root_password password secret" | debconf-set-selections 652 | echo "mysql-server mysql-server/root_password_again password secret" | debconf-set-selections 653 | apt-get install -y mysql-server 654 | 655 | # Configure MySQL 8 Remote Access and Native Pluggable Authentication 656 | cat > /etc/mysql/conf.d/mysqld.cnf << EOF 657 | [mysqld] 658 | bind-address = 0.0.0.0 659 | disable_log_bin 660 | default_authentication_plugin = mysql_native_password 661 | EOF 662 | 663 | # Configure MySQL Password Lifetime 664 | echo "default_password_lifetime = 0" >> /etc/mysql/mysql.conf.d/mysqld.cnf 665 | 666 | # Configure MySQL Remote Access 667 | sed -i '/^bind-address/s/bind-address.*=.*/bind-address = 0.0.0.0/' /etc/mysql/mysql.conf.d/mysqld.cnf 668 | service mysql restart 669 | 670 | export MYSQL_PWD=secret 671 | 672 | mysql --user="root" -e "ALTER USER 'root'@'localhost' IDENTIFIED BY 'secret';" 673 | mysql --user="root" -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION;" 674 | mysql --user="root" -e "CREATE USER 'homestead'@'0.0.0.0' IDENTIFIED BY 'secret';" 675 | mysql --user="root" -e "CREATE USER 'homestead'@'%' IDENTIFIED BY 'secret';" 676 | mysql --user="root" -e "GRANT ALL PRIVILEGES ON *.* TO 'homestead'@'0.0.0.0' WITH GRANT OPTION;" 677 | mysql --user="root" -e "GRANT ALL PRIVILEGES ON *.* TO 'homestead'@'%' WITH GRANT OPTION;" 678 | mysql --user="root" -e "FLUSH PRIVILEGES;" 679 | mysql --user="root" -e "CREATE DATABASE homestead character set UTF8mb4 collate utf8mb4_bin;" 680 | mysql --user="root" -e "SET GLOBAL time_zone = '+00:00';" 681 | mysql --user="root" -e "SET time_zone = '+00:00';" 682 | 683 | sudo tee /home/vagrant/.my.cnf < /etc/mysql/mariadb.conf.d/50-server.cnf << EOF 724 | [mysqld] 725 | bind-address = 0.0.0.0 726 | ignore-db-dir = lost+found 727 | #general_log 728 | #general_log_file=/var/log/mysql/mariadb.log 729 | EOF 730 | 731 | export MYSQL_PWD=secret 732 | 733 | mysql --user="root" -e "GRANT ALL ON *.* TO root@'0.0.0.0' IDENTIFIED BY 'secret' WITH GRANT OPTION;" 734 | service mysql restart 735 | 736 | mysql --user="root" -e "CREATE USER IF NOT EXISTS 'homestead'@'0.0.0.0' IDENTIFIED BY 'secret';" 737 | mysql --user="root" -e "GRANT ALL ON *.* TO 'homestead'@'0.0.0.0' IDENTIFIED BY 'secret' WITH GRANT OPTION;" 738 | mysql --user="root" -e "GRANT ALL ON *.* TO 'homestead'@'%' IDENTIFIED BY 'secret' WITH GRANT OPTION;" 739 | mysql --user="root" -e "FLUSH PRIVILEGES;" 740 | service mysql restart 741 | 742 | mysql_upgrade --user="root" --verbose --force 743 | service mysql restart 744 | 745 | unset MYSQL_PWD 746 | fi 747 | 748 | if "$SKIP_POSTGRESQL"; then 749 | echo "SKIP_POSTGRESQL is being used, so we're not installing PostgreSQL" 750 | else 751 | # Install Postgres 14 752 | apt-get install -y postgresql-15 postgresql-server-dev-15 postgresql-15-postgis-3 postgresql-15-postgis-3-scripts 753 | 754 | # Configure Postgres Users 755 | sudo -u postgres psql -c "CREATE ROLE homestead LOGIN PASSWORD 'secret' SUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION;" 756 | 757 | # Configure Postgres Remote Access 758 | sed -i "s/#listen_addresses = 'localhost'/listen_addresses = '*'/g" /etc/postgresql/15/main/postgresql.conf 759 | echo "host all all 10.0.2.2/32 md5" | tee -a /etc/postgresql/15/main/pg_hba.conf 760 | 761 | sudo -u postgres /usr/bin/createdb --echo --owner=homestead homestead 762 | service postgresql restart 763 | # Disable to lower initial overhead 764 | systemctl disable postgresql 765 | fi 766 | 767 | # Install Redis, Memcached, & Beanstalk 768 | apt-get install -y redis-server memcached beanstalkd 769 | systemctl enable redis-server 770 | service redis-server start 771 | 772 | # Configure Beanstalkd 773 | sed -i "s/#START=yes/START=yes/" /etc/default/beanstalkd 774 | 775 | # Install Golang 776 | if [[ "$ARCH" == "aarch64" ]]; then 777 | GOLANG_LATEST_STABLE_VERSION=$(curl https://go.dev/dl/?mode=json | grep -o 'go.*.linux-arm64.tar.gz' | head -n 1 | tr -d '\r\n') 778 | wget https://dl.google.com/go/${GOLANG_LATEST_STABLE_VERSION} -O golang.tar.gz 779 | else 780 | GOLANG_LATEST_STABLE_VERSION=$(curl https://go.dev/dl/?mode=json | grep -o 'go.*.linux-amd64.tar.gz' | head -n 1 | tr -d '\r\n') 781 | wget https://dl.google.com/go/${GOLANG_LATEST_STABLE_VERSION} -O golang.tar.gz 782 | fi 783 | 784 | tar -C /usr/local -xzf golang.tar.gz go 785 | printf "\nPATH=\"/usr/local/go/bin:\$PATH\"\n" | tee -a /home/vagrant/.profile 786 | rm -rf golang.tar.gz 787 | 788 | # Install & Configure Mailpit 789 | curl -sL https://raw.githubusercontent.com/axllent/mailpit/develop/install.sh | bash 790 | chmod +x /usr/local/bin/mailpit 791 | tee /etc/systemd/system/mailpit.service < Setup dpkg excludes for linux-firmware" 869 | cat <<_EOF_ | cat >> /etc/dpkg/dpkg.cfg.d/excludes 870 | #BENTO-BEGIN 871 | path-exclude=/lib/firmware/* 872 | path-exclude=/usr/share/doc/linux-firmware/* 873 | #BENTO-END 874 | _EOF_ 875 | 876 | # Delete the massive firmware packages 877 | rm -rf /lib/firmware/* 878 | rm -rf /usr/share/doc/linux-firmware/* 879 | 880 | apt-get -y autoremove; 881 | apt-get -y clean; 882 | 883 | # Remove docs 884 | rm -rf /usr/share/doc/* 885 | 886 | # Remove caches 887 | find /var/cache -type f -exec rm -rf {} \; 888 | 889 | # delete any logs that have built up during the install 890 | find /var/log/ -name *.log -exec rm -f {} \; 891 | 892 | # Disable sleep https://github.com/laravel/homestead/issues/1624 893 | systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target 894 | 895 | # What are you doing Ubuntu? 896 | # https://askubuntu.com/questions/1250974/user-root-cant-write-to-file-in-tmp-owned-by-someone-else-in-20-04-but-can-in 897 | sysctl fs.protected_regular=0 898 | 899 | # Blank netplan machine-id (DUID) so machines get unique ID generated on boot. 900 | truncate -s 0 /etc/machine-id 901 | 902 | # Enable Swap Memory 903 | /bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024 904 | /sbin/mkswap /var/swap.1 905 | /sbin/swapon /var/swap.1 906 | -------------------------------------------------------------------------------- /scripts/arm.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | export DEBIAN_FRONTEND=noninteractive 3 | 4 | ARCH=$(arch) 5 | 6 | SKIP_PHP=false 7 | SKIP_MYSQL=false 8 | SKIP_MARIADB=true 9 | SKIP_POSTGRESQL=false 10 | 11 | echo "### Settler Build Configuration ###" 12 | echo "ARCH = ${ARCH}" 13 | echo "SKIP_PHP = ${SKIP_PHP}" 14 | echo "SKIP_MYSQL = ${SKIP_MYSQL}" 15 | echo "SKIP_MARIADB = ${SKIP_MARIADB}" 16 | echo "SKIP_POSTGRESQL = ${SKIP_POSTGRESQL}" 17 | echo "### Settler Build Configuration ###" 18 | 19 | # Update Package List 20 | apt-get update 21 | 22 | # Update System Packages 23 | apt-get upgrade -y 24 | 25 | # Force Locale 26 | echo "LC_ALL=en_US.UTF-8" >> /etc/default/locale 27 | locale-gen en_US.UTF-8 28 | 29 | apt-get install -y software-properties-common curl gnupg debian-keyring debian-archive-keyring apt-transport-https \ 30 | ca-certificates 31 | 32 | # Install Some PPAs 33 | apt-add-repository ppa:ondrej/php -y 34 | 35 | # Prepare keyrings directory 36 | sudo mkdir -p /etc/apt/keyrings 37 | 38 | # NodeJS 39 | curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg 40 | echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_21.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list 41 | 42 | # PostgreSQL 43 | curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo gpg --dearmor -o /etc/apt/keyrings/postgresql.gpg 44 | sudo sh -c 'echo "deb [signed-by=/etc/apt/keyrings/postgresql.gpg] https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' 45 | 46 | ## Update Package Lists 47 | apt-get update -y 48 | 49 | # Install Some Basic Packages 50 | apt-get install -y build-essential dos2unix gcc git git-lfs libmcrypt4 libpcre3-dev libpng-dev chrony unzip make pv \ 51 | python3-pip re2c supervisor unattended-upgrades whois vim cifs-utils bash-completion zsh graphviz avahi-daemon tshark 52 | 53 | # Set My Timezone 54 | ln -sf /usr/share/zoneinfo/UTC /etc/localtime 55 | 56 | # Install docker-ce 57 | curl -fsSL https://get.docker.com | bash -s 58 | 59 | # Enable vagrant user to run docker commands 60 | usermod -aG docker vagrant 61 | 62 | # Install docker-compose 63 | curl \ 64 | -L "https://github.com/docker/compose/releases/download/2.23.0/docker-compose-$(uname -s)-$(uname -m)" \ 65 | -o /usr/local/bin/docker-compose 66 | chmod +x /usr/local/bin/docker-compose 67 | 68 | # Configure feature tracking path 69 | mkdir -p /home/vagrant/.homestead-features 70 | 71 | if "$SKIP_PHP"; then 72 | echo "SKIP_PHP is being used, so we're not installing PHP" 73 | else 74 | # Install Generic PHP packages 75 | apt-get install -y --allow-change-held-packages \ 76 | php-imagick php-memcached php-redis php-xdebug php-dev imagemagick mcrypt 77 | 78 | # PHP 5.6 79 | apt-get install -y --allow-change-held-packages \ 80 | php5.6-bcmath php5.6-bz2 php5.6-cgi php5.6-cli php5.6-common php5.6-curl php5.6-dba php5.6-dev php5.6-enchant \ 81 | php5.6-fpm php5.6-gd php5.6-gmp php5.6-imap php5.6-interbase php5.6-intl php5.6-json php5.6-ldap php5.6-mbstring \ 82 | php5.6-mcrypt php5.6-mysql php5.6-odbc php5.6-opcache php5.6-pgsql php5.6-phpdbg php5.6-pspell php5.6-readline \ 83 | php5.6-recode php5.6-snmp php5.6-soap php5.6-sqlite3 php5.6-sybase php5.6-tidy php5.6-xml php5.6-xmlrpc php5.6-xsl \ 84 | php5.6-zip php5.6-imagick php5.6-memcached php5.6-redis 85 | 86 | # Configure php.ini for CLI 87 | sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/5.6/cli/php.ini 88 | sed -i "s/display_errors = .*/display_errors = On/" /etc/php/5.6/cli/php.ini 89 | sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/5.6/cli/php.ini 90 | sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/5.6/cli/php.ini 91 | 92 | # Configure Xdebug 93 | echo "xdebug.remote_enable = 1" >> /etc/php/5.6/mods-available/xdebug.ini 94 | echo "xdebug.remote_connect_back = 1" >> /etc/php/5.6/mods-available/xdebug.ini 95 | echo "xdebug.remote_port = 9000" >> /etc/php/5.6/mods-available/xdebug.ini 96 | echo "xdebug.max_nesting_level = 512" >> /etc/php/5.6/mods-available/xdebug.ini 97 | echo "opcache.revalidate_freq = 0" >> /etc/php/5.6/mods-available/opcache.ini 98 | 99 | # Configure php.ini for FPM 100 | sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/5.6/fpm/php.ini 101 | sed -i "s/display_errors = .*/display_errors = On/" /etc/php/5.6/fpm/php.ini 102 | sed -i "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/" /etc/php/5.6/fpm/php.ini 103 | sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/5.6/fpm/php.ini 104 | sed -i "s/upload_max_filesize = .*/upload_max_filesize = 100M/" /etc/php/5.6/fpm/php.ini 105 | sed -i "s/post_max_size = .*/post_max_size = 100M/" /etc/php/5.6/fpm/php.ini 106 | sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/5.6/fpm/php.ini 107 | 108 | printf "[openssl]\n" | tee -a /etc/php/5.6/fpm/php.ini 109 | printf "openssl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/5.6/fpm/php.ini 110 | 111 | printf "[curl]\n" | tee -a /etc/php/5.6/fpm/php.ini 112 | printf "curl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/5.6/fpm/php.ini 113 | 114 | # Configure FPM 115 | sed -i "s/user = www-data/user = vagrant/" /etc/php/5.6/fpm/pool.d/www.conf 116 | sed -i "s/group = www-data/group = vagrant/" /etc/php/5.6/fpm/pool.d/www.conf 117 | sed -i "s/listen\.owner.*/listen.owner = vagrant/" /etc/php/5.6/fpm/pool.d/www.conf 118 | sed -i "s/listen\.group.*/listen.group = vagrant/" /etc/php/5.6/fpm/pool.d/www.conf 119 | sed -i "s/;listen\.mode.*/listen.mode = 0666/" /etc/php/5.6/fpm/pool.d/www.conf 120 | 121 | touch /home/vagrant/.homestead-features/php56 122 | 123 | # PHP 7.0 124 | apt-get install -y --allow-change-held-packages \ 125 | php7.0-bcmath php7.0-bz2 php7.0-cgi php7.0-cli php7.0-common php7.0-curl php7.0-dba php7.0-dev php7.0-enchant \ 126 | php7.0-fpm php7.0-gd php7.0-gmp php7.0-imap php7.0-interbase php7.0-intl php7.0-json php7.0-ldap php7.0-mbstring \ 127 | php7.0-mcrypt php7.0-mysql php7.0-odbc php7.0-opcache php7.0-pgsql php7.0-phpdbg php7.0-pspell php7.0-readline \ 128 | php7.0-recode php7.0-snmp php7.0-soap php7.0-sqlite3 php7.0-sybase php7.0-tidy php7.0-xml php7.0-xmlrpc php7.0-xsl \ 129 | php7.0-zip php7.0-imagick php7.0-memcached php7.0-redis 130 | 131 | # Configure php.ini for CLI 132 | sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/7.0/cli/php.ini 133 | sed -i "s/display_errors = .*/display_errors = On/" /etc/php/7.0/cli/php.ini 134 | sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/7.0/cli/php.ini 135 | sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/7.0/cli/php.ini 136 | 137 | # Configure Xdebug 138 | echo "xdebug.remote_enable = 1" >> /etc/php/7.0/mods-available/xdebug.ini 139 | echo "xdebug.remote_connect_back = 1" >> /etc/php/7.0/mods-available/xdebug.ini 140 | echo "xdebug.remote_port = 9000" >> /etc/php/7.0/mods-available/xdebug.ini 141 | echo "xdebug.max_nesting_level = 512" >> /etc/php/7.0/mods-available/xdebug.ini 142 | echo "opcache.revalidate_freq = 0" >> /etc/php/7.0/mods-available/opcache.ini 143 | 144 | # Configure php.ini for FPM 145 | sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/7.0/fpm/php.ini 146 | sed -i "s/display_errors = .*/display_errors = On/" /etc/php/7.0/fpm/php.ini 147 | sed -i "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/" /etc/php/7.0/fpm/php.ini 148 | sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/7.0/fpm/php.ini 149 | sed -i "s/upload_max_filesize = .*/upload_max_filesize = 100M/" /etc/php/7.0/fpm/php.ini 150 | sed -i "s/post_max_size = .*/post_max_size = 100M/" /etc/php/7.0/fpm/php.ini 151 | sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/7.0/fpm/php.ini 152 | 153 | printf "[openssl]\n" | tee -a /etc/php/7.0/fpm/php.ini 154 | printf "openssl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/7.0/fpm/php.ini 155 | printf "[curl]\n" | tee -a /etc/php/7.0/fpm/php.ini 156 | printf "curl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/7.0/fpm/php.ini 157 | 158 | # Configure FPM 159 | sed -i "s/user = www-data/user = vagrant/" /etc/php/7.0/fpm/pool.d/www.conf 160 | sed -i "s/group = www-data/group = vagrant/" /etc/php/7.0/fpm/pool.d/www.conf 161 | sed -i "s/listen\.owner.*/listen.owner = vagrant/" /etc/php/7.0/fpm/pool.d/www.conf 162 | sed -i "s/listen\.group.*/listen.group = vagrant/" /etc/php/7.0/fpm/pool.d/www.conf 163 | sed -i "s/;listen\.mode.*/listen.mode = 0666/" /etc/php/7.0/fpm/pool.d/www.conf 164 | 165 | touch /home/vagrant/.homestead-features/php70 166 | 167 | # PHP 7.1 168 | apt-get install -y --allow-change-held-packages \ 169 | php7.1-bcmath php7.1-bz2 php7.1-cgi php7.1-cli php7.1-common php7.1-curl php7.1-dba php7.1-dev php7.1-enchant \ 170 | php7.1-fpm php7.1-gd php7.1-gmp php7.1-imap php7.1-interbase php7.1-intl php7.1-json php7.1-ldap php7.1-mbstring \ 171 | php7.1-mcrypt php7.1-mysql php7.1-odbc php7.1-opcache php7.1-pgsql php7.1-phpdbg php7.1-pspell php7.1-readline \ 172 | php7.1-recode php7.1-snmp php7.1-soap php7.1-sqlite3 php7.1-sybase php7.1-tidy php7.1-xdebug php7.1-xml php7.1-xmlrpc \ 173 | php7.1-xsl php7.1-zip php7.1-imagick php7.1-memcached php7.1-redis 174 | 175 | # Configure php.ini for CLI 176 | sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/7.1/cli/php.ini 177 | sed -i "s/display_errors = .*/display_errors = On/" /etc/php/7.1/cli/php.ini 178 | sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/7.1/cli/php.ini 179 | sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/7.1/cli/php.ini 180 | 181 | # Configure Xdebug 182 | echo "xdebug.remote_enable = 1" >> /etc/php/7.1/mods-available/xdebug.ini 183 | echo "xdebug.remote_connect_back = 1" >> /etc/php/7.1/mods-available/xdebug.ini 184 | echo "xdebug.remote_port = 9000" >> /etc/php/7.1/mods-available/xdebug.ini 185 | echo "xdebug.max_nesting_level = 512" >> /etc/php/7.1/mods-available/xdebug.ini 186 | echo "opcache.revalidate_freq = 0" >> /etc/php/7.1/mods-available/opcache.ini 187 | 188 | # Configure php.ini for FPM 189 | sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/7.1/fpm/php.ini 190 | sed -i "s/display_errors = .*/display_errors = On/" /etc/php/7.1/fpm/php.ini 191 | sed -i "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/" /etc/php/7.1/fpm/php.ini 192 | sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/7.1/fpm/php.ini 193 | sed -i "s/upload_max_filesize = .*/upload_max_filesize = 100M/" /etc/php/7.1/fpm/php.ini 194 | sed -i "s/post_max_size = .*/post_max_size = 100M/" /etc/php/7.1/fpm/php.ini 195 | sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/7.1/fpm/php.ini 196 | 197 | printf "[openssl]\n" | tee -a /etc/php/7.1/fpm/php.ini 198 | printf "openssl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/7.1/fpm/php.ini 199 | printf "[curl]\n" | tee -a /etc/php/7.1/fpm/php.ini 200 | printf "curl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/7.1/fpm/php.ini 201 | 202 | # Configure FPM 203 | sed -i "s/user = www-data/user = vagrant/" /etc/php/7.1/fpm/pool.d/www.conf 204 | sed -i "s/group = www-data/group = vagrant/" /etc/php/7.1/fpm/pool.d/www.conf 205 | sed -i "s/listen\.owner.*/listen.owner = vagrant/" /etc/php/7.1/fpm/pool.d/www.conf 206 | sed -i "s/listen\.group.*/listen.group = vagrant/" /etc/php/7.1/fpm/pool.d/www.conf 207 | sed -i "s/;listen\.mode.*/listen.mode = 0666/" /etc/php/7.1/fpm/pool.d/www.conf 208 | 209 | touch /home/vagrant/.homestead-features/php71 210 | 211 | # PHP 7.2 212 | apt-get install -y --allow-change-held-packages \ 213 | php7.2-bcmath php7.2-bz2 php7.2-dba php7.2-enchant php7.2-fpm php7.2-imap php7.2-interbase php7.2-intl \ 214 | php7.2-mbstring php7.2-phpdbg php7.2-soap php7.2-sybase php7.2-xsl php7.2-zip php7.2-cgi php7.2-cli php7.2-common \ 215 | php7.2-curl php7.2-dev php7.2-gd php7.2-gmp php7.2-json php7.2-ldap php7.2-mysql php7.2-odbc php7.2-opcache \ 216 | php7.2-pgsql php7.2-pspell php7.2-readline php7.2-recode php7.2-snmp php7.2-sqlite3 php7.2-tidy php7.2-xdebug \ 217 | php7.2-xml php7.2-xmlrpc php7.2-imagick php7.2-memcached php7.2-redis 218 | 219 | # Configure php.ini for CLI 220 | sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/7.2/cli/php.ini 221 | sed -i "s/display_errors = .*/display_errors = On/" /etc/php/7.2/cli/php.ini 222 | sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/7.2/cli/php.ini 223 | sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/7.2/cli/php.ini 224 | 225 | # Configure Xdebug 226 | echo "xdebug.mode = debug" >> /etc/php/7.2/mods-available/xdebug.ini 227 | echo "xdebug.discover_client_host = true" >> /etc/php/7.2/mods-available/xdebug.ini 228 | echo "xdebug.client_port = 9003" >> /etc/php/7.2/mods-available/xdebug.ini 229 | echo "xdebug.max_nesting_level = 512" >> /etc/php/7.2/mods-available/xdebug.ini 230 | echo "opcache.revalidate_freq = 0" >> /etc/php/7.2/mods-available/opcache.ini 231 | 232 | # Configure php.ini for FPM 233 | sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/7.2/fpm/php.ini 234 | sed -i "s/display_errors = .*/display_errors = On/" /etc/php/7.2/fpm/php.ini 235 | sed -i "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/" /etc/php/7.2/fpm/php.ini 236 | sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/7.2/fpm/php.ini 237 | sed -i "s/upload_max_filesize = .*/upload_max_filesize = 100M/" /etc/php/7.2/fpm/php.ini 238 | sed -i "s/post_max_size = .*/post_max_size = 100M/" /etc/php/7.2/fpm/php.ini 239 | sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/7.2/fpm/php.ini 240 | 241 | printf "[openssl]\n" | tee -a /etc/php/7.2/fpm/php.ini 242 | printf "openssl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/7.2/fpm/php.ini 243 | printf "[curl]\n" | tee -a /etc/php/7.2/fpm/php.ini 244 | printf "curl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/7.2/fpm/php.ini 245 | 246 | # Configure FPM 247 | sed -i "s/user = www-data/user = vagrant/" /etc/php/7.2/fpm/pool.d/www.conf 248 | sed -i "s/group = www-data/group = vagrant/" /etc/php/7.2/fpm/pool.d/www.conf 249 | 250 | sed -i "s/listen\.owner.*/listen.owner = vagrant/" /etc/php/7.2/fpm/pool.d/www.conf 251 | sed -i "s/listen\.group.*/listen.group = vagrant/" /etc/php/7.2/fpm/pool.d/www.conf 252 | sed -i "s/;listen\.mode.*/listen.mode = 0666/" /etc/php/7.2/fpm/pool.d/www.conf 253 | 254 | touch /home/vagrant/.homestead-features/php72 255 | 256 | # PHP 7.3 257 | apt-get install -y --allow-change-held-packages \ 258 | php7.3 php7.3-bcmath php7.3-bz2 php7.3-cgi php7.3-cli php7.3-common php7.3-curl php7.3-dba php7.3-dev php7.3-enchant \ 259 | php7.3-fpm php7.3-gd php7.3-gmp php7.3-imap php7.3-interbase php7.3-intl php7.3-json php7.3-ldap php7.3-mbstring \ 260 | php7.3-mysql php7.3-odbc php7.3-opcache php7.3-pgsql php7.3-phpdbg php7.3-pspell php7.3-readline php7.3-recode \ 261 | php7.3-snmp php7.3-soap php7.3-sqlite3 php7.3-sybase php7.3-tidy php7.3-xdebug php7.3-xml php7.3-xmlrpc php7.3-xsl \ 262 | php7.3-zip php7.3-imagick php7.3-memcached php7.3-redis 263 | 264 | # Configure php.ini for CLI 265 | sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/7.3/cli/php.ini 266 | sed -i "s/display_errors = .*/display_errors = On/" /etc/php/7.3/cli/php.ini 267 | sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/7.3/cli/php.ini 268 | sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/7.3/cli/php.ini 269 | 270 | # Configure Xdebug 271 | echo "xdebug.mode = debug" >> /etc/php/7.3/mods-available/xdebug.ini 272 | echo "xdebug.discover_client_host = true" >> /etc/php/7.3/mods-available/xdebug.ini 273 | echo "xdebug.client_port = 9003" >> /etc/php/7.3/mods-available/xdebug.ini 274 | echo "xdebug.max_nesting_level = 512" >> /etc/php/7.3/mods-available/xdebug.ini 275 | echo "opcache.revalidate_freq = 0" >> /etc/php/7.3/mods-available/opcache.ini 276 | 277 | # Configure php.ini for FPM 278 | sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/7.3/fpm/php.ini 279 | sed -i "s/display_errors = .*/display_errors = On/" /etc/php/7.3/fpm/php.ini 280 | sed -i "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/" /etc/php/7.3/fpm/php.ini 281 | sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/7.3/fpm/php.ini 282 | sed -i "s/upload_max_filesize = .*/upload_max_filesize = 100M/" /etc/php/7.3/fpm/php.ini 283 | sed -i "s/post_max_size = .*/post_max_size = 100M/" /etc/php/7.3/fpm/php.ini 284 | sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/7.3/fpm/php.ini 285 | 286 | printf "[openssl]\n" | tee -a /etc/php/7.3/fpm/php.ini 287 | printf "openssl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/7.3/fpm/php.ini 288 | printf "[curl]\n" | tee -a /etc/php/7.3/fpm/php.ini 289 | printf "curl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/7.3/fpm/php.ini 290 | 291 | # Configure FPM 292 | sed -i "s/user = www-data/user = vagrant/" /etc/php/7.3/fpm/pool.d/www.conf 293 | sed -i "s/group = www-data/group = vagrant/" /etc/php/7.3/fpm/pool.d/www.conf 294 | sed -i "s/listen\.owner.*/listen.owner = vagrant/" /etc/php/7.3/fpm/pool.d/www.conf 295 | sed -i "s/listen\.group.*/listen.group = vagrant/" /etc/php/7.3/fpm/pool.d/www.conf 296 | sed -i "s/;listen\.mode.*/listen.mode = 0666/" /etc/php/7.3/fpm/pool.d/www.conf 297 | 298 | touch /home/vagrant/.homestead-features/php73 299 | 300 | # PHP 7.4 301 | apt-get install -y --allow-change-held-packages \ 302 | php7.4 php7.4-bcmath php7.4-bz2 php7.4-cgi php7.4-cli php7.4-common php7.4-curl php7.4-dba php7.4-dev \ 303 | php7.4-enchant php7.4-fpm php7.4-gd php7.4-gmp php7.4-imap php7.4-interbase php7.4-intl php7.4-json php7.4-ldap \ 304 | php7.4-mbstring php7.4-mysql php7.4-odbc php7.4-opcache php7.4-pgsql php7.4-phpdbg php7.4-pspell php7.4-readline \ 305 | php7.4-snmp php7.4-soap php7.4-sqlite3 php7.4-sybase php7.4-tidy php7.4-xdebug php7.4-xml php7.4-xmlrpc php7.4-xsl \ 306 | php7.4-zip php7.4-imagick php7.4-memcached php7.4-redis 307 | 308 | # Configure php.ini for CLI 309 | sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/7.4/cli/php.ini 310 | sed -i "s/display_errors = .*/display_errors = On/" /etc/php/7.4/cli/php.ini 311 | sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/7.4/cli/php.ini 312 | sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/7.4/cli/php.ini 313 | 314 | # Configure Xdebug 315 | echo "xdebug.mode = debug" >> /etc/php/7.4/mods-available/xdebug.ini 316 | echo "xdebug.discover_client_host = true" >> /etc/php/7.4/mods-available/xdebug.ini 317 | echo "xdebug.client_port = 9003" >> /etc/php/7.4/mods-available/xdebug.ini 318 | echo "xdebug.max_nesting_level = 512" >> /etc/php/7.4/mods-available/xdebug.ini 319 | echo "opcache.revalidate_freq = 0" >> /etc/php/7.4/mods-available/opcache.ini 320 | 321 | # Configure php.ini for FPM 322 | sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/7.4/fpm/php.ini 323 | sed -i "s/display_errors = .*/display_errors = On/" /etc/php/7.4/fpm/php.ini 324 | sed -i "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/" /etc/php/7.4/fpm/php.ini 325 | sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/7.4/fpm/php.ini 326 | sed -i "s/upload_max_filesize = .*/upload_max_filesize = 100M/" /etc/php/7.4/fpm/php.ini 327 | sed -i "s/post_max_size = .*/post_max_size = 100M/" /etc/php/7.4/fpm/php.ini 328 | sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/7.4/fpm/php.ini 329 | 330 | printf "[openssl]\n" | tee -a /etc/php/7.4/fpm/php.ini 331 | printf "openssl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/7.4/fpm/php.ini 332 | printf "[curl]\n" | tee -a /etc/php/7.4/fpm/php.ini 333 | printf "curl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/7.4/fpm/php.ini 334 | 335 | # Configure FPM 336 | sed -i "s/user = www-data/user = vagrant/" /etc/php/7.4/fpm/pool.d/www.conf 337 | sed -i "s/group = www-data/group = vagrant/" /etc/php/7.4/fpm/pool.d/www.conf 338 | sed -i "s/listen\.owner.*/listen.owner = vagrant/" /etc/php/7.4/fpm/pool.d/www.conf 339 | sed -i "s/listen\.group.*/listen.group = vagrant/" /etc/php/7.4/fpm/pool.d/www.conf 340 | sed -i "s/;listen\.mode.*/listen.mode = 0666/" /etc/php/7.4/fpm/pool.d/www.conf 341 | 342 | touch /home/vagrant/.homestead-features/php74 343 | 344 | # PHP 8.0 345 | apt-get install -y --allow-change-held-packages \ 346 | php8.0 php8.0-bcmath php8.0-bz2 php8.0-cgi php8.0-cli php8.0-common php8.0-curl php8.0-dba php8.0-dev \ 347 | php8.0-enchant php8.0-fpm php8.0-gd php8.0-gmp php8.0-imap php8.0-interbase php8.0-intl php8.0-ldap \ 348 | php8.0-mbstring php8.0-mysql php8.0-odbc php8.0-opcache php8.0-pgsql php8.0-phpdbg php8.0-pspell php8.0-readline \ 349 | php8.0-snmp php8.0-soap php8.0-sqlite3 php8.0-sybase php8.0-tidy php8.0-xdebug php8.0-xml php8.0-xmlrpc php8.0-xsl \ 350 | php8.0-zip php8.0-imagick php8.0-memcached php8.0-redis 351 | 352 | # Configure php.ini for CLI 353 | sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/8.0/cli/php.ini 354 | sed -i "s/display_errors = .*/display_errors = On/" /etc/php/8.0/cli/php.ini 355 | sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/8.0/cli/php.ini 356 | sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/8.0/cli/php.ini 357 | 358 | # Configure Xdebug 359 | echo "xdebug.mode = debug" >> /etc/php/8.0/mods-available/xdebug.ini 360 | echo "xdebug.discover_client_host = true" >> /etc/php/8.0/mods-available/xdebug.ini 361 | echo "xdebug.client_port = 9003" >> /etc/php/8.0/mods-available/xdebug.ini 362 | echo "xdebug.max_nesting_level = 512" >> /etc/php/8.0/mods-available/xdebug.ini 363 | echo "opcache.revalidate_freq = 0" >> /etc/php/8.0/mods-available/opcache.ini 364 | 365 | # Configure php.ini for FPM 366 | sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/8.0/fpm/php.ini 367 | sed -i "s/display_errors = .*/display_errors = On/" /etc/php/8.0/fpm/php.ini 368 | sed -i "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/" /etc/php/8.0/fpm/php.ini 369 | sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/8.0/fpm/php.ini 370 | sed -i "s/upload_max_filesize = .*/upload_max_filesize = 100M/" /etc/php/8.0/fpm/php.ini 371 | sed -i "s/post_max_size = .*/post_max_size = 100M/" /etc/php/8.0/fpm/php.ini 372 | sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/8.0/fpm/php.ini 373 | 374 | printf "[openssl]\n" | tee -a /etc/php/8.0/fpm/php.ini 375 | printf "openssl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/8.0/fpm/php.ini 376 | printf "[curl]\n" | tee -a /etc/php/8.0/fpm/php.ini 377 | printf "curl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/8.0/fpm/php.ini 378 | 379 | # Configure FPM 380 | sed -i "s/user = www-data/user = vagrant/" /etc/php/8.0/fpm/pool.d/www.conf 381 | sed -i "s/group = www-data/group = vagrant/" /etc/php/8.0/fpm/pool.d/www.conf 382 | sed -i "s/listen\.owner.*/listen.owner = vagrant/" /etc/php/8.0/fpm/pool.d/www.conf 383 | sed -i "s/listen\.group.*/listen.group = vagrant/" /etc/php/8.0/fpm/pool.d/www.conf 384 | sed -i "s/;listen\.mode.*/listen.mode = 0666/" /etc/php/8.0/fpm/pool.d/www.conf 385 | 386 | touch /home/vagrant/.homestead-features/php80 387 | 388 | # PHP 8.1 389 | apt-get install -y --allow-change-held-packages \ 390 | php8.1 php8.1-bcmath php8.1-bz2 php8.1-cgi php8.1-cli php8.1-common php8.1-curl php8.1-dba php8.1-dev \ 391 | php8.1-enchant php8.1-fpm php8.1-gd php8.1-gmp php8.1-imap php8.1-interbase php8.1-intl php8.1-ldap \ 392 | php8.1-mbstring php8.1-mysql php8.1-odbc php8.1-opcache php8.1-pgsql php8.1-phpdbg php8.1-pspell php8.1-readline \ 393 | php8.1-snmp php8.1-soap php8.1-sqlite3 php8.1-sybase php8.1-tidy php8.1-xdebug php8.1-xml php8.1-xmlrpc php8.1-xsl \ 394 | php8.1-zip php8.1-imagick php8.1-memcached php8.1-redis 395 | 396 | # Configure php.ini for CLI 397 | sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/8.1/cli/php.ini 398 | sed -i "s/display_errors = .*/display_errors = On/" /etc/php/8.1/cli/php.ini 399 | sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/8.1/cli/php.ini 400 | sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/8.1/cli/php.ini 401 | 402 | # Configure Xdebug 403 | echo "xdebug.mode = debug" >> /etc/php/8.1/mods-available/xdebug.ini 404 | echo "xdebug.discover_client_host = true" >> /etc/php/8.1/mods-available/xdebug.ini 405 | echo "xdebug.client_port = 9003" >> /etc/php/8.1/mods-available/xdebug.ini 406 | echo "xdebug.max_nesting_level = 512" >> /etc/php/8.1/mods-available/xdebug.ini 407 | echo "opcache.revalidate_freq = 0" >> /etc/php/8.1/mods-available/opcache.ini 408 | 409 | # Configure php.ini for FPM 410 | sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/8.1/fpm/php.ini 411 | sed -i "s/display_errors = .*/display_errors = On/" /etc/php/8.1/fpm/php.ini 412 | sed -i "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/" /etc/php/8.1/fpm/php.ini 413 | sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/8.1/fpm/php.ini 414 | sed -i "s/upload_max_filesize = .*/upload_max_filesize = 100M/" /etc/php/8.1/fpm/php.ini 415 | sed -i "s/post_max_size = .*/post_max_size = 100M/" /etc/php/8.1/fpm/php.ini 416 | sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/8.1/fpm/php.ini 417 | 418 | printf "[openssl]\n" | tee -a /etc/php/8.1/fpm/php.ini 419 | printf "openssl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/8.1/fpm/php.ini 420 | printf "[curl]\n" | tee -a /etc/php/8.1/fpm/php.ini 421 | printf "curl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/8.1/fpm/php.ini 422 | 423 | # Configure FPM 424 | sed -i "s/user = www-data/user = vagrant/" /etc/php/8.1/fpm/pool.d/www.conf 425 | sed -i "s/group = www-data/group = vagrant/" /etc/php/8.1/fpm/pool.d/www.conf 426 | sed -i "s/listen\.owner.*/listen.owner = vagrant/" /etc/php/8.1/fpm/pool.d/www.conf 427 | sed -i "s/listen\.group.*/listen.group = vagrant/" /etc/php/8.1/fpm/pool.d/www.conf 428 | sed -i "s/;listen\.mode.*/listen.mode = 0666/" /etc/php/8.1/fpm/pool.d/www.conf 429 | 430 | touch /home/vagrant/.homestead-features/php81 431 | 432 | # PHP 8.2 433 | apt-get install -y --allow-change-held-packages \ 434 | php8.2 php8.2-bcmath php8.2-bz2 php8.2-cgi php8.2-cli php8.2-common php8.2-curl php8.2-dba php8.2-dev \ 435 | php8.2-enchant php8.2-fpm php8.2-gd php8.2-gmp php8.2-imap php8.2-interbase php8.2-intl php8.2-ldap \ 436 | php8.2-mbstring php8.2-mysql php8.2-odbc php8.2-opcache php8.2-pgsql php8.2-phpdbg php8.2-pspell php8.2-readline \ 437 | php8.2-snmp php8.2-soap php8.2-sqlite3 php8.2-sybase php8.2-tidy php8.2-xml php8.2-xsl \ 438 | php8.2-zip php8.2-imagick php8.2-memcached php8.2-redis php8.2-xmlrpc php8.2-xdebug 439 | 440 | # Configure php.ini for CLI 441 | sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/8.2/cli/php.ini 442 | sed -i "s/display_errors = .*/display_errors = On/" /etc/php/8.2/cli/php.ini 443 | sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/8.2/cli/php.ini 444 | sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/8.2/cli/php.ini 445 | 446 | # Configure Xdebug 447 | echo "xdebug.mode = debug" >> /etc/php/8.2/mods-available/xdebug.ini 448 | echo "xdebug.discover_client_host = true" >> /etc/php/8.2/mods-available/xdebug.ini 449 | echo "xdebug.client_port = 9003" >> /etc/php/8.2/mods-available/xdebug.ini 450 | echo "xdebug.max_nesting_level = 512" >> /etc/php/8.2/mods-available/xdebug.ini 451 | echo "opcache.revalidate_freq = 0" >> /etc/php/8.2/mods-available/opcache.ini 452 | 453 | # Configure php.ini for FPM 454 | sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/8.2/fpm/php.ini 455 | sed -i "s/display_errors = .*/display_errors = On/" /etc/php/8.2/fpm/php.ini 456 | sed -i "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/" /etc/php/8.2/fpm/php.ini 457 | sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/8.2/fpm/php.ini 458 | sed -i "s/upload_max_filesize = .*/upload_max_filesize = 100M/" /etc/php/8.2/fpm/php.ini 459 | sed -i "s/post_max_size = .*/post_max_size = 100M/" /etc/php/8.2/fpm/php.ini 460 | sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/8.2/fpm/php.ini 461 | 462 | printf "[openssl]\n" | tee -a /etc/php/8.2/fpm/php.ini 463 | printf "openssl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/8.2/fpm/php.ini 464 | printf "[curl]\n" | tee -a /etc/php/8.2/fpm/php.ini 465 | printf "curl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/8.2/fpm/php.ini 466 | 467 | # Configure FPM 468 | sed -i "s/user = www-data/user = vagrant/" /etc/php/8.2/fpm/pool.d/www.conf 469 | sed -i "s/group = www-data/group = vagrant/" /etc/php/8.2/fpm/pool.d/www.conf 470 | sed -i "s/listen\.owner.*/listen.owner = vagrant/" /etc/php/8.2/fpm/pool.d/www.conf 471 | sed -i "s/listen\.group.*/listen.group = vagrant/" /etc/php/8.2/fpm/pool.d/www.conf 472 | sed -i "s/;listen\.mode.*/listen.mode = 0666/" /etc/php/8.2/fpm/pool.d/www.conf 473 | 474 | touch /home/vagrant/.homestead-features/php82 475 | 476 | # PHP 8.3 477 | apt-get install -y --allow-change-held-packages \ 478 | php8.3 php8.3-bcmath php8.3-bz2 php8.3-cgi php8.3-cli php8.3-common php8.3-curl php8.3-dba php8.3-dev \ 479 | php8.3-enchant php8.3-fpm php8.3-gd php8.3-gmp php8.3-imap php8.3-interbase php8.3-intl php8.3-ldap \ 480 | php8.3-mbstring php8.3-mysql php8.3-odbc php8.3-opcache php8.3-pgsql php8.3-phpdbg php8.3-pspell php8.3-readline \ 481 | php8.3-snmp php8.3-soap php8.3-sqlite3 php8.3-sybase php8.3-tidy php8.3-xml php8.3-xsl \ 482 | php8.3-zip php8.3-imagick php8.3-memcached php8.3-redis php8.3-xmlrpc php8.3-xdebug 483 | 484 | # Configure php.ini for CLI 485 | sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/8.3/cli/php.ini 486 | sed -i "s/display_errors = .*/display_errors = On/" /etc/php/8.3/cli/php.ini 487 | sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/8.3/cli/php.ini 488 | sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/8.3/cli/php.ini 489 | 490 | # Configure Xdebug 491 | echo "xdebug.mode = debug" >> /etc/php/8.3/mods-available/xdebug.ini 492 | echo "xdebug.discover_client_host = true" >> /etc/php/8.3/mods-available/xdebug.ini 493 | echo "xdebug.client_port = 9003" >> /etc/php/8.3/mods-available/xdebug.ini 494 | echo "xdebug.max_nesting_level = 512" >> /etc/php/8.3/mods-available/xdebug.ini 495 | echo "opcache.revalidate_freq = 0" >> /etc/php/8.3/mods-available/opcache.ini 496 | 497 | # Configure php.ini for FPM 498 | sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/8.3/fpm/php.ini 499 | sed -i "s/display_errors = .*/display_errors = On/" /etc/php/8.3/fpm/php.ini 500 | sed -i "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/" /etc/php/8.3/fpm/php.ini 501 | sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/8.3/fpm/php.ini 502 | sed -i "s/upload_max_filesize = .*/upload_max_filesize = 100M/" /etc/php/8.3/fpm/php.ini 503 | sed -i "s/post_max_size = .*/post_max_size = 100M/" /etc/php/8.3/fpm/php.ini 504 | sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/8.3/fpm/php.ini 505 | 506 | printf "[openssl]\n" | tee -a /etc/php/8.3/fpm/php.ini 507 | printf "openssl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/8.3/fpm/php.ini 508 | printf "[curl]\n" | tee -a /etc/php/8.3/fpm/php.ini 509 | printf "curl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/8.3/fpm/php.ini 510 | 511 | # Configure FPM 512 | sed -i "s/user = www-data/user = vagrant/" /etc/php/8.3/fpm/pool.d/www.conf 513 | sed -i "s/group = www-data/group = vagrant/" /etc/php/8.3/fpm/pool.d/www.conf 514 | sed -i "s/listen\.owner.*/listen.owner = vagrant/" /etc/php/8.3/fpm/pool.d/www.conf 515 | sed -i "s/listen\.group.*/listen.group = vagrant/" /etc/php/8.3/fpm/pool.d/www.conf 516 | sed -i "s/;listen\.mode.*/listen.mode = 0666/" /etc/php/8.3/fpm/pool.d/www.conf 517 | 518 | touch /home/vagrant/.homestead-features/php83 519 | 520 | # Disable old PHP FPM 521 | systemctl disable php5.6-fpm 522 | systemctl disable php7.0-fpm 523 | systemctl disable php7.1-fpm 524 | systemctl disable php7.2-fpm 525 | systemctl disable php7.3-fpm 526 | systemctl disable php7.4-fpm 527 | systemctl disable php8.0-fpm 528 | systemctl disable php8.1-fpm 529 | systemctl disable php8.2-fpm 530 | 531 | update-alternatives --set php /usr/bin/php8.3 532 | update-alternatives --set php-config /usr/bin/php-config8.3 533 | update-alternatives --set phpize /usr/bin/phpize8.3 534 | 535 | # Install Composer 536 | curl -sS https://getcomposer.org/installer | php 537 | mv composer.phar /usr/local/bin/composer 538 | chown -R vagrant:vagrant /home/vagrant/.config 539 | 540 | # Install Global Packages 541 | sudo su vagrant <<'EOF' 542 | /usr/local/bin/composer global require "laravel/envoy=^2.0" 543 | /usr/local/bin/composer global require "laravel/installer=^5.0" 544 | /usr/local/bin/composer global config --no-plugins allow-plugins.slince/composer-registry-manager true 545 | /usr/local/bin/composer global require "slince/composer-registry-manager=^2.0" 546 | EOF 547 | 548 | # Install Apache 549 | apt-get install -y apache2 libapache2-mod-fcgid 550 | sed -i "s/www-data/vagrant/" /etc/apache2/envvars 551 | 552 | # Enable FPM 553 | a2enconf php8.3-fpm 554 | 555 | # Assume user wants mode_rewrite support 556 | sudo a2enmod rewrite 557 | 558 | # Turn on HTTPS support 559 | sudo a2enmod ssl 560 | 561 | # Turn on proxy & fcgi 562 | sudo a2enmod proxy proxy_fcgi 563 | 564 | # Turn on headers support 565 | sudo a2enmod headers actions alias 566 | 567 | # Add Mutex to config to prevent auto restart issues 568 | if [ -z "$(grep '^Mutex posixsem$' /etc/apache2/apache2.conf)" ] 569 | then 570 | echo 'Mutex posixsem' | sudo tee -a /etc/apache2/apache2.conf 571 | fi 572 | 573 | a2dissite 000-default 574 | systemctl disable apache2 575 | 576 | # Install Nginx 577 | apt-get install -y --allow-downgrades --allow-remove-essential --allow-change-held-packages nginx 578 | 579 | rm /etc/nginx/sites-enabled/default 580 | rm /etc/nginx/sites-available/default 581 | 582 | # Create a configuration file for Nginx overrides. 583 | mkdir -p /home/vagrant/.config/nginx 584 | chown -R vagrant:vagrant /home/vagrant 585 | touch /home/vagrant/.config/nginx/nginx.conf 586 | ln -sf /home/vagrant/.config/nginx/nginx.conf /etc/nginx/conf.d/nginx.conf 587 | 588 | # Setup Some PHP-FPM Options 589 | sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/8.0/fpm/php.ini 590 | sed -i "s/display_errors = .*/display_errors = On/" /etc/php/8.0/fpm/php.ini 591 | sed -i "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/" /etc/php/8.0/fpm/php.ini 592 | sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/8.0/fpm/php.ini 593 | sed -i "s/upload_max_filesize = .*/upload_max_filesize = 100M/" /etc/php/8.0/fpm/php.ini 594 | sed -i "s/post_max_size = .*/post_max_size = 100M/" /etc/php/8.0/fpm/php.ini 595 | sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/8.0/fpm/php.ini 596 | 597 | printf "[openssl]\n" | tee -a /etc/php/8.0/fpm/php.ini 598 | printf "openssl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/8.0/fpm/php.ini 599 | 600 | printf "[curl]\n" | tee -a /etc/php/8.0/fpm/php.ini 601 | printf "curl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/8.0/fpm/php.ini 602 | 603 | # Disable XDebug On The CLI 604 | sudo phpdismod -s cli xdebug 605 | 606 | # Set The Nginx & PHP-FPM User 607 | sed -i "s/user www-data;/user vagrant;/" /etc/nginx/nginx.conf 608 | sed -i "s/# server_names_hash_bucket_size.*/server_names_hash_bucket_size 64;/" /etc/nginx/nginx.conf 609 | sed -i "s/sendfile on;/sendfile on; client_max_body_size 100M;/" /etc/nginx/nginx.conf 610 | 611 | sed -i "s/user = www-data/user = vagrant/" /etc/php/8.0/fpm/pool.d/www.conf 612 | sed -i "s/group = www-data/group = vagrant/" /etc/php/8.0/fpm/pool.d/www.conf 613 | 614 | sed -i "s/listen\.owner.*/listen.owner = vagrant/" /etc/php/8.0/fpm/pool.d/www.conf 615 | sed -i "s/listen\.group.*/listen.group = vagrant/" /etc/php/8.0/fpm/pool.d/www.conf 616 | sed -i "s/;listen\.mode.*/listen.mode = 0666/" /etc/php/8.0/fpm/pool.d/www.conf 617 | 618 | service nginx restart 619 | service php8.3-fpm restart 620 | 621 | # Add Vagrant User To WWW-Data 622 | usermod -a -G www-data vagrant 623 | id vagrant 624 | groups vagrant 625 | 626 | # Install wp-cli 627 | curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar 628 | chmod +x wp-cli.phar 629 | mv wp-cli.phar /usr/local/bin/wp 630 | 631 | # Add Composer Global Bin To Path 632 | printf "\nPATH=\"$(sudo su - vagrant -c 'composer config -g home 2>/dev/null')/vendor/bin:\$PATH\"\n" | tee -a /home/vagrant/.profile 633 | fi 634 | 635 | # Install Node 636 | apt-get install -y nodejs 637 | /usr/bin/npm install -g npm 638 | /usr/bin/npm install -g gulp-cli 639 | /usr/bin/npm install -g bower 640 | /usr/bin/npm install -g yarn 641 | /usr/bin/npm install -g grunt-cli 642 | 643 | # Install SQLite 644 | apt-get install -y sqlite3 libsqlite3-dev 645 | 646 | if "$SKIP_MYSQL"; then 647 | echo "SKIP_MYSQL is being used, so we're not installing MySQL" 648 | apt-get install -y mysql-client 649 | else 650 | # Install MySQL 651 | echo "mysql-server mysql-server/root_password password secret" | debconf-set-selections 652 | echo "mysql-server mysql-server/root_password_again password secret" | debconf-set-selections 653 | apt-get install -y mysql-server 654 | 655 | # Configure MySQL 8 Remote Access and Native Pluggable Authentication 656 | cat > /etc/mysql/conf.d/mysqld.cnf << EOF 657 | [mysqld] 658 | bind-address = 0.0.0.0 659 | disable_log_bin 660 | default_authentication_plugin = mysql_native_password 661 | EOF 662 | 663 | # Configure MySQL Password Lifetime 664 | echo "default_password_lifetime = 0" >> /etc/mysql/mysql.conf.d/mysqld.cnf 665 | 666 | # Configure MySQL Remote Access 667 | sed -i '/^bind-address/s/bind-address.*=.*/bind-address = 0.0.0.0/' /etc/mysql/mysql.conf.d/mysqld.cnf 668 | service mysql restart 669 | 670 | export MYSQL_PWD=secret 671 | 672 | mysql --user="root" -e "ALTER USER 'root'@'localhost' IDENTIFIED BY 'secret';" 673 | mysql --user="root" -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION;" 674 | mysql --user="root" -e "CREATE USER 'homestead'@'0.0.0.0' IDENTIFIED BY 'secret';" 675 | mysql --user="root" -e "CREATE USER 'homestead'@'%' IDENTIFIED BY 'secret';" 676 | mysql --user="root" -e "GRANT ALL PRIVILEGES ON *.* TO 'homestead'@'0.0.0.0' WITH GRANT OPTION;" 677 | mysql --user="root" -e "GRANT ALL PRIVILEGES ON *.* TO 'homestead'@'%' WITH GRANT OPTION;" 678 | mysql --user="root" -e "FLUSH PRIVILEGES;" 679 | mysql --user="root" -e "CREATE DATABASE homestead character set UTF8mb4 collate utf8mb4_bin;" 680 | mysql --user="root" -e "SET GLOBAL time_zone = '+00:00';" 681 | mysql --user="root" -e "SET time_zone = '+00:00';" 682 | 683 | sudo tee /home/vagrant/.my.cnf < /etc/mysql/mariadb.conf.d/50-server.cnf << EOF 724 | [mysqld] 725 | bind-address = 0.0.0.0 726 | ignore-db-dir = lost+found 727 | #general_log 728 | #general_log_file=/var/log/mysql/mariadb.log 729 | EOF 730 | 731 | export MYSQL_PWD=secret 732 | 733 | mysql --user="root" -e "GRANT ALL ON *.* TO root@'0.0.0.0' IDENTIFIED BY 'secret' WITH GRANT OPTION;" 734 | service mysql restart 735 | 736 | mysql --user="root" -e "CREATE USER IF NOT EXISTS 'homestead'@'0.0.0.0' IDENTIFIED BY 'secret';" 737 | mysql --user="root" -e "GRANT ALL ON *.* TO 'homestead'@'0.0.0.0' IDENTIFIED BY 'secret' WITH GRANT OPTION;" 738 | mysql --user="root" -e "GRANT ALL ON *.* TO 'homestead'@'%' IDENTIFIED BY 'secret' WITH GRANT OPTION;" 739 | mysql --user="root" -e "FLUSH PRIVILEGES;" 740 | service mysql restart 741 | 742 | mysql_upgrade --user="root" --verbose --force 743 | service mysql restart 744 | 745 | unset MYSQL_PWD 746 | fi 747 | 748 | if "$SKIP_POSTGRESQL"; then 749 | echo "SKIP_POSTGRESQL is being used, so we're not installing PostgreSQL" 750 | else 751 | # Install Postgres 14 752 | apt-get install -y postgresql-15 postgresql-server-dev-15 postgresql-15-postgis-3 postgresql-15-postgis-3-scripts 753 | 754 | # Configure Postgres Users 755 | sudo -u postgres psql -c "CREATE ROLE homestead LOGIN PASSWORD 'secret' SUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION;" 756 | 757 | # Configure Postgres Remote Access 758 | sed -i "s/#listen_addresses = 'localhost'/listen_addresses = '*'/g" /etc/postgresql/15/main/postgresql.conf 759 | echo "host all all 10.0.2.2/32 md5" | tee -a /etc/postgresql/15/main/pg_hba.conf 760 | 761 | sudo -u postgres /usr/bin/createdb --echo --owner=homestead homestead 762 | service postgresql restart 763 | # Disable to lower initial overhead 764 | systemctl disable postgresql 765 | fi 766 | 767 | # Install Redis, Memcached, & Beanstalk 768 | apt-get install -y redis-server memcached beanstalkd 769 | systemctl enable redis-server 770 | service redis-server start 771 | 772 | # Configure Beanstalkd 773 | sed -i "s/#START=yes/START=yes/" /etc/default/beanstalkd 774 | 775 | # Install Golang 776 | if [[ "$ARCH" == "aarch64" ]]; then 777 | GOLANG_LATEST_STABLE_VERSION=$(curl https://go.dev/dl/?mode=json | grep -o 'go.*.linux-arm64.tar.gz' | head -n 1 | tr -d '\r\n') 778 | wget https://dl.google.com/go/${GOLANG_LATEST_STABLE_VERSION} -O golang.tar.gz 779 | else 780 | GOLANG_LATEST_STABLE_VERSION=$(curl https://go.dev/dl/?mode=json | grep -o 'go.*.linux-amd64.tar.gz' | head -n 1 | tr -d '\r\n') 781 | wget https://dl.google.com/go/${GOLANG_LATEST_STABLE_VERSION} -O golang.tar.gz 782 | fi 783 | 784 | tar -C /usr/local -xzf golang.tar.gz go 785 | printf "\nPATH=\"/usr/local/go/bin:\$PATH\"\n" | tee -a /home/vagrant/.profile 786 | rm -rf golang.tar.gz 787 | 788 | # Install & Configure Mailpit 789 | curl -sL https://raw.githubusercontent.com/axllent/mailpit/develop/install.sh | bash 790 | chmod +x /usr/local/bin/mailpit 791 | tee /etc/systemd/system/mailpit.service < Setup dpkg excludes for linux-firmware" 869 | cat <<_EOF_ | cat >> /etc/dpkg/dpkg.cfg.d/excludes 870 | #BENTO-BEGIN 871 | path-exclude=/lib/firmware/* 872 | path-exclude=/usr/share/doc/linux-firmware/* 873 | #BENTO-END 874 | _EOF_ 875 | 876 | # Delete the massive firmware packages 877 | rm -rf /lib/firmware/* 878 | rm -rf /usr/share/doc/linux-firmware/* 879 | 880 | apt-get -y autoremove; 881 | apt-get -y clean; 882 | 883 | # Remove docs 884 | rm -rf /usr/share/doc/* 885 | 886 | # Remove caches 887 | find /var/cache -type f -exec rm -rf {} \; 888 | 889 | # delete any logs that have built up during the install 890 | find /var/log/ -name *.log -exec rm -f {} \; 891 | 892 | # Disable sleep https://github.com/laravel/homestead/issues/1624 893 | systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target 894 | 895 | # What are you doing Ubuntu? 896 | # https://askubuntu.com/questions/1250974/user-root-cant-write-to-file-in-tmp-owned-by-someone-else-in-20-04-but-can-in 897 | sysctl fs.protected_regular=0 898 | 899 | # Blank netplan machine-id (DUID) so machines get unique ID generated on boot. 900 | truncate -s 0 /etc/machine-id 901 | 902 | # Enable Swap Memory 903 | /bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024 904 | /sbin/mkswap /var/swap.1 905 | /sbin/swapon /var/swap.1 906 | --------------------------------------------------------------------------------