2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Amazon Lightsailでwordpress環境構築するときのメモ

Last updated at Posted at 2022-03-30

ansible対応するまではLightsailでポチポチ作成するのでメモ

前提

プラットフォーム : Linux
使用イメージ : アプリ+OS WordPress
すでに構築中のソースがあり、公開環境を作成したいという状況

gitインストール

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install git

インスタンス作成後sshして作業するか起動スクリプトに指定する

管理画面パスワード確認

cat /home/bitnami/bitnami_application_password
ユーザー名は user

wp-contentの入れ替え

ホームディレクトリにgithubからソースをクローン
cd ~/
git clone hogehoge@github.com:hoge/hogehoge.git

wp-contentを入れ替える
cd /bitnami/wordpress/ && sudo mv wp-content _wp-content
シンボリックリンクをはる
ln -s /home/bitnami/path/to/wp-content wp-content
所有者権限を元に戻す
sudo chown -h bitnami:daemon wp-content

テーマ選択をする

管理画面
appearance > themes
カスタマイズしたテーマを追加

basic認証をかける

sudo vim /opt/bitnami/apache2/conf/vhosts/wordpress-vhost.conf
    AuthType Basic
    AuthName "auth"
    AuthUserFile /opt/bitnami/apache/conf/.htpasswd
    Require valid-user
    # Require all granted
 sudo htpasswd /opt/bitnami/apache/conf/.htpasswd username
sudo /opt/bitnami/ctlscript.sh restart

sqldump流し込み

/bitnami/wordpress/wp-config.php
でDB情報確認。任意のデータをリストアする

sslしたくば

https://aws.amazon.com/jp/premiumsupport/knowledge-center/lightsail-install-certbot-package/
https://aws.amazon.com/jp/premiumsupport/knowledge-center/lightsail-standard-ssl-certificate/

2
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
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?