LoginSignup
1
1

More than 3 years have passed since last update.

Laravelプロジェクトを作った後の動き

Posted at

Laravelプロジェクト作った後に何をするか!フロー

【環境】
サーバー:ubuntu
web: apache2

【フロー】
①Apache2のドキュメントルート変更
②AllowOverride All変更奴
③RewriteEngine on
④サーバー再起動
⑤オーナー・パーミッションを調整

①Apache2のドキュメントルート変更

cd ~
cd /etc/apache2/sites-available/
ls
000-default.conf  default-ssl.conf←この2つを変更する

000-default.conf

上の方にある
DocumentRoot /var/www/laravelプロジェクト名/public に変更
default-ssl.conf

上の方にある
DocumentRoot /var/www/laravelプロジェクト名/public に変更

②AllowOverride All変更奴

cd ~
cd /etc/apache2/
sudo vim apache2.conf ←変更してゆく
最下層から少し上がったとこに、似たようなのが複数あるから以下を追記

<Directory /var/www/laravelプロジェクト名/public> 
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted

③RewriteEngine on

sudo a2enmod rewrite

④サーバー再起動

 sudo service apache2 restart

⑤オーナー・パーミッションを調整

cd ~
cd /var/www/

sudo chown -R ubuntu:www-data laravelプロジェクト名

sudo find laravelプロジェクト名 -type d -print | xargs -i chmod 750 {}

sudo find laravelプロジェクト名 -type f -print | xargs -i chmod 640 {}

sudo chmod -R 770 laravelプロジェクト名/storage/

sudo chmod -R 770 laravelプロジェクト名/bootstrap/cache/
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1