標籤

BAT (38) shell (34) Virtual Machine (33) Xubuntu (29) acfs (25) PHP (24) CentOS (21) Virtul Box (20) 編輯器 (17) 資料庫 (15) lubuntu (13) windows (13) CPP (12) ubuntu (12) chrome (11) laravel (10) Docker (9) Python (9) 5A88 (7) VMware (6) 資料結構 (6) Javascript (5) Node (5) Proxmox VE (5) 公告系統 (5) 程式積木 (5) Android Studio (4) ANN (3) OB2D2016x64 (3) Xoops (3) clonezilla (3) samba (3) 公文 (3) 其他 (3) 硬體 (3) API (2) Android (2) AppInvent2 (2) Html (2) Hyper-V (2) Nas (2) botnet (2) mbot (2) swift (2) wordpress (2) 樣板 (2) 防火牆 (2) AD的應用 (1) Ansible (1) Arduino (1) CSS (1) GitLab (1) HA Proxy (1) LegoEV3 (1) PowerShell (1) Scratch (1) VM (1) XenServer (1) kotlin (1) linuxmint (1) lxc (1)

2016年11月26日 星期六

OB2D2016x64 安裝 laravel 5

1.確定php 版本
$php -v
2.安裝套件 
$sudo apt-get install curl openssl
$sudo apt-get install -y git-core
$sudo a2enmod rewrite
$sudo service apache2 restart
3.安裝 composer 與 laravel
$curl -sS https://getcomposer.org/installer | php
$sudo mv composer.phar /usr/local/bin/composer
$sudo chmod +x /usr/local/bin/composer
$composer
$ composer global require "laravel/installer"
4.建立新專案
$composer create-project --prefer-dist laravel/laravel test1
$cd test1
5.手動啟動內建網頁服務
sudo php artisan serve   --host=192.168.81.210 --port=82
6.開啟瀏覽器,並輸入 http://192.168.81.210:82/
7.使用apache2當網頁服務 (使用者名稱webadmin)
$sudo chgrp -R www-data test1
$sudo chmod -R 775 test1/storage
$sudo geany /etc/apache2/sites-available/laravel.conf
-------------------------------------------------------------------------------------
<VirtualHost *:80>
   ServerName localhost

   ServerAdmin webmaster@localhost
   DocumentRoot /home/webadmin/test1/public


<Directory /home/webadmin/test1>
         AllowOverride All
         Require all granted
   
</Directory>

   ErrorLog ${APACHE_LOG_DIR}/error.log
   CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

-------------------------------------------------------------------------------------
如果要取消原本80網頁
$sudo a2dissite 000-default.conf
啟用新網頁
$sudo a2ensite laravel.conf
$sudo a2enmod rewrite
$sudo service apache2 restart

瀏覽器打上 http://192.168.81.210 就能看到了


資料來源:
1.How do I install different (upgrade or downgrade) PHP version in still supported Ubuntu release?
http://askubuntu.com/questions/109404/how-do-i-install-different-upgrade-or-downgrade-php-version-in-still-supported
2.How to setup / install PHP 5.6 on Ubuntu 14.04 LTS - Dev Metal
 https://www.dev-metal.com/install-setup-php-5-6-ubuntu-14-04-lts/
3.Ubuntu 平台 laravel 安裝筆記 http://it-only.blogspot.tw/2016/01/ubuntu-laravel.html
4.給 Laravel 初學者的幾點建議 http://oomusou.io/laravel/laravel-for-newbie/
5.Deploy Laravel 5.1 on Ubuntu 14.04 LTS http://t301000.blogspot.tw/2015/08/deploy-laravel-51-on-ubuntu-1404-lts.html
6.如何在Ubuntu 15.10,14.04,12.04和LinuxMint安装Laravel 5框架
    http://www.howtoing.com/install-laravel-framework-on-ubuntu/
7.laravel 安裝手冊 https://laravel.com/docs/5.3#server-requirements

感謝:
彰化縣湖南國小許銘堯老師指導

沒有留言:

張貼留言

在 Windows 10 x64 1909版,使用BAT快速安裝公文系統與人事服務網(自然人憑證)版

相關內容移往 https://skjhcreator.blogspot.com/2021/02/windows-10-x64-1909bat.html