Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,165,819 members, 7,862,710 topics. Date: Monday, 17 June 2024 at 12:44 AM

Need Help/advice Installing Laravel App - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Need Help/advice Installing Laravel App (432 Views)

Please I Need Your Help/advice / Please Help Advice For New Comers To Programming / After Installing Laravel Using Softaculos What Next (2) (3) (4)

(1) (Reply) (Go Down)

Need Help/advice Installing Laravel App by airsaylongcome: 1:26am On May 21
I'm trying to install Cattr (cattr.app), an open source time tracking app somewhat similar to the Upwork Desktop app. Basically it tracks the time you spend on a task and takes screenshots at periodic intervals.

The repo for the app is located at git.amazingcat.net/cattr/core/app. Somewhat outdated install instructions are located at docs.cattr.app/#/en/advanced/

What I have done.
1. Spun up a Fresh instance of Debian 11
2. Update repos and upgraded preinstalled apps.
 sudo apt update && sudo apt upgrade -y

3. Installed basic prequisites
sudo apt install git wget sudo curl wget gnupg gnupg2 sb-release apt-transport-https ca-certificates software-properties-common -y

4. Installed MySQL 8.0
#Install MySQL
wget https://dev.mysql.com/get/mysql-apt-config_0.8.30-1_all.deb
sudo dpkg -i mysql-apt-config_0.8.30-1_all.deb
sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
sudo sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'
sudo apt update
sudo apt install mysql-server -y
sudo apt install php8.2 php8.2-{bcmath,bz2,intl,gd,mbstring,mysql,zip,curl,xml} -y
sudo apt install nginx php8.2-fpm -y


I noticed that running
sudo apt install nginx php8.2-fpm -y
resulted in Apache2 getting installed causing nginx to fail when I attempt to start it using
systemctl restart nginx
. So I uninstalled Apache

5. Uinstall Apache
sudo systemctl stop apache2
sudo apt-get purge apache2 apache2-utils apache2-bin apache2.2-common
sudo apt-get remove apache2
sudo apt-get autoremove
sudo rm -rf /etc/apache2
sudo rm -rf /var/www
sudo rm -rf /var/log/apache2
sudo rm -rf /var/lib/apache2


6. Restarted nginx and php8.2-fpm
# Restart services to apply changes
sudo systemctl restart nginx
sudo systemctl restart php8.2-fpm


7.Installed Node.js v18 (the app does not support versions greater than v18)
# Install Node.js
#curl -fsSL https://deb.nodesource.com/setup_current.x | sudo -E bash -
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt install -y nodejs


8. Installed Yarn
#install Yarn
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update
sudo apt install yarn


9. Installed Composer
#install Composer
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === 'dac665fdc30fdd8ec78b38b9800061b4150413ff2e3b6f88543c636f7cd84f6db9189d43a81e5503cda447da73c7e5b6') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
sudo mv composer.phar /usr/local/bin/composer


At this point, all the required pre-requisites were installed. So I switched to the website to follow their install instractions

10. Cloned the repo
cd /opt
git clone https://git.amazingcat.net/cattr/core/app.git
cd app


11. Started install (which went swimmingly)
sudo composer install && sudo php artisan key:generate && sudo yarn
sudo php artisan migrate --seed --seeder=InitialSeeder
sudo php artisan cattr:make:admin
npm run prod


Snippet from My nginx.conf (/etc/nginx/nginx.conf)
server {
listen 80;
server_name 10.10.10.218;
#root /var/www/html;
root /opt/app/public;

index index.php index.html index.htm;

location / {
try_files $uri $uri/ =404;
}

location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php8.2-fpm.sock;
}

location ~ /\.ht {
deny all;
}
}


When I eventually visit the url at http://10{.}10{.}10{.}218 I get an Error 500 with almost nothing to go on with. I have checked the
storage/logs/laravel.log
and I only see an older error message about
Mix manifest not found at: /opt/app/public/mix-manifest.json
which I have since resolved by running
npm run prod
. I have looked at the Chrome browser console and the errors there don't make any sense as I don't even know what to look for even though i see a handful of errors mostly about
WebSocket connection to wss://10.10.10.218/app/cattr?protocol=7&client=js&version=8.4.8-rc2&flash=false


Is anyone able to suggest how to troubleshoot this? Spent well over 8 hours getting to this point and I am exasperated and knackered. Please help

1 Like

