This guide provides detailed step-by-step instructions for installing and configuring the Modern Management Ticketing System.
Before beginning the installation, ensure you have:
Operating System:
Hardware Requirements:
Software Requirements:
Network Requirements:
Choose one of the following installation methods:
Follow these instructions for a traditional installation directly on a server.
Update your system packages:
For Ubuntu/Debian:
sudo apt update
sudo apt upgrade -y
For CentOS/RHEL:
sudo dnf update -y
Install required dependencies:
For Ubuntu/Debian:
sudo apt install -y nginx postgresql php8.0-fpm php8.0-pgsql php8.0-mbstring \
php8.0-xml php8.0-curl php8.0-zip php8.0-gd php8.0-bcmath \
nodejs npm curl unzip git
For CentOS/RHEL:
sudo dnf install -y nginx postgresql-server php php-pgsql php-mbstring \
php-xml php-curl php-zip php-gd php-bcmath nodejs npm curl unzip git
Configure PostgreSQL:
sudo systemctl enable postgresql
sudo systemctl start postgresql
sudo -u postgres createuser -P ticketing_user
# Enter a secure password when prompted
sudo -u postgres createdb -O ticketing_user ticketing_db
Download the application:
cd /var/www
sudo mkdir ticketing
sudo chown $(whoami):$(whoami) ticketing
cd ticketing
curl -LO https://example.com/downloads/ticketing-system-latest.zip
unzip ticketing-system-latest.zip
rm ticketing-system-latest.zip
Install application dependencies:
# Backend dependencies
cd backend
composer install --no-dev --optimize-autoloader
# Frontend dependencies
cd ../frontend
npm install
npm run build
Create environment configuration:
cd /var/www/ticketing/backend
cp .env.example .env
Edit the .env file with your specific settings:
nano .env
Update the following values:
APP_NAME="Modern Management Ticketing System"
APP_URL=https://your-domain.com
DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=ticketing_db
DB_USERNAME=ticketing_user
DB_PASSWORD=your_secure_password
MAIL_HOST=your_smtp_server
MAIL_PORT=587
MAIL_USERNAME=your_smtp_username
MAIL_PASSWORD=your_smtp_password
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=no-reply@your-domain.com
# Set application encryption key
Generate application keys:
php artisan key:generate
Run database migrations:
php artisan migrate --seed
Set proper permissions:
sudo chown -R www-data:www-data /var/www/ticketing
sudo chmod -R 755 /var/www/ticketing/storage
sudo chmod -R 755 /var/www/ticketing/bootstrap/cache
Create Nginx configuration:
sudo nano /etc/nginx/sites-available/ticketing
Add the following configuration:
server {
listen 80;
server_name your-domain.com;
root /var/www/ticketing/public;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-Content-Type-Options "nosniff";
index index.php;
charset utf-8;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
error_page 404 /index.php;
location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php8.0-fpm.sock;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.(?!well-known).* {
deny all;
}
}
Enable the site:
sudo ln -s /etc/nginx/sites-available/ticketing /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl restart nginx
Configure HTTPS with Let's Encrypt:
sudo apt install -y certbot python3-certbot-nginx
sudo certbot --nginx -d your-domain.com
Set up cron job for scheduled tasks:
sudo crontab -e
Add the following line:
* * * * * cd /var/www/ticketing && php artisan schedule:run >> /dev/null 2>&1
Set up queue worker as a service:
sudo nano /etc/systemd/system/ticketing-queue.service
Add the following:
[Unit]
Description=Ticketing System Queue Worker
After=network.target
[Service]
User=www-data
Group=www-data
WorkingDirectory=/var/www/ticketing
ExecStart=/usr/bin/php artisan queue:work --sleep=3 --tries=3
Restart=always
[Install]
WantedBy=multi-user.target
Enable and start the service:
sudo systemctl enable ticketing-queue
sudo systemctl start ticketing-queue
For containerized deployment using Docker:
Ensure Docker and Docker Compose are installed:
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo curl -L "https://github.com/docker/compose/releases/download/v2.12.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
Download the Docker Compose configuration:
mkdir ticketing-system && cd ticketing-system
curl -O https://example.com/downloads/docker-compose.yml
curl -O https://example.com/downloads/.env.example
mv .env.example .env
Edit the .env file with your configuration:
nano .env
Run the application:
docker-compose up -d
Initialize the database:
docker-compose exec app php artisan migrate --seed
After completing the installation, follow these steps to finish setting up the system:
Access the system at https://your-domain.com
Log in with the default administrator account:
Change the default password immediately.
Complete the following initial setup:
Update the server's firewall:
sudo ufw allow 'Nginx Full'
sudo ufw allow 22/tcp
sudo ufw enable
Set up regular backups:
# Create backup script
sudo nano /usr/local/bin/backup-ticketing.sh
Add the following:
#!/bin/bash
TIMESTAMP=$(date +"%Y%m%d%H%M%S")
BACKUP_DIR="/var/backups/ticketing"
# Create backup directory if it doesn't exist
mkdir -p $BACKUP_DIR
# Backup database
pg_dump ticketing_db -U ticketing_user -h localhost > $BACKUP_DIR/db_$TIMESTAMP.sql
# Backup application files
tar -czf $BACKUP_DIR/files_$TIMESTAMP.tar.gz -C /var/www ticketing
# Remove backups older than 7 days
find $BACKUP_DIR -type f -name "*.sql" -mtime +7 -delete
find $BACKUP_DIR -type f -name "*.tar.gz" -mtime +7 -delete
Set permissions and create cron job:
sudo chmod +x /usr/local/bin/backup-ticketing.sh
sudo crontab -e
Add:
0 2 * * * /usr/local/bin/backup-ticketing.sh
Set up monitoring (optional but recommended):
# Install monitoring agent (example for Netdata)
bash <(curl -Ss https://my-netdata.io/kickstart.sh)
Database Connection Errors
.env filesudo systemctl status postgresqlWeb Server Issues
sudo nginx -tsudo tail -f /var/log/nginx/error.logsudo chown -R www-data:www-data /var/www/ticketingApplication Errors
tail -f /var/www/ticketing/storage/logs/laravel.logphp -vIf you encounter issues during installation, you can:
For instructions on upgrading to newer versions, please refer to the Upgrade Guide.
After installation, refer to the following resources: