Exported on 28-Sep-2021 12:11:39
Parameters
1 - Install Git CLI
Installs git cli to clone Laravel project repository
Login as user {Linux User} on node {Linux Node}
# Install git
sudo apt -y install git
2 - Install PHP and Plugins
Installs PHP and required PHP plugins
Login as user {Linux User} on node {Linux Node}
# Update apt repositories
sudo apt update
# Install PHP 7.4
sudo apt -y install php
sudo apt -y install php-mysql php-common php-mbstring php-xml php-zip php-bcmath zip unzip php-zip php-dev
3 - Install Composer
Install composer for PHP dependency management
Login as user {Linux User} on node {Linux Node}
# Download composer installer
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
# Setup composer
php composer-setup.php
# Add to path
sudo mv composer.phar /usr/local/bin/composer
4 - Install and Configure MariaDB Server
Installs MariaDB Server
Login as user {Linux User} on node {Linux Node}
# Install mysql/mariadb server
sudo apt install mariadb-server
# Configure password and auth plugin
sudo mysql -e "ALTER USER 'root'@'localhost' IDENTIFIED BY 'rootpass';UPDATE mysql.user SET plugin='mysql_native_password' WHERE User='root';flush privileges;"
5 - Install Laravel
Download and configure Laravel project
Login as user {Linux User} on node {Linux Node}
# Download composer
git clone https://github.com/laravel/laravel.git
# Install dependencies
cd laravel && composer i
#Create .env file
cp .env.example .env
#Set MySQL password
sed -i 's/DB_PASSWORD=/DB_PASSWORD=rootpass/g' .env
# Generate Laravel application key
php artisan key:generate
6 - Start Laravel Dev Server
Start Laravel Development Server
Login as user {Linux User} on node {Linux Node}
# Install screen
sudo apt -y install screen
# Configure screen
sudo echo "zombie xy" >> ~/.screenrc
# Change working directory
cd ~/laravel
# Start Laravel artisan server in backaground
screen -d -m php artisan serve --host 0.0.0.0
Install Laravel Development Environment On Debian Server With AttuneOps
This Blueprint Installs LEMP Stack Components On A Debian Server
Laravel is a free, open-source PHP web framework, created by Taylor Otwell and intended for the development of web applications following the model–view–controller architectural pattern and based on Symfony.
Laravel makes it easy to develop production ready websites and backend APIs with its power packed development utilities. Using Laravel saves a lot of time and cost as it brings along the basic requirements of any backend service such as Authentication, Notifications, Models, Views, Controllers, Middle-wares, etc.
Pre-Blueprint Attune setup
Steps Involved