Re: Need Help/advice Installing Laravel App by Bongadu: 6:38am On May 21
Uninstall every Laravel components and install Ruby on rails
Re: Need Help/advice Installing Laravel App by Karleb(m): 8:39am On May 21
I think the problem you are facing is that you are trying to install directly, I presume you are on a mac.

Try to install Laragon or Herd, then from there run your app.

I know nothing about Herd but if you would be using Laragon, you'd have to move your app into the /www folder, cd into it and install the node and composer packages.

Then you run your php artisan serve and npm run dev or prod to serve both back and front-end.

Screenshot your composer.Json and package.json file, let's see.
Re: Need Help/advice Installing Laravel App by Karleb(m): 8:49am On May 21
Karleb:
I think the problem you are facing is that you are trying to install directly, I presume you are on a mac.

Try to install Laragon or Herd, then from there run your app.

I know nothing about Herd but if you would be using Laragon, you'd have to move your app into the /www folder, cd into it and install the node and composer packages.

Then you run your php artisan serve and npm run dev or prod to serve both back and front-end.

Screenshot your composer.Json and package.json file, let's see.

On a second look, I think you need to create a database in MySQL, the database name and password.

Then put those details in your .env file.

Then run your app again.

1 Like

Re: Need Help/advice Installing Laravel App by chukwuebuka65(m): 8:55am On May 21
Check if you have the .env file . If it doesnt exist , create one and copy over the contents of .env.example
Re: Need Help/advice Installing Laravel App by airsaylongcome: 10:25am On May 21
Karleb and Chukwuebuka65

The .env file exists with correct database credentials. The database was correctly created and seeded.
Re: Need Help/advice Installing Laravel App by Karleb(m): 10:32am On May 21
airsaylongcome:
Karleb and Chukwuebuka65

The .env file exists with correct database credentials. The database was correctly created and seeded.

Screenshot your error logs here. Both on the browser console and laravel.log.

Did you forget to yarn install because I'm seeing you didn't include the step here.
Re: Need Help/advice Installing Laravel App by chukwuebuka65(m): 10:51am On May 21
airsaylongcome:
Karleb and Chukwuebuka65

The .env file exists with correct database credentials. The database was correctly created and seeded.

Check if the "APP_DEBUG" env variable is set to "true" for better error messages.
Re: Need Help/advice Installing Laravel App by qtguru(m): 11:06am On May 21
This is why docker -compose exists, just use an image instead of doing it manually
Re: Need Help/advice Installing Laravel App by airsaylongcome: 3:57pm On May 21
qtguru:
This is why docker -compose exists, just use an image instead of doing it manually

I've been down that alley with several bruises. Make I share YAML make you epp review? Plus final product needs to be manual as I am running this on an Debian 11 LXC. Ẹ dey do me somehow to run Docker on top a virtualization container
Re: Need Help/advice Installing Laravel App by qtguru(m): 11:31pm On May 21
Yes share the YAML let me take a look
Re: Need Help/advice Installing Laravel App by Lovebuddy: 1:36am On May 22
qtguru:
This is why docker -compose exists, just use an image instead of doing it manually

Hello, pls I need the ielts material you gave to someone here
I’d be glad if I can get it from you
Re: Need Help/advice Installing Laravel App by qtguru(m): 6:51am On May 22
Lovebuddy:


Hello, pls I need the ielts material you gave to someone here
I’d be glad if I can get it from you

I'll share it
Re: Need Help/advice Installing Laravel App by airsaylongcome: 1:03pm On May 22
qtguru:
Yes share the YAML let me take a look

Here's you go

version: '3.9'

services:
backend: &app
image: registry.git.amazingcat.net/cattr/core/cattr-backend:latest
depends_on:
db:
condition: service_healthy
volumes:
- backend_public:/app/public
- backend_storage:/app/storage
healthcheck:
test: ['CMD-SHELL', 'wget --spider -q "http://127.0.0.1:8090/status"']
interval: 10s
timeout: 2s

queue:
<<: *app
command: ['queue']
depends_on:
backend:
condition: service_healthy
healthcheck: {}

cron:
<<: *app
command: ['cron']
depends_on:
backend:
condition: service_healthy
healthcheck: {}

frontend:
image: registry.git.amazingcat.net/cattr/core/cattr-frontend:latest
depends_on:
backend:
condition: service_healthy
volumes:
- backend_public:/backend
ports:
- "127.0.0.1:8089:8080"
healthcheck:
test: ['CMD-SHELL', 'curl --fail -LI http://127.0.0.1:8080 -o /dev/null -w "%{http_code}\n" -s > /dev/null']
interval: 10s
timeout: 2s

