Giter Site home page Giter Site logo

vetro-blog's Introduction

Vetro Blog

A simple blogging Web Application

Docker Deployment

Prerequisites

  • Docker

Run App via Docker

  1. Build and start detached server container docker-compose up --build -d

  2. Go to url http://localhost

LEMP Deployment

Prerequisites

  • PHP 8.0.2

  • Composer 2.3.4

  • MySQL 8

  • Nginx

Deploying to Nginx

Assuming you have installed Composer, MySQL, PHP, and Nginx in your system already. To deploy to nginx please follow the instructions below.

Setting up MySQL

  1. Login to mysql and create new DB

sudo mysql

CREATE DATABASE "your database name";

  1. Create an new system user and grant privileges

CREATE USER '"your username"'@'%' IDENTIFIED WITH mysql_native_password BY 'your password';

  1. Set user permission for over DB

GRANT ALL ON "your database name".* TO '"your username"'@'%';

Cloning blog repository in www folder

  1. Change directory to www folder

cd /var/www/

  1. Clone blog repository

git clone https://github.com/jacksonmoji/vetro-blog.git

Configuring Laravel

  1. Change directory into vetro-blog

cd vetro-blog

  1. Change Database Connection Name from sqlite to mysql in config/database.php

  2. Add new environment file

sudo nano .env

  1. Add your local settings in to the .env file

APP_NAME=vetro-blog

APP_ENV=production

APP_KEY="your generated application unique key"

APP_DEBUG=false

APP_URL=http://vetro_blog

LOG_CHANNEL=stack

LOG_DEPRECATIONS_CHANNEL=null

LOG_LEVEL=debug



DB_CONNECTION=mysql

DB_HOST=127.0.0.1

DB_PORT=3306

DB_DATABASE="your database name"

DB_USERNAME="your username"

DB_PASSWORD="your password"

  1. Run migration into new mysql database

php artisan migrate

Granting web server write access to storage and cache folders

  1. Run these commands in your terminal

sudo chown -R www-data.www-data /var/www/vetro-blog/storage

sudo chown -R www-data.www-data /var/www/vetro-blog/bootstrap/cache

Configuring Nginx to serve the Application

  1. Create a new virtual host configuration

sudo nano /etc/nginx/sites-available/vetro-blog

  1. Copy this configuration content into the open configuration file

server {

listen 80;

server_name vetro_blog;

root /var/www/vetro-blog/public;



add_header X-Frame-Options "SAMEORIGIN";

add_header X-XSS-Protection "1; mode=block";

add_header X-Content-Type-Options "nosniff";



index index.html index.htm index.php;



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.4-fpm.sock;

fastcgi_index index.php;

fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;

include fastcgi_params;

}



location ~ /\.(?!well-known).* {

deny all;

}

}

  1. Create a symbolic link to vetro-blog in sites-enabled in order to activate the new virtual host configuration file

sudo ln -s /etc/nginx/sites-available/vetro-blog /etc/nginx/sites-enabled/

  1. Reload Nginx server to apply changes

sudo systemctl reload nginx

  1. Visit site at

http://vetro_blog

vetro-blog's People

Contributors

jacksonmoji avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.