Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

enable site

To install laravel v9 you will need apache2, php8 and composerv2 (Ubuntu 20.04/Ubuntu 18.04)
sudo apt update
sudo apt upgrade

Install and start apache2
sudo apt install apache2
sudo service apache2 start
Open: http://localhost:80
sudo service apache2 stop

Install php8
sudo add-apt-repository -y ppa:ondrej/php
sudo apt-get update
sudo apt-get install php8.0 php8.0-cli php8.0-common php8.0-xml php8.0-curl
php -v

Enable mods
sudo a2enmod php8.0
sudo a2enmod headers
sudo a2enmod rewrite

Install composerv2
cd /home/user
curl -sS https://getcomposer.org/installer -o composer-setup.php
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
compsoer -V

Install laravel project
composer create-project laravel/laravel example-app
php artisan key:generate --ansi
php artisan serve

Configuration file for apache2 example
cd /etc/apache2
sudo a2dissite 000-default.conf
cd /sites-available
sudo touch appName.conf

sudo nano appName.conf
Copy, paste and configurate:
---------------------------------------------------------------------------------
<VirtualHost *:80>
	ServerName name.local

    // If project is based on multiple env (admin/frontend)
	SetEnv ACTIVE_MODULE frontend
	
	DocumentRoot "pathDirectory/laravel/public"
	<Directory "pathDirectory/laravel/public">
	    Options Indexes FollowSymLinks MultiViews
	    AllowOverride All
	    Require all granted
	    Order allow,deny
	    Allow from all
	</Directory>

	ErrorLog /var/log/apache2/fileName.err
	CustomLog /var/log/apache2/fileName combined
</VirtualHost>
---------------------------------------------------------------------------------

sudo a2ensite appName.conf
sudo service apache2 restart
or
sudo service apache2 start
Comment

PREVIOUS NEXT
Code Example
Shell :: gitignore folder 
Shell :: kubectl port-forward 
Shell :: removing letstencrypt from domain 
Shell :: path/to/sdkmanager --install "cmdline-tools;latest" 
Shell :: run minecraft server linux 
Shell :: terminal delete directory 
Shell :: git reset a single file to previous commit 
Shell :: check openvpn working 
Shell :: git merge branch to another branch 
Shell :: npm install latest available packages 
Shell :: gitignore criar 
Shell :: bash iterate over a variable range of numbers 
Shell :: github to colab 
Shell :: download a file using curl 
Shell :: install windows fonts on linux 
Shell :: svelte typescript 
Shell :: crontab example 
Shell :: install adminlte 
Shell :: Copy local repository for remote servers git 
Shell :: shell redirect all to /dev/null 
Shell :: linux send syslog message to remote server 
Shell :: how to check open vpn on ubuntu 
Shell :: delete gitignore files 
Shell :: powershell display environment variables 
Shell :: online c compiler with working fork 
Shell :: how to set gopath/bin linux 
Shell :: git pull on another branch 
Shell :: order allow deny 
Shell :: bash execute command in variable 
Shell :: shell play mp3 
ADD CONTENT
Topic
Content
Source link
Name
3+8 =