Installation

The documentation of CinemaRex installation from codecanyon project

Server Requirements

  • PHP >= 7.3

  • BCMath PHP Extension

  • Ctype PHP Extension

  • Fileinfo PHP Extension

  • JSON PHP Extension

  • Mbstring PHP Extension

  • OpenSSL PHP Extension

  • PDO PHP Extension

  • Tokenizer PHP Extension

  • XML PHP Extension

  • PHP GD Extension

  • NodeJS + Npm

  • Libpng-dev (pngquant)

  • FFmpeg 4.0+

  • Apache / Nginx

  • Mysql

  • Php-fpm

For more details about server requirements check Laravel framework document

Be sure all requirements installed on server, after upload project to public domain folder change the document_root to /public folder

Apache

<VirtualHost *:80>
ServerName thedomain.com
ServerAdmin [email protected]
DocumentRoot /var/www/html/example/public
<Directory /var/www/html/example>
AllowOverride All
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Enable a2enmod

sudo a2enmod rewrite

Nginx

server {
listen 80;
server_name example.com;
root /srv/example.com/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$is_args$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$ {
try_files $uri /index.php =404;
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_buffers 8 128k;
fastcgi_buffer_size 128k;
}
location ~ /\.(?!well-known).* {
deny all;
}
}

If you get 500 error be sure if the location is correct and php version and permission of project folder + storage folder. run (php artisan config:cache)

If you use aacpanel or plesk panel ... etc be sure you use php-fpm not cgi and use correct rewrite. be sure to disable (open_basedir)

Migrate Database and Nodejs installation

Environment configuration

If you get black page without any web serve error you can start migrate database and create oAuth

In .env file you will found all configuration you need to setup project Database / SMTP / AWS...

APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:0Yc7Eaf7l48ynpaldVcHxQa4AplJ0PTRno5oaDoXujY=
APP_DEBUG=true
APP_URL=http://localhost
LOG_CHANNEL=stack
LOG_LEVEL=debug
// Database configuration
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=c
DB_USERNAME=
DB_PASSWORD=
BROADCAST_DRIVER=pusher
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
// Email Settings
MAIL_MAILER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=
MAIL_PASSWORD=
MAIL_ENCRYPTION=
MAIL_FROM_ADDRESS=[email protected]
MAIL_FROM_NAME="${APP_NAME}"
// AWS Settings
AWS_ACCESS_KEY_ID= // AWS KEY ID
AWS_SECRET_ACCESS_KEY= // AWS SECRET KEY
AWS_REGION=us-west-2 // S3 BUCKET REGION
AWS_PUBLIC_BUCKET= // S3 BUCKET FOR IMAGE
AWS_PRIVATE_BUCKET= // S3 BUCKET FOR VIDEOS
AWS_PUBLIC_CLOUDFRONT_URL= // CDN FOR IMAGE
AWS_PRIVATE_CLOUDFRONT_URL= // CDN FOR VIDEOS
AWS_CLOUDFORNT_PRIVATE_KEY_FILE= // OPIONAL DEPENDS ON AWS CONFIG
AWS_CLOUDFORNT_PUBLIC_KEY= // OPIONAL DEPENDS ON AWS CONFIG
PUSHER_APP_ID=442678
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=
BRAINTREE_ENV=
BRAINTREE_MERCHANT_ID=
BRAINTREE_PUBLIC_KEY=
BRAINTREE_PRIVATE_KEY=
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
FFMPEG_BINARIES=/usr/bin/ffmpeg
FFPROBE_BINARIES=/usr/bin/ffprobe
CONTACT_TO_MAIL=[email protected]
CONTACT_FROM_MAIL=[email protected]
CONTACT_SUBJECT_MAIL='CinemaRex'

AWS variable is optional you can use local server

1- After add all configuration in .env run this commands

php artisan config:cache // Clear cache after edit to .env
php artisan migrate // Migrate DB
php artisan db:seed // Create admin user
php artisan storage:link // create symlink for storage folder

2- Create oAuth secret ID, Please after run this command copy secret ID 2 and add it in note

php artisan passport:install

Add client secret ID 2 to this file

/resources/assets/js/users/packages/Helper.js

NodeJS modules

npm install
npm run prod

Be sure you did't update/upgrade any packages. if you get any error about (pngquant) please read Q&A section

Please clear cache sitre browser or (Hard reload), if the installation not clearly for you please check videos section or contact us for any question