sudo yum install epel-release
sudo rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
sudo yum update
sudo setenforce 0
Laravel 安裝程序須要完成安裝 LAMP 整個環境,須要額外安裝 OpenSSL
、PDO
,Mbstring
和 Tokenizer
等 PHP 擴展。若是 LAMP 已經安裝並正常能夠正常運行能夠跳過這一步。php
sudo yum install httpd mariadb-server php56w php56w-mysql php56w-mcrypt php56w-dom php56w-mbstring
Apache、Mariadb 服務開機自動啓動html
sudo systemctl start httpd
sudo systemctl enable httpd
sudo systemctl start mariadb
sudo systemctl enable mariadb
sudo curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
sudo chmod +x /usr/local/bin/composer
這裏使用默認的apache網站目錄/var/www/html
mysql
cd /var/www/html
sudo chmod -R 777 /var/www/html
composer create-project laravel/laravel blog 5.1.11
cd blog
sudo chmod -R 777 storage
sudo chmod -R 777 vendor
進入Apache虛擬主機目錄laravel
cd /etc/httpd/conf.d
新建立一個虛擬主機配置文件,假設現有的域名爲blog.com
,爲了方便識別,這裏建立blog.conf
web
sudo touch blog.conf
編輯blog.conf
sql
sudo vi blog.conf
參照如下內容輸入,郵箱、域名和網站主目錄根據本身的狀況修改apache
<VirualHost *:80> ServerAdmin admin@blog.com ServerName blog.com ServerAlias www DocumentRoot /var/www/html/blog/public <Directory "/var/www/html/blog/public"> Options FollowSymLinks AllowOverride All </Directory> </VirualHost>
輸入完成保存,重啓Apache瀏覽器
sudo systemctl restart httpd
瀏覽器訪問你的域名測試!服務器