Perfect Installation Laravel on Linux with Virtual Host
composer create-project --prefer-dist laravel/laravel myapp
cd myapp
php artisan key:generate
composer require barryvdh/laravel-debugbar --dev
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
sudo chown -R www-data:www-data .
sudo chmod -R 777 .
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.