iT邦幫忙

第 12 屆 iThome 鐵人賽

DAY 18
0
Modern Web

用30days 了解web系列 第 18

(Day 18) deploy your Laravel project with Apache on Linux

  • 分享至 

  • xImage
  •  

maybe many of us have already created a few projects but don't really know how to set up your Laravel project to the server. so Today's article will help you deploy your Laravel project to the server.
required
Linux Ubuntu installed LAMP stack for those using Windows, can download VMware, VirtualBox, and install Linux inside the VirtualBox.

Clone the Project
using git clone the project to your var/www

$ cd var/www
$ git clone ...
$ composer install

Update the ENV file
because your env project isn't inside your cloned project, so remember to generate a new env file and new artisan key
$ cp .env.example .env
$ php artisan key:

for those who used the database don't forget to adjust your env database, username, password, and migrate the database schema to the database.

Virtual Host File
now it's time to set your 000-default.conf that located inside, /etc/apache2/sites-enabled

    DocumentRoot /var/www/<'your_project'>/public
    <Directory "/var/www/<'your_project'>/public">
        Options FollowSymLinks
        AllowOverride All
    </Directory>
</VirtualHost>

don't last set your ports.conf file located on /etc/apache2 and write this

Listen 80

this line is about set your apache to listen the 80 port
now you are good to go….


上一篇
(Day 17) Install Lamp Stack Inside Ubuntu Linux
下一篇
(day 19) What is docker?
系列文
用30days 了解web30
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言