From a927670b91284093f7421bdc360d43ee437b84b6 Mon Sep 17 00:00:00 2001 From: Benjamin Calef Date: Mon, 11 Jul 2022 07:59:20 +0200 Subject: [PATCH] [v1.6.0] update vm to debian buster --- .gitignore | 3 +- README.md | 4 +- Vagrantfile | 7 +++- provision/010-system-packages.sh | 2 +- provision/020-system-services.sh | 66 ++------------------------------ 5 files changed, 14 insertions(+), 68 deletions(-) diff --git a/.gitignore b/.gitignore index 86a39bd..222cda4 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,5 @@ /extra/001-env.sh /extra/100-pre-build.sh /extra/120-post-build.sh -/db-dump.sql.gz \ No newline at end of file +/db-dump.sql.gz +/*.log diff --git a/README.md b/README.md index 725cce7..f5a8fed 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Fast Virtual Machine for Magento2 -[![vagrant](https://img.shields.io/badge/vagrant-debian:stretch-blue.svg?longCache=true&style=flat-square&label=vagrant&logo=vagrant)](https://app.vagrantup.com/debian/boxes/stretch64) +[![vagrant](https://img.shields.io/badge/vagrant-debian:bullseye-blue.svg?longCache=true&style=flat-square&label=vagrant&logo=vagrant)](https://app.vagrantup.com/geerlingguy/boxes/debian10) [![install-git](https://img.shields.io/badge/git-blue.svg?longCache=true&style=flat-square&label=setup&logo=git)](https://github.com/zepgram/magento2-fast-vm/blob/master/config.yaml.example) [![install-composer](https://img.shields.io/badge/composer-blue.svg?longCache=true&style=flat-square&label=setup&logo=composer)](https://github.com/zepgram/magento2-fast-vm/blob/master/config.yaml.example) [![mount](https://img.shields.io/badge/nfs/rsync-blue.svg?longCache=true&style=flat-square&label=mount)](https://github.com/zepgram/magento2-fast-vm/releases) @@ -44,7 +44,7 @@ Stable version >= 5.2.0 Stable version >= 2.2.0 1. Download the installer for your laptop operating system using the links below. - * [Vagrant download](https://www.vagrantup.com/downloads.html) + * [Vagrant download](https://www.vagrantup.com/downloads) 1. Reboot your laptop if prompted to do so when installation completes. ## Configurations diff --git a/Vagrantfile b/Vagrantfile index e8e345d..dcae50d 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -37,7 +37,7 @@ end # Vagrant configure Vagrant.configure(2) do |config| # Virtual machine - config.vm.box = 'geerlingguy/debian9' + config.vm.box = 'geerlingguy/debian10' # Host manager configuration config.vm.define vmconf['host_name'] @@ -56,6 +56,9 @@ Vagrant.configure(2) do |config| v.customize ['modifyvm', :id, '--ioapic', 'on'] # Enable symlink v.customize ['setextradata', :id, 'VBoxInternal2/SharedFoldersEnableSymlinksCreate/var/www/', '1'] + # Resolve issue due to ssh lock https://github.com/hashicorp/vagrant/issues/11777 + v.customize ["modifyvm", :id, "--uart1", "0x3F8", "4"] + v.customize ["modifyvm", :id, "--uartmode1", "file", File::NULL] # Uncomment option below to avoid issues with VirtualBox on Windows 10 # v.gui=true end @@ -75,7 +78,7 @@ Vagrant.configure(2) do |config| end # Linux NFS specification if OS.is_linux - config.vm.synced_folder hostDirectory, guestDirectory, create: true, :nfs => true, + config.vm.synced_folder hostDirectory, guestDirectory, create: true, :nfs => true, linux__nfs_options: ['rw','no_subtree_check','all_squash','async'], nfs_version: 4, nfs_udp: false else config.vm.synced_folder hostDirectory, guestDirectory, create: true, :nfs => true diff --git a/provision/010-system-packages.sh b/provision/010-system-packages.sh index 00d5818..9119b4b 100644 --- a/provision/010-system-packages.sh +++ b/provision/010-system-packages.sh @@ -35,7 +35,7 @@ apt-get update -y && apt-get install -y \ libsqlite3-dev libxml2-utils build-essential software-properties-common \ postfix mailutils libsasl2-2 libsasl2-modules ca-certificates libnss3-tools \ apt-transport-https openssl redis-server nginx \ - python ruby ruby-dev openjdk-8-jdk openjdk-8-jre \ + python ruby ruby-dev rubygems openjdk-11-jdk openjdk-11-jre \ vim git git-flow # Php Repository diff --git a/provision/020-system-services.sh b/provision/020-system-services.sh index 4784933..655de39 100644 --- a/provision/020-system-services.sh +++ b/provision/020-system-services.sh @@ -18,9 +18,9 @@ mysql -u root -ppassword -e "GRANT ALL PRIVILEGES ON * . * TO 'vagrant'@'localho mysql -u root -ppassword -e "GRANT ALL PRIVILEGES ON * . * TO 'vagrant'@'%';" mysql -u root -ppassword -e "FLUSH PRIVILEGES;" -# Mysqld conf -if ! grep -qF "innodb_buffer_pool_size" /etc/mysql/percona-server.conf.d/mysqld.cnf; then -cat <> /etc/mysql/percona-server.conf.d/mysqld.cnf +# Mysql conf +if ! grep -qF "innodb_buffer_pool_size" /etc/mysql/mysql.conf.d/mysqld.cnf; then +cat <> /etc/mysql/mysql.conf.d/mysqld.cnf # Innodb innodb_buffer_pool_size = 1G innodb_log_file_size = 256M @@ -75,64 +75,6 @@ MAIL_END # ----------------------------------------------------------------------------------------------------- -# Redis conf -cat <<'EOF' > /etc/systemd/system/rc-local.service -[Unit] -Description=/etc/rc.local Compatibility -ConditionPathExists=/etc/rc.local - -[Service] -Type=forking -ExecStart=/etc/rc.local start -TimeoutSec=0 -StandardOutput=tty -RemainAfterExit=yes -SysVStartPriority=99 - -[Install] -WantedBy=multi-user.target -EOF - -cat <<'EOF' > /etc/rc.local -#!/bin/sh -e -# -# rc.local -# -# This script is executed at the end of each multiuser runlevel. -# Make sure that the script will "exit 0" on success or any other -# value on error. -# -# In order to enable or disable this script just change the execution -# bits. -# -# By default this script does nothing. - -exit 0 -EOF - -chmod +x /etc/rc.local -systemctl enable rc-local - -echo never > /sys/kernel/mm/transparent_hugepage/enabled -sysctl -w net.core.somaxconn=65535 -sysctl vm.overcommit_memory=1 - -head -n -1 /etc/rc.local > /etc/rc.temp.local ; mv /etc/rc.temp.local /etc/rc.local -cat <<'EOF' >> /etc/rc.local -echo never > /sys/kernel/mm/transparent_hugepage/enabled -sysctl -w net.core.somaxconn=65535 - -exit 0 -EOF - -cat <<'EOF' >> /etc/sysctl.conf -vm.overcommit_memory=1 -EOF - - -# ----------------------------------------------------------------------------------------------------- - - # Fpm php configuration sed -i 's/memory_limit = .*/memory_limit = 4G/' /etc/php/"$PROJECT_PHP_VERSION"/fpm/php.ini sed -i "s|;date.timezone =|date.timezone = ${PROJECT_TIME_ZONE}|" /etc/php/"$PROJECT_PHP_VERSION"/fpm/php.ini @@ -168,7 +110,7 @@ rm -rf /home/vagrant/ssl && cd /home/vagrant # Nginx perl -ne 'if ( m|\#location.*php\$ \{| .. m|^\s*#\}| ) { s/#//g; } print' -i /etc/nginx/sites-available/default -sed -i "s|fastcgi_pass unix:/var/run/php/.*|fastcgi_pass unix:/var/run/php/php${PROJECT_PHP_VERSION}-fpm.sock;|" /etc/nginx/sites-available/default +sed -i "s|fastcgi_pass unix:/run/php/.*|fastcgi_pass unix:/run/php/php${PROJECT_PHP_VERSION}-fpm.sock;|" /etc/nginx/sites-available/default sed -i "s/With php-.*//" /etc/nginx/sites-available/default sed -i "s/fastcgi_pass 127.0.0.1:9000;//" /etc/nginx/sites-available/default sed -i 's/index index.html index.htm index.nginx-debian.html;/index index.php index.html index.htm index.nginx-debian.html;/' /etc/nginx/sites-available/default