- LARAVEL APACHE SETUP
CREATE A CONF
1sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/abilik-laravel.test.conf
EDIT
1sudo gedit /etc/apache2/sites-available/abilik-laravel.test.conf
CONTENT
123456789101112<VirtualHost abilik-laravel.test:80>ServerName www.abilik-laravel.testDocumentRoot "/home/teddy/Documents/works/abilik-laravel"DirectoryIndex index.php<Directory "/home/teddy/Documents/works/abilik-laravel">AllowOverride AllAllow from AllRequire all granted</Directory>ErrorLog /var/log/apache2/abilik-laravel.error.logCustomLog /var/log/apache2/abilik-laravel.access.log combined</VirtualHost>
ENABLE THE VIRTUALHOST
123sudo a2ensite abilik-laravel.test.confsudo a2enmod rewrite
RELOAD APACHE2
1sudo systemctl reload apache2CREATE THE HOST
1sudo gedit /etc/hosts1127.0.0.1 abilik-laravel.testSET THE FILE PERMISSIONS & RELOAD APACHE2
12teddy@teddy:~/Documents/works$ sudo chmod -R 777 abilik-laravel/teddy@teddy:~/Documents/works$ sudo systemctl reload apache2MODIFY .env FILE
123DB_DATABASE=abilik_laravelDB_USERNAME=rootDB_PASSWORD=teddyCHECK /home/teddy/Documents/works/abilik-laravel/app/Providers/AppServiceProvider.php
TO DISABLE HTTPS ON MY LOCAL1234public function boot(){//\URL::forceScheme('https');}MODIFY .htaccess (DEFAULT FROM /public/ DIR)
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647AddType application/x-httpd-php .phpAddType application/x-httpd-php-source .phps<IfModule mod_rewrite.c><IfModule mod_negotiation.c>Options -MultiViews -Indexes</IfModule>RewriteEngine On# Handle Authorization HeaderRewriteCond %{HTTP:Authorization} .RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]# Redirect Trailing Slashes If Not A Folder...RewriteCond %{REQUEST_FILENAME} !-dRewriteCond %{REQUEST_URI} (.+)/$RewriteRule ^ %1 [L,R=301]# Handle Front Controller...RewriteCond %{REQUEST_FILENAME} !-dRewriteCond %{REQUEST_FILENAME} !-fRewriteRule ^ index.php [L]</IfModule><IfModule mod_headers.c>Header append Cache-Control "public"</IfModule>## EXPIRES CACHING ##<IfModule mod_expires.c>ExpiresActive OnExpiresByType image/jpg "access plus 1 year"ExpiresByType image/jpeg "access plus 1 year"ExpiresByType image/gif "access plus 1 year"ExpiresByType image/png "access plus 1 year"ExpiresByType text/css "access plus 1 month"ExpiresByType application/pdf "access plus 1 month"ExpiresByType text/x-javascript "access plus 20 minutes"ExpiresByType application/x-shockwave-flash "access plus 1 month"ExpiresByType application/x-javascript "access plus 20 minutes"ExpiresByType text/javascript "access plus 15 minutes"ExpiresByType application/javascript "access plus 1 month"ExpiresByType application/json "access plus 20 minutes"ExpiresByType image/x-icon "access plus 1 year"ExpiresDefault "access plus 2 days"</IfModule>## EXPIRES CACHING ##CLEAR THE PREVIOUS CACHE & ROUTE ON THE WEB ROOT (FOR EXAMPLE teddy@teddy:~/Documents/works/abilik-laravel$ php artisan route:clear)
12345php artisan route:clearphp artisan config:clearphp artisan cache:clear123teddy@teddy:~/Documents/works/abilik-laravel$ php artisan help -VPHP Warning: Module 'curl' already loaded in Unknown on line 0Laravel Framework 6.5.1OPEN: http://abilik-laravel.test/
http://abilik-laravel.test/oc-admin