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
- sudo apt-get install apache2 libapache2-mod-php5
- sudo apt-get install mysql-server php5-mysql
- curl -sS https://getcomposer.org/installer | php
- sudo mv composer.phar /usr/local/bin/composer
- sudo chmod +x /usr/local/bin/composer
- cd /var/www (masuk ke path /var/www)
- git clone https://github.com/laravel/laravel.git
- cd /var/www/laravel
- sudo composer install
- chown -R www-data.www-data /var/www/laravel
- chmod -R 755 /var/www/laravel
- chmod -R 777 /var/www/laravel/storage
- 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'),
- 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
- sudo vim /etc/hosts
- tambahkan 127.0.0.1 www.laravel.com