LoginSignup
0
1

More than 3 years have passed since last update.

【Laravel/Bitbucket】Laravelをbitbucketにgit リポジトリ作成して、別の場所にクローン作成まで

Last updated at Posted at 2019-07-23

AmazonLinux2上に、Laravelのプロジェクトを構築しました。
AmazonLinux2でLaravelの開発環境構築

そのLaravelプロジェクトを別の場所にクローンするまでの手順のメモです。

まずは、gitをインストール

$ sudo yum install git

git configの設定

一度やれば、OK。

$ git config --global user.email "メールアドレス"
$ git git config --global user.name "ユーザー名"

Bitbucketでリポジトリ作成

リポジトリ名を munakata.net と仮定

既存プロジェクト内に移動して、Bitbucketへpush

$ cd ~/html/blog
$ git init
$ git add *
$ git commit -a -m 'init'
$ git remote add origin git@bitbucket.org:ユーザー名/munakata.net.git
$ git push -u origin master

クローン作成

$ cd ~/html
$ git clone git@bitbucket.org:ユーザー名/munakata.net.git
$ cd munakata.net
$ composer install
$ chmod -R 777 bootstrap/cache
$ chmod -R 777 storage

ログの出力変更

ブラウザ経由でエラーが出た時と、ターミナル経由でエラーが出た際に、ログの権限が変わってしまうと面倒なので、下記で対応

config/logging.php
'daily' => [
            'driver' => 'daily',
            'path' => storage_path('logs/laravel-' . php_sapi_name() . '.log'),
            'level' => 'debug',
            'days' => 14,
        ],

Virtual Hostの設定

vhost.conf
<VirtualHost *:80>
    DocumentRoot /home/munakata/html/munakata.net/public
    ServerName munakata.net
    ServerAlias munakata.net
    <Directory "/home/munakata/html/munakata.net/public">

        #.htaccessを利用可能にする
        AllowOverride All

        # Laravelで利用する環境変数を development に設定
        SetEnv APP_ENV development

        #アクセス許可
        Require all granted


    </Directory>
</VirtualHost>

httpdの再起動

$ sudo systemctl restart httpd
0
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
0
1