Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects
Commit b931ae2b authored by Nicolas Béjean's avatar Nicolas Béjean
Browse files

Initial commit

parents
No related branches found
No related tags found
No related merge requests found
/vagrant/.vagrant
\ No newline at end of file
This diff is collapsed.
# Vagrant with Lumen 8
Vagrant Image based on Debian with Lumen 8 pre-installed.
Works only with VMware provider.
## Licence
[![Copyright 2021-2021 Béjean Développement](https://www.gnu.org/graphics/gplv3-with-text-136x68.png)](https://choosealicense.com/licenses/gpl-3.0/).
**Vagrant Lumen 8** is created by [Béjean Développement](https://www.bejean.eu) and published under the license [GPL3](https://www.gnu.org/licenses/gpl.html).
\ No newline at end of file
# ---
# -*- coding: utf-8 -*-
#
# Vagrant with Lumen 8 (Vagrant Lumen 8) is a Vagrant Image based on Debian with Lumen 8 pre-installed.
# Copyright (C) 2021 Béjean Développement
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "generic/debian10"
config.vm.hostname = "d10-lumen8"
config.vm.network "private_network", ip: "192.168.71.100"
config.vm.provider "vmware" do |v|
v.name = "d10-lumen8"
v.linked_clone = false
v.vmx["memsize"] = "2048"
v.vmx["numvcpus"] = "2"
end
config.vm.provision "file", source: "./conf/nginx/default.conf", destination: "/tmp/default.conf"
config.vm.provision "file", source: "./conf/nginx/nginx.conf", destination: "/tmp/nginx.conf"
config.vm.provision "shell", path: "install.sh"
end
\ No newline at end of file
server {
listen 80;
listen [::]:80;
server_name localhost;
root /var/www/html/public;
index index.php;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-Content-Type-Options "nosniff";
charset utf-8;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
error_page 404 /index.php;
location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.(?!well-known).* {
deny all;
}
}
user www-data;
worker_processes auto;
error_log /var/log/nginx/error.log notice;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
include /etc/nginx/conf.d/*.conf;
}
#!/usr/bin/bash
sudo apt-get update -qq && sudo apt-get upgrade -y -qq
sudo apt-get install -y -qq \
apt-transport-https \
ca-certificates \
curl \
cron \
git \
gnupg2 \
lsb-release \
zip
# Install NGINX
# Test if NGINX is installed
/usr/sbin/nginx -v > /dev/null 2>&1
NGINX_IS_INSTALLED=$?
if [[ $NGINX_IS_INSTALLED -ne 0 ]]; then
echo ">>> Installing NGINX"
cd /tmp
wget https://nginx.org/keys/nginx_signing.key
sudo apt-key add nginx_signing.key
sudo cat <<EOF > /etc/apt/sources.list.d/nginx.list
deb https://nginx.org/packages/mainline/debian/ buster nginx
deb-src https://nginx.org/packages/mainline/debian/ buster nginx
EOF
sudo apt-get update -qq && sudo apt-get install -y -qq nginx
else
echo ">>> NGINX is already installed!"
fi
# Install PHP-FPM
# Test if PHP-FPM is installed
/usr/sbin/php-fpm7.3 -v > /dev/null 2>&1
PHPFPM_IS_INSTALLED=$?
if [[ $PHPFPM_IS_INSTALLED -ne 0 ]]; then
echo ">>> Installing PHP-FPM"
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/php.list
sudo apt-get update && sudo apt-get install -y \
php7.3-fpm \
php7.3-bcmath \
php7.3-curl \
php7.3-xml \
php7.3-mysql \
php7.3-gd \
php7.3-common \
php7.3-intl \
php7.3-mbstring \
php7.3-pdo \
php7.3-soap \
php7.3-xsl \
php7.3-zip
else
echo ">>> PHP-FPM is already installed!"
fi
# Install Composer
# Test if Composer is installed
composer -v > /dev/null 2>&1
COMPOSER_IS_INSTALLED=$?
if [[ $COMPOSER_IS_INSTALLED -ne 0 ]]; then
echo ">>> Installing Composer"
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer && sudo chmod +x /usr/local/bin/composer
else
echo ">>> Composer is already installed!"
fi
# Install Lumen
DIRECTORY=/var/www/html
if [[ ! -d "$DIRECTORY" ]]
then
echo ">>> Installing Lumen"
sudo mkdir -p $DIRECTORY && cd $DIRECTORY
composer create-project --prefer-dist laravel/lumen .
else
echo ">>> Lumen is already installed!"
fi
# NGINX Configuration
sudo chown -R vagrant:vagrant /var/log/nginx
sudo cp /tmp/nginx.conf /etc/nginx/nginx.conf
sudo cp /tmp/default.conf /etc/nginx/conf.d/default.conf
sudo /usr/sbin/nginx -t && sudo service nginx restart
cd $DIRECTORY
php artisan --version
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment