Giter Club home page Giter Club logo

aws-lightsail-instance-with-lamp-php-8-stack's Introduction

Setting up an AWS Lightsail Instance with LAMP (PHP 8) Stack

This guide will walk you through setting up an Amazon Lightsail instance with a LAMP stack using PHP 8, and configuring it to deploy a PHP application from GitHub with database setup.

Step 1: Create an Amazon Lightsail Account

If you haven't already, create an Amazon Lightsail account at AWS Lightsail.

Step 2: Create an Amazon Lightsail Instance

  1. Click on Create instance in the Lightsail dashboard. Create Instance

  2. Choose your preferred Availability Zone (e.g., eu-west-1). Choose Availability Zone

  3. Select Linux/Unix platform and choose LAMP (PHP 8) as your blueprint. Choose LAMP (PHP 8)

  4. Click on +Add launch script and paste the following script into the launch script text window.

# Remove default website
cd /opt/bitnami/apache2/htdocs 
rm -rf *

# Clone GitHub repo
git clone -b loft https://github.com/mikegcoleman/todo-php .

# Set write permissions on the settings file
sudo chown bitnami:daemon connectvalues.php
chmod 666 connectvalues.php

# Inject database password into configuration file
sed -i.bak "s/<password>/$(cat /home/bitnami/bitnami_application_password)/;" /opt/bitnami/apache2/htdocs/connectvalues.php

# Create database
cat /home/bitnami/htdocs/data/init.sql | /opt/bitnami/mariadb/bin/mysql -u root -p$(cat /home/bitnami/bitnami_application_password)
  1. Click on Enter a name for your instance and choose Create instance Create instace

  2. Wait for the instace to go into running state and access it via the IP IP app

aws-lightsail-instance-with-lamp-php-8-stack's People

Contributors

arditxharri avatar

Watchers

 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.