LoginSignup
0
0

More than 1 year has passed since last update.

【Amazon Lightsail】LAMP環境構築チュートリアル③(アプリケーション編)

Posted at

構築作業

前回の②では、DBの構築まで完了しました。ここからはアプリケーションをデプロイしていきたいと思います。

1. Git Clone

スクリーンショット 2022-09-11 20.05.42.png

  • SSHクライアントのWindow上で下記コマンドを実行します。
$ cd /opt/bitnami/apache2/htdocs
$ git clone https://github.com/LingmuSajun/lamp_test.git

2. phpdotenvインストール

  • SSHクライアントのWindow上で下記コマンドを実行します。
$ cd /opt/bitnami/apache2/htdocs/lamp_test
$ composer require vlucas/phpdotenv

3. .env作成・編集

  • SSHクライアントのWindow上で下記コマンドを実行します。
$ cd /opt/bitnami/apache2/htdocs/lamp_test
$ vi .env
  • 下記の通り.envを編集します。
DB_HOST = 'mysql:dbname=lamp_test;host=localhost;charset=utf8'
DB_USER_NAME = 'ユーザー名'
DB_PASSWORD = 'パスワード'

Webサイト表示確認

スクリーンショット 2022-07-31 19.31.29.png

  • ブラウザからコピーしたIPアドレスにアクセスし、下記のページが開くことを確認します。
http://コピーしたIPアドレス/lamp_test/Countries.html

スクリーンショット 2022-09-25 19.07.37.png

0
0
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
0