Skip to content

Scaffolding to make VirtualBox/Vagrant VM with RedHat8 (rhel 8), nginx, mysql, php 7.4, composer, git, node, npm

Notifications You must be signed in to change notification settings

alessandrofuda/virtualbox-vagrant-rhel8-lemp-stack-laravel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vagrant Box VM on top of VirtualBox with: Rhel8, Lemp stack, Laravel ecosystem components

Scaffolding to make VirtualBox/Vagrant VM with:

  • RedHat 8 (Rhel 8),
  • nginx,
  • mysql,
  • php 7.4,
  • composer,
  • git,
  • node,
  • npm
  • vagrant user/group configuration More:
  • Oracle Connector (Oci8 php ext)

Main configuration file:

Vagrantfile

A) Full Environment scaffolding

Run provisioner script, passing some env variables:

For DACOS proj. --> for ORACLE DB connector: in PROD server install manually oci8-2.2.0.tgz php extension (FORBIDDEN BY COMPANY FIREWALL RULES)
  1. On Linux

RHEL_USERNAME='username' RHEL_PASSWORD='password' APP_NAME='example_name' vagrant up --provision

or

RHEL_USERNAME='username' RHEL_PASSWORD='password' APP_NAME='example_name' vagrant reload --provision (Imp: use single quotes for pswd)


  1. On Windows

Set ENV variables directly from shell (CLI) with: $Env:APP_NAME = 'example'

Or

Use: CMD shell (NOT Powershell) to set env variables

set RHEL_USERNAME='username' && set RHEL_PASSWORD='password' && set APP_NAME='example_name' && vagrant up --provision

(If there is error with subscription manager (to rhel site), connect directly via ssh into VM and doing direct subscription with: subscription-manager register and subscription-manager attach. Then exit from VM and vagrant reload --provision

Or

Set directly APP_NAME env variable into Vagrantfile config file


Important: create key with ssh-keygen like a vagrant user (NOT root).--> create it manually inside the VM (like NOT root user)


Rhel username & password are your subscription-manager credential to rhel 8 site

https://access.redhat.com/management

If already provisioned, simply:

vagrant up





B) Application Scaffolding

  1. Clone Laravel app:

git clone <laravel-application>

  1. Add .env configuration

nano .env

  1. Create DB and db User

mysql -uroot -p (empty pswd)

mysql> CREATE DATABASE IF NOT EXISTS db_name;

mysql> CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';

mysql> GRANT ALL PRIVILEGES ON *.* TO 'username'@'localhost';

mysql> FLUSH PRIVILEGES;

For DB configuration: you can use mysql_secure_installation too, as alternative, to manually configure DB, root usr/pswd, creates User, DB, ecc..

  1. Init Composer & NPM

composer install

npm install

  1. Run deploy script

example: ./deploy.sh

About

Scaffolding to make VirtualBox/Vagrant VM with RedHat8 (rhel 8), nginx, mysql, php 7.4, composer, git, node, npm

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages