GithubHelp home page GithubHelp logo

tankengine-ish / lamp_stack_page_deployment Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 9.04 MB

2-Tier E-Commerce App Local Deployment + VIDEO [personal project]

CSS 30.14% PHP 12.24% JavaScript 3.57% SCSS 46.84% Shell 7.22%
centos9 firewalld mariadb vagrant virtualbox

lamp_stack_page_deployment's Introduction

2-Tier E-Commerce App Deployment

This simple E-Commerce website was my first app deployment. The project was made with the LAMP stack but instead of MySql I used Maria db. LAMP stands for Linux, Apache, MySql/MariaDB, php.

I decided to put a little spin on this task and made it entirely inside a CentOS VM with Vagrant and Oracle Virtual Box. It took a little setting-up but in the end it all worked out.

Disclaimer: The javascript and the php logic/interface weren't done by me. My only interaction with them is editing a few lines of texts. All credit goes to KodeKloud.

Alt text

Stage 1 - Setting up my VM:

On my Ubuntu host machine I grabbed a Vagrant box of CentOS9 and ran it through my Oracle Virtual Box.

Then I got the ssh configuration of my Vagrant's VM and used it to SSH from Ubuntu to the CentOS. With the help of the Remote SSH extension in my VsCode I managed to clone the e-commerce repo and load it into my IDE. It's worth mentioning that I still had to generate an SSH key for my github.

Stage 2 - Database and Firewall

The first step into deployment was configuring firewalld which is a dynamic firewall management tool. It's a high-level device that abstracts away the manual manipulating of iptable rules which I am not yet familiar with to be honest. I used it to split up the traffic ports in two:

One for the MariaDB so the web application communicates with the database server. I set it to the default: 3306 (TCP).

One for the HTTP traffic: I set it to the default: 80 (TCP).

The second step into deployment and chill was installing and configuring mariaDB. There's not much more to it. I created a database called 'ecomdb' and then a user with all privileges. After that I loaded a sql script containing the inventory information to the database.

Stage 3 - Configuring the Apache server

As you can see this wasn't that much of a hassle either. You just have to make sure that you connect it to the databse and then configure the the httpd to load the index.php page in the web app.

Regarding the long Bash script I wrote for the whole deployment it is worth noting that such 100+ lines scripts are rarely being done in Bash. In a professional environment anything that's more than 25-30 lines of code can be done in Python, GO or Ruby. Anything less can still be done in Bash.

Stage 4 - How I did it! (VIDEO)

You can check the details of how I did this project on my personal website:

lamp_stack_page_deployment's People

Watchers

Plamen Dimitrov 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.