-
apt-get update -y
-
apt upgrade -y 3 . apt install apache2 -y
-
apt install php7.4 libapache2-mod-php7.4 php7.4-curl php-pear php7.4-gd php7.4-dev php7.4-zip php7.4-mbstring php7.4-mysql php7.4-xml curl -y
-
vi /etc/php/7.4/apache2/php.ini
-
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
-
composer --version
-
cd /var/www/html
-
composer create-project laravel/laravel projectname --prefer-dist
-
cd projectname
-
php artisan -----> we will see the laravel version
-
chown -R www-data:www-data /var/www/html/projectname
-
chmod -R 775 /var/www/html/projectname/storage
-
nano /etc/apache2/sites-available/laravel.conf
<VirtualHost *:80>
ServerName ip address of the server
ServerAdmin [email protected]
DocumentRoot /var/www/html/projectname/public
<Directory /var/www/html/projectname>
AllowOverride All
ErrorLog
- a2ensite laravel.conf
- a2enmod rewrite
- systemctl restart apache2
Now we can access the Laravel app by ip address of the server.