Berikut penulis memberikan tutorial instalasi Laravel 5.1 diatas sistem operasi linux mint 17, seharusnya tidak mengalami kendala berarti jika anda menginstal di OS linux lainnya.
1. Instalasi Curl ;
sudo apt-get install curl -y
2. Jalankan perintah curl untuk download composer dari server getcomposer.org ;
curl -sS https://getcomposer.org/installer | php
3. Pindahkan file composer.phar ke dalam folder /usr/local/bin sekalian merubah nama menjadi composer saja ;
sudo mv composer.phar /usr/local/bin/composer
4. Masuk ke direktori root web biasanya di /var/www/ , lakukan kloning laravel dari github.com dengan perintah ;
cd /var/www
sudo git clone https://github.com/laravel/laravel.git
5. Masuk kedalam direktori laravel dan jalankan instalasi composer
cd /laravel
sudo composer install
6. Set kepemilikan folder laravel ke www-data sekaligus hak akses di set ke 755
sudo chown www-data:www-data /var/www/laravel/
sudo chmod 755 -R laravel/
sudo chmod -R o+w laravel/storage
7. Copi file konfigurasi default web server 000-default,conf ke file laravel.conf, didalam folder /etc/apache2/sites-available/ ;
sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/laravel.conf
8. Edit file laravel.conf dengan editor kesukaan anda dan pastikan arah DocumentRoot sudah benar tersebut menjadi seperti ini ;
DocumentRoot /var/www/laravel/public
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
9. Jika sudah, kita non-aktifkan konfigurasi server default tadi dan aktifkan yang laravel.conf, berikut urutan perintahnya ;
sudo a2dissite 000-default.conf
sudo a2ensite laravel.conf
sudo service apache2 restart
10. Edit file /var/www/laravel/app/Http/routes.php
Seperti berikut ;
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
Route::get('/', function () {
return '
Selamat Datang Di Laravel broh !';
});
10. Edit file /var/www/laravel/app/Http/routes.php
Seperti berikut ;
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
Route::get('/', function () {
return '
});
?>
Tampilan Awal Laravel 5.1 di linuxmint
0 comments:
Post a Comment