DevDhruvJoshi / Laravel-Installation

Perfect Installation of Laravel on Linux with Virtual Host

Home Page:https://DhruvJoshi.Dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Laravel-Installation

Perfect Installation Laravel on Linux with Virtual Host

composer create-project --prefer-dist laravel/laravel myapp
cd myapp
php artisan key:generate

Laravel Debug Tools (debugbar)

composer require barryvdh/laravel-debugbar --dev

Laravel UI - If you needed

composer require laravel/ui
php artisan ui react
npm install react-router react-router-dom
php artisan ui react --auth
npm install
npm run dev
npm run development -- --watch

Get Permission

sudo chown -R www-data:www-data .
sudo chmod -R 777 .

Create Virtual Host

sudo -i subl /etc/hosts

*. add new line in this file

127.0.0.1 myapp.loc
sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/myapp.loc.conf
sudo subl /etc/apache2/sites-available/myapp.loc.conf

*. add this code in after last line, just check code path

<VirtualHost *:80>
    ServerAdmin webmaster@myapp.loc
    DocumentRoot "/home/i/pro/myapp/public"
    ServerName   myapp.loc
    ServerAlias *.myapp.loc
    <Directory "/home/i/pro/myapp/public" >
        Options Indexes FollowSymLinks MultiViews Includes ExecCGI
        AllowOverride All
        Order Allow,Deny
        Allow from all
        Require all granted
    </Directory>
</VirtualHost>

after than run this command for activated this side and restart apache server

sudo a2ensite myapp.loc.conf
sudo systemctl restart apache2

now successfully setup for laravel installation good luck.

About

Perfect Installation of Laravel on Linux with Virtual Host

https://DhruvJoshi.Dev


Languages

Language:JavaScript 87.7%Language:CSS 7.7%Language:PHP 3.7%Language:HTML 0.9%