2015年3月5日 星期四

CentOS上安裝Laravel 4開發環境

rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm

rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

sudo yum --enablerepo=remi install httpd -y

sudo service httpd start

sudo yum --enablerepo=remi install php php-mysql -y

yum search php-

sudo yum --enablerepo=remi install php-mcrypt -y

sudo yum --enablerepo=remi install mysql-server -y

sudo service mysqld start

sudo /usr/bin/mysql_secure_installation

sudo chkconfig httpd on

sudo chkconfig mysqld on

curl  -k -sS https://getcomposer.org/installer | php

echo $PATH

sudo mv composer.phar /usr/local/bin/composer

wget https://github.com/laravel/laravel/archive/develop.zip

which unzip

sudo yum install unzip -y

sudo unzip develop

sudo mv laravel-develop /var/www/yoursite

sudo rm  -f develop

cd /var/www/yoursite

composer install

sudo chmod 775 /var/www/yoursite/app/storage

sudo vi /etc/httpd/conf/httpd.conf最後一行加入下列
<VirtualHost *:80>
        ServerName yoursite.com
        DocumentRoot /var/www/yoursite/public

       <Directory /var/www/yoursite/public>
          <IfModule mod_rewrite.c>
          Options -MultiViews
          RewriteEngine On
          RewriteCond %{REQUEST_FILENAME} !-f
         RewriteRule ^ index.php [L]
       </IfModule>
</Directory>
</VirtualHost>

sudo service httpd restart

參考連結:https://www.digitalocean.com/community/tutorials/how-to-install-laravel-4-on-a-centos-6-vps

沒有留言:

張貼留言