db:
image: percona:latest
environment:
- MYSQL_DATABASE=cattr
- MYSQL_ROOT_PASSWORD=password
cap_add:
- SYS_NICE
volumes:
- database:/var/lib/mysql
healthcheck:
test: ['CMD', 'mysqladmin', 'ping', '-h', 'localhost']
timeout: 20s
retries: 10

volumes:
backend_public: {}
backend_storage: {}
database: {}



Their bash install script:

#!/bin/bash

# Colors
RESET='\033[0m'
RED='\033[0;31m'
GREEN='\033[0;32m'
ORANGE='\033[0;33m'
LIGHTCYAN='\033[1;36m'

# Docker required version variables
REQUIRED_DOCKER_VERSION='20.10'
REQUIRED_DOCKER_COMPOSE_VERSION='2.3.4'

# Checking if docker and docker-compose exists
if ! command -v docker --version &> /dev/null
then
echo -e "${RED}docker${RESET} could not be found. ${LIGHTCYAN}Please install version >= ${REQUIRED_DOCKER_VERSION}${RESET}"
exit
fi

if ! command -v docker-compose --version &> /dev/null
then
echo -e "${RED}docker-compose${RESET} could not be found. ${LIGHTCYAN}Please install version >= ${REQUIRED_DOCKER_COMPOSE_VERSION}${RESET}"
exit
fi

# Docker current version variables
CURRENT_DOCKER_VERSION="$(docker version --format '{{.Server.Version}}')"
CURRENT_DOCKER_COMPOSE_VERSION="$(docker-compose version --short)"

# Version check function "greater than or equal to"
function version_ge() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" == "$1"; }

# Check docker and docker-compose versions
if ! version_ge $CURRENT_DOCKER_VERSION $REQUIRED_DOCKER_VERSION; then
echo -e "${RED}Please upgrade docker!${RESET}"
echo -e "Your docker version is: ${RED}${CURRENT_DOCKER_VERSION}${RESET}. Required version is ${GREEN}>= ${REQUIRED_DOCKER_VERSION}${RESET}"
fi

if ! version_ge $CURRENT_DOCKER_COMPOSE_VERSION $REQUIRED_DOCKER_COMPOSE_VERSION; then
echo -e "${RED}Please upgrade docker-compose!${RESET}"
echo -e "Your docker-compose version is: ${RED}${CURRENT_DOCKER_COMPOSE_VERSION}${RESET}. Required version is ${GREEN}>= ${REQUIRED_DOCKER_COMPOSE_VERSION}${RESET}"
fi

echo -e "${GREEN}Cattr for Docker installer"
echo -e "${RESET}We will ask you a few questions to configure your shiny new Cattr instance\n"

echo -e "\nStarting installation\n"

echo -e "\nDownloading docker-compose.yml"

wget https://git.amazingcat.net/cattr/core/docker/-/releases/permalink/latest/downloads/compose -O ./docker-compose.yml

echo -e "\nTrying to run docker compose"

docker-compose -p cattr up -d

echo -e "\n${GREEN}Docker container was deployed.${RESET}"

docker-compose -p cattr run --rm -it backend install

# Exit
echo -e "\n${GREEN}Installation is done, thank you!${RESET}"



When I spin this up, the healthcheck for the cattr-frontend container returns as unhealthy.

Docker is running the lates version (26.x I believe)
docker-compose is v2.27
Re: Need Help/advice Installing Laravel App by elmas(m): 12:21am On May 23
airsaylongcome:


Here's you go

version: '3.9'

services:
backend: &app
image: registry.git.amazingcat.net/cattr/core/cattr-backend:latest
depends_on:
db:
condition: service_healthy
volumes:
- backend_public:/app/public
- backend_storage:/app/storage
healthcheck:
test: ['CMD-SHELL', 'wget --spider -q "http://127.0.0.1:8090/status"']
interval: 10s
timeout: 2s

queue:
<<: *app
command: ['queue']
depends_on:
backend:
condition: service_healthy
healthcheck: {}

cron:
<<: *app
command: ['cron']
depends_on:
backend:
condition: service_healthy
healthcheck: {}

frontend:
image: registry.git.amazingcat.net/cattr/core/cattr-frontend:latest
depends_on:
backend:
condition: service_healthy
volumes:
- backend_public:/backend
ports:
- "127.0.0.1:8089:8080"
healthcheck:
test: ['CMD-SHELL', 'curl --fail -LI http://127.0.0.1:8080 -o /dev/null -w "%{http_code}\n" -s > /dev/null']
interval: 10s
timeout: 2s

