Code Monkey home page Code Monkey logo

deploy-code-igniter-4-with-ec2-linux-2-and-rds's Introduction

How to Speedrun Deploy CodeIgniter 4 with ec2 Linux 2 and RDS

Watch it here https://youtu.be/YWBWYPtwdvM
CodeIgniter v4.0.4 (PHP v7.4.11) Mysql 8.0
Since Nov 17, 2020


$ sudo yum update -y  
$ sudo amazon-linux-extras enable php7.4 -y  
$ sudo yum clean metadata  
$ sudo yum install  -y php php-{pear,cgi,common,curl,mbstring,gd,mysqlnd,gettext,bcmath,json,xml,fpm,intl,zip,imap}  
$ sudo yum install  -y git  
$ curl -sS https://getcomposer.org/installer | php  
$ sudo  mv composer.phar /usr/bin/composer  
$ chmod +x /usr/bin/composer  

$ php --version  

Dependencies installation will take some time. After than set proper permissions on files.

$ sudo chown -R ec2-user:apache /var/www  
$ sudo chmod 2775 /var/www && find /var/www -type d -exec sudo chmod 2775 {} \;  
$ find /var/www -type f -exec sudo chmod 0664 {} \;  

$ cd /var/www/html  
$ composer create-project codeigniter4/appstarter speedrun
$ cd /var/www/html/speedrun  
$ composer install  

Codeigniter configurations.

$ cp env .env 
$ vim .env
enable CI_ENVIRONMENT = development
$ sudo chown ec2-user:apache -R writable/  

Database configurations.

$ vim .env
enable database.default
#--------------------------------------------------------------------
# DATABASE
#--------------------------------------------------------------------

database.default.hostname = rds.ipaddress.host
database.default.database = ci4
database.default.username = root
database.default.password = root
database.default.DBDriver = MySQL

Set the host:

$ sudo vim /etc/httpd/conf/httpd.conf   

Add code at the bottom of the file

<VirtualHost *:80>  
	ServerName codeigniter.example.com  
	DocumentRoot /var/www/html/speedrun/public  
	<Directory /var/www/html/speedrun>  
		AllowOverride All  
	</Directory>  
</VirtualHost>  
$ sudo systemctl start httpd  
$ sudo systemctl start php-fpm  
$ sudo systemctl enable php-fpm  

deploy-code-igniter-4-with-ec2-linux-2-and-rds's People

Contributors

hardcoreprogrammingwarrior avatar

Watchers

James Cloos 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.