menu

Laravel - Install laravel 5.2 pada Ubuntu


Melanjutkan posting sebelumnya, disini akan diterangkan cara install laravel dengan cara lain / mungkin lebih gampang

langsung aja:

1. Install php
  • sudo apt-get install python-software-properties
  • sudo add-apt-repository ppa:ondrej/php5
  • sudo apt-get update
  • sudo apt-get install -y php5-mcrypt php5-gd
2. Install Apache2
  • sudo apt-get install apache2 libapache2-mod-php5
3. Install MySql
  • sudo apt-get install mysql-server php5-mysql
4. Install Composer
  • curl -sS https://getcomposer.org/installer | php
  • sudo mv composer.phar /usr/local/bin/composer
  • sudo chmod +x /usr/local/bin/composer
5. Clone laravel from github
  • cd /var/www (masuk ke path /var/www)
  • git clone https://github.com/laravel/laravel.git
6. Install dependencies
  • cd /var/www/laravel
  • sudo composer install
7. Setup permission
  • chown -R www-data.www-data /var/www/laravel
  • chmod -R 755 /var/www/laravel
  • chmod -R 777 /var/www/laravel/storage
**Sebelum chmod pahami artikel ini dulu,
8. Set Key
  • cd /var/www/laravel
  • cp  .env.example .env
  • php artisan key:generate
  • Application key [base64:GJU6m96gIp1JxGk2+WNxJlxApqSTTuueyPB+nNhFgE8=] set successfully.
  • vim config/app.php
  • edit: 'key' => env('APP_KEY', 'GJU6m96gIp1JxGk2+WNxJlxApqSTTuueyPB+nNhFgE8'),
9. Buat virtualHost
  • sudo vim /etc/apache2/sites-available/laravel.conf
  • isi dengan:
<VirtualHost *:80>
        ServerName www.laravel.com
        DocumentRoot /var/www/laravel/public

        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/laravel>
                AllowOverride All
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log
        LogLevel warn
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
 
10. Enable virtual host yang baru dibuat
  • a2ensite laravel.conf
  • sudo service apache2 reload
11. Tambahkan host
  • sudo vim /etc/hosts
  • tambahkan 127.0.0.1            www.laravel.com
===DONE!!!===