
Laravel5.5を、さくらVPS For KUSANAGIでインストールしてみました。
https://qiita.com/tajima_taso/items/f139eb71423041120247
私のおすすめサーバーであるCPIにLaravelをインストールします。
その作業に伴い、ディレクトリ変更の変更やフォルダの移動も行います。
記事の執筆時点での設定です。
2017年12月04日
Laravelバージョン 5.5
サクラVPS KUSANAGI
phpバージョン 7.0
インストール準備
まずはSSHに接続して下さい
まずは環境を作成するので下記のコマンドでLAMP環境を構築
kusanagi provision --lamp public
ホスト名の設定
作成するプロファイルで使用するホスト名(FQDN) を指定します。
Enter hostname(fqdn) for your website. ex) kusanagi.tokyo
例 : www.example.com
※//や末尾の/は不要です。
Let’s Encryptの設定
指定したホスト名に対応するLet’s EncryptのSSL証明書を発行します。
Let’s Encryptは認証局(CA)として「SSL/TLSサーバ証明書」を無料で発行するプロジェクトです。
詳細は公式サイトをご覧ください。
下記の画面になったらメールアドレスを入力します。
In order to use Let's Encrypt services, you must agree to Let's Encrypt's Term of Services. If you agree this TOS, put in your e-mail adress, otherwise carriage enter key. TOS of Let's Encrypt : https://letsencrypt.org/repository/
こちらにメールアドレスを入力することでLet’s Encryptの使用に同意したことになります。
例:kusanagi@example.com
データベース名の設定
データベース名を設定します。
Enter the name of your database.
データベースのユーザー名の設定
作成したデータベースのユーザー名を設定します。
Enter user name for database '作成したデータベース名'.
データベースユーザーのパスワードの設定
作成したデータベースユーザーのパスワードを設定します。
入力すると下記のように表示されるので、確認用としてパスワードを再度入力します。
プロビジョニングの完了
これで、一番最初の初期設定は完了しました。
PHPのバージョン指定
kusanagi php7
HTTP→HTTPSへリダイレクト処理
kusanagi ssl --https redirect public
ドキュメントルート変更
vi /etc/nginx/conf.d/public_ssl.conf
confファイル編集
charset UTF-8;
client_max_body_size 16M;
root /home/kusanagi/public/DocumentRoot;
↑を↓に変更(DocumentRootを取る)
root /home/kusanagi/public;
index index.php index.html index.htm;
location / { try_files $uri $uri/ /index.php?$args;
nginx再起動
systemctl restart nginx
composerインストール
composerを使ってインストールを行いますのでcomposerをダウンロードします。
コマンド実行する場所は/home/kusanagi/です。
SSHでls をした時にhtmlのフォルダが見える状態
composerをインストール場所はbinにインストール
mkdir bin
curl -sS https://getcomposer.org/installer | php -- --install-dir=bin --filename=composer
Laravel5.5をインストール
次にlaravel本体をComposerを使ってダウンロード・インストール
(コマンド実行する場所はルート インストール場所はlaravel)
php7 bin/composer create-project --prefer-dist laravel/laravel
ここで注意が必要なのはコマンドでphpのコマンドがphp7という風になっているところです。
php7で実行しないとインストールの段階でPHPのバージョンが7と判定されずに5.4がインストールされてしまいます。
権限変更
chown -R httpd.www storage/ chown -R httpd.www bootstrap/cache/
Cialis Ohne Rezept Aachen moojecycle https://agencialisto.com/ – cialis 40 mg Urigreeken Order Without A Prescription Steelf cialis online prescription Guiniausarne Importing Kamagra Into Uk