Linux Ubuntu Üzerinde Laravel Kurulumu

January 5, 2021

Linux Ubuntu sunucularında vhost üzerinden laravel projelerimizi çalıştırmak için aşağıdaki adımları izlememiz gerekmektedir.

Eğer sunucunuzda Composer yüklü değil ise
sudo apt-get update 
sudo apt-get install curl php-cli php-mbstring git unzip
cd ~
curl -sS https://getcomposer.org/installer -o composer-setup.php
php -r "if (hash_file('SHA384', 'composer-setup.php') === 'hash_code') { echo 'Installer verified'; } else { echo'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"

bu alanda dikkat edilmesi gereken “hash_code” alanına Composer checksum sayfasındaki hash kodunu girmeniz.

https://composer.github.io/pubkeys.html

Composer yüklemesi bittikten sonra şöyle bir çıktı vermesi gerekmekte
Installer verified
Kontrol için;
composer

çıktısı aşağıdaki gibi olmalıdır.

______
/ ____/___ ____ ___ ____ ____ ________ _____
/ / / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
/ /___/ /_/ / / / / / / /_/ / /_/ (__ ) __/ /
\____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
/_/
Composer version 1.1.1 2016-05-17 12:25:44
Usage:
command [options] [arguments]
Options:
-h, --help Display this help message
-q, --quiet Do not output any message
-V, --version Display this application version
--ansi Force ANSI output
--no-ansi Disable ANSI output
-n, --no-interaction Do not ask any interactive question
--profile Display timing and memory usage
information
--no-plugins Whether to disable plugins.

Composer yüklemesi bittikten sonra Laravel çalıştırılacak vhost dizini oluşturulup Laravel kurulumuna geçebiliriz.

cd /var/www/example.com/
composer create-project --prefer-dist laravel/laravel ./

kurulum bittikten sonra env dosyamızı aktif hale getirmek için mv komutu ile taşıma / isim değiştirme işlemini yapmalıyız.

mv .env.example ./.env

Gerekli dosya izinlerini verdikten sonra Laravel kullanıma hazır olacaktır.

sudo chgrp -R www-data storage bootstrap/cache
sudo chmod -R ug+rwx storage bootstrap/cache

Linux Ubuntu Üzerinde Laravel Kurulumu was originally published in SyconX on Medium, where people are continuing the conversation by highlighting and responding to this story.