$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
$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
$composer create-project --prefer-dist laravel/laravel test1
$cd test1
5.手動啟動內建網頁服務
sudo php artisan serve --host=192.168.81.210 --port=82
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
$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>
-------------------------------------------------------------------------------------
<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
$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
感謝:
彰化縣湖南國小許銘堯老師指導
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
感謝:
彰化縣湖南國小許銘堯老師指導
沒有留言:
張貼留言