1) Install POSTGRESQL
sudo apt update
sudo apt install -y postgresql postgresql-contrib
CREATE DATABASE name_db OWNER user_name;
GRANT ALL
PRIVILEGES ON DATABASE name_db TO user_name;
1) Install POSTGRESQL
sudo apt update
sudo apt install -y postgresql postgresql-contrib
CREATE DATABASE name_db OWNER user_name;
GRANT ALL
PRIVILEGES ON DATABASE name_db TO user_name;
In AWS console:
EC2 → Instances
Select your instance
Actions → Image and templates → Create Image
Wait until AMI is ready.
Go to:
EC2 → AMIs
Select AMI
Actions → Copy AMI
Destination region → US East (N. Virginia)
Switch region to N. Virginia
EC2 → AMIs → Launch instance
Your server will start in us-east-1.
You will get a new public IP, which we can configure it in our DNS.
sudo fallocate -l 2G /swapfile || sudo dd if=/dev/zero of=/swapfile bs=1M count=2048
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
# optional but recommended
echo 'vm.swappiness=20' | sudo tee /etc/sysctl.d/99-swappiness.conf
sudo sysctl -p /etc/sysctl.d/99-swappiness.conf
free -h
swapon --show
STEP 1 — Create the Subdomain
cPanel → Domains → Create A New Domain (or Subdomains)
cPanel will automatically create:
/home/egproject/test.example.com/
Copy EVERYTHING inside public folder to:
/home/egproject/test.example.com/
So that folder contains:
Change these lines:
FROM:
require __DIR__.'/../vendor/autoload.php';
$app = require_once __DIR__.'/../bootstrap/app.php';
TO:
require __DIR__.'/../test/vendor/autoload.php';
$app = require_once __DIR__.'/../test/bootstrap/app.php';
Because your Laravel core lives in /test.
In File Manager:
Set:
test/storage → 755 test/bootstrap/cache → 755
If errors:
chmod -R 775 storage
chmod -R 775 bootstrap/cache1) Check php version using the command:
php -v
2) Make sure server is using apache php or php cli by using the below command
sudo systemctl status
3) Check if any php-fpm is running. else
sudo nano /etc/php/8.4/cli/php.ini
4) Edit php.ini and change these values from 2M to 10 or 20 M
upload_max_filesize = 10M
post_max_size = 10M
4. Restart web server:
sudo systemctl restart php8.4-fpm
sudo systemctl restart apache2
First, you need to create an App Password from your Google Account:
Go to your Google Account: https://myaccount.google.com/
Click on "Security" in the left menu
Enable "2-Step Verification" if not already enabled
Go back to Security → 2-Step Verification
Scroll down to "App passwords"
Select "Mail" and "Other (Custom name)"
Enter a name like "Laravel App"
Click "Generate"
Copy the 16-character password (no spaces)
Update .env file with the following info:
MAIL_MAILER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=your-email@gmail.com
MAIL_PASSWORD=your-16-char-app-password
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS="your-email@gmail.com"
MAIL_FROM_NAME="${APP_NAME}"
1) Locally run the following commands for the existing repo:
git remote -v
This will help us find the current remote origin
2) Set remote origin to the new repo:
git remote set-url origin git@gitlab.com:folder/repo.git
3) Locally ensure that it is in the correct branch
git checkout import-main
4) if activities were done in a new branch, merge it with the current branch "import main"
git merge main
5) push the code to the git
git push