- PHP 8.2 or higher (bcmath bz2 intl mbstring opcache pcntl redis sqlite3 xsl zip)
- Redis
- Clone the repository.
git clone https://github.com/eusonlito/Server-Monitor.git
- Launch the setup
./composer setup
- Edit the
.env
file and fill in the necessary variables.
vi .env
- Launch the deploy
./composer deploy
- Configure the cron job for the user related to the project.
* * * * * cd /var/www/monitor.domain.com && install -d storage/logs/artisan/$(date +"\%Y/\%m/\%d") && /usr/bin/php artisan schedule:run >> storage/logs/artisan/$(date +"\%Y/\%m/\%d")/schedule-run.log 2>&1
- Create the main user.
php artisan user:create --email=user@domain.com --name=Admin --password=StrongPassword2 --enabled
-
Configure the web server
DocumentRoot
to/var/www/project/public
. -
Create your first server.
-
Connect to remote server and download the client script (never as root).
curl -H "Authorization: Bearer AUTH_TOKEN" \
-o server-monitor.sh \
https://monitor.domain.com/server/script
chmod 755 server-monitor.sh
-
Verify that the script matches the one at https://github.com/eusonlito/Server-Monitor/blob/master/resources/app/server/script
-
Test the script (never as root).
./server-monitor.sh
- Add the script to cron jobs (never as root).
* * * * * cd /script/path && ./server-monitor.sh >> server-monitor.log 2>&1
Updating the platform can be done in a simple way with the ./composer deploy
command executed by the user who manages that project (usually www-data
).