Aws Deployment
Aws Deployment
Aws Deployment
EC2 instance
follow the instructions for creating a new instance with following parameters
AMI: ubuntu 20.04
EC2 instance type: t2.micro
tags: Name: test-machine
pem file: RSA
download the pem file and change the permissions
apache2
install apache
enable htaccess
add following code in /etc/apache2/sites-enabled/000-default.conf
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /var/www/html>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
RewriteEngine on
# Don't rewrite files or directories
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
restart apache
mysql
install mysql
React app
execute the following steps on your machine
build the application
> cd /var/www/html
> sudo rm -f *
> sudo mv ~/Archived.zip .
> sudo apt-get install unzip
> sudo unzip Archived.zip
nodejs
> curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
> sudo apt-get update
> sudo apt install -y nodejs
> node --version