db:
image: percona:latest
environment:
- MYSQL_DATABASE=cattr
- MYSQL_ROOT_PASSWORD=password
cap_add:
- SYS_NICE
volumes:
- database:/var/lib/mysql
healthcheck:
test: ['CMD', 'mysqladmin', 'ping', '-h', 'localhost']
timeout: 20s
retries: 10

volumes:
backend_public: {}
backend_storage: {}
database: {}



Their bash install script:

#!/bin/bash

# Colors
RESET='\033[0m'
RED='\033[0;31m'
GREEN='\033[0;32m'
ORANGE='\033[0;33m'
LIGHTCYAN='\033[1;36m'

# Docker required version variables
REQUIRED_DOCKER_VERSION='20.10'
REQUIRED_DOCKER_COMPOSE_VERSION='2.3.4'

# Checking if docker and docker-compose exists
if ! command -v docker --version &> /dev/null
then
echo -e "${RED}docker${RESET} could not be found. ${LIGHTCYAN}Please install version >= ${REQUIRED_DOCKER_VERSION}${RESET}"
exit
fi

if ! command -v docker-compose --version &> /dev/null
then
echo -e "${RED}docker-compose${RESET} could not be found. ${LIGHTCYAN}Please install version >= ${REQUIRED_DOCKER_COMPOSE_VERSION}${RESET}"
exit
fi

# Docker current version variables
CURRENT_DOCKER_VERSION="$(docker version --format '{{.Server.Version}}')"
CURRENT_DOCKER_COMPOSE_VERSION="$(docker-compose version --short)"

# Version check function "greater than or equal to"
function version_ge() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" == "$1"; }

# Check docker and docker-compose versions
if ! version_ge $CURRENT_DOCKER_VERSION $REQUIRED_DOCKER_VERSION; then
echo -e "${RED}Please upgrade docker!${RESET}"
echo -e "Your docker version is: ${RED}${CURRENT_DOCKER_VERSION}${RESET}. Required version is ${GREEN}>= ${REQUIRED_DOCKER_VERSION}${RESET}"
fi

if ! version_ge $CURRENT_DOCKER_COMPOSE_VERSION $REQUIRED_DOCKER_COMPOSE_VERSION; then
echo -e "${RED}Please upgrade docker-compose!${RESET}"
echo -e "Your docker-compose version is: ${RED}${CURRENT_DOCKER_COMPOSE_VERSION}${RESET}. Required version is ${GREEN}>= ${REQUIRED_DOCKER_COMPOSE_VERSION}${RESET}"
fi

echo -e "${GREEN}Cattr for Docker installer"
echo -e "${RESET}We will ask you a few questions to configure your shiny new Cattr instance\n"

echo -e "\nStarting installation\n"

echo -e "\nDownloading docker-compose.yml"

wget https://git.amazingcat.net/cattr/core/docker/-/releases/permalink/latest/downloads/compose -O ./docker-compose.yml

echo -e "\nTrying to run docker compose"

docker-compose -p cattr up -d

echo -e "\n${GREEN}Docker container was deployed.${RESET}"

docker-compose -p cattr run --rm -it backend install

# Exit
echo -e "\n${GREEN}Installation is done, thank you!${RESET}"



When I spin this up, the healthcheck for the cattr-frontend container returns as unhealthy.

Docker is running the lates version (26.x I believe)
docker-compose is v2.27

Good day boss please I quoted you concerning voip asterisk on the other thread
Re: Need Help/advice Installing Laravel App by airsaylongcome: 3:14pm On May 23
qtguru any luck?
Re: Need Help/advice Installing Laravel App by qtguru(m): 4:02pm On May 23
airsaylongcome:
qtguru any luck?

Sorry was busy, I'll try it in some hours
Re: Need Help/advice Installing Laravel App by airsaylongcome: 2:09am On May 24
qtguru:


Sorry was busy, I'll try it in some hours

Appreciate
Re: Need Help/advice Installing Laravel App by qtguru(m): 11:41am On May 25
airsaylongcome:


Appreciate

I'm free now, was busy the week, let me try it out now

(1) (Reply)

A Single Software Engineering Job Got Over 3,000 Applications. / Do You Have A 1 Year+ Adsense Account? / Need A Website Developer Urgently

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 58
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.