how to install laravel in ubuntu 20.04
ssh root@IP_ADDRESS -p PORT_NUMBER
apt-get update -y && apt-get upgrade -y
apt-get install apache2 php7.4 libapache2-mod-php php-curl php-pear php-gd php-dev php-zip php-mbstring php-mysql php-xml curl -y
systemctl start apache2
systemctl enable apache2
curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
chmod +x /usr/local/bin/composer
cd /var/www/html
composer create-project laravel/laravel laravelapp --prefer-dist
cd laravelapp
php artisan
chown -R www-data:www-data /var/www/html/laravelapp
chmod -R 775 /var/www/html/laravelapp/storage
# add the following text to /etc/apache2/sites-available/laravel.conf
<VirtualHost *:80>
ServerName laravel.example.com
ServerAdmin [email protected]
DocumentRoot /var/www/html/laravelapp/public
<Directory /var/www/html/laravelapp>
AllowOverride All
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
# then, run
a2ensite laravel.conf
a2enmod rewrite
systemctl restart apache2
# now, open http://laravel.example.com!