tera termをインストールします。 以下のサイトからダウンロードしてインストールしてください。 https://ja.osdn.net/projects/ttssh2/releases/
winscpをインストールします 以下のサイトからダウンロードしてインストールしてください。
https://forest.watch.impress.co.jp/library/software/winscp/
powershellを起動します
power shellから
mysqldump -u username -p -h localhost tcgcreator > test.sql
と入力します
conohaのユーザー登録等はご自分でなさってください
管理画面でサーバーを選択します
プランはチュートリアルなので一番安いプランをお勧めします。ubuntu20.04を選択します
サーバー管理画面から詳細情報を入力します。
ipアドレスをメモります
新しいサイトをclickして、host名に先ほどメモったipアドレスuserにroot パスワードはさきほどconohaに入力してものを入力します。
winscpにてtcg_creator_instal.sh,mysiteをコピーします
tera termで
bash ./tcgcreator_tutorial
と入力します
mysql -uusername -ppassword tcgcreator < tcgcreator.sql
winscpで /etc/systemd/systemに移動します
gunicorn.serviceをアップロードします
winscpで /etc/nginx/sites-availableに移動します
mysite.txtをアップします
/root/mysite/mysiteに移動しsettings.pyのallowed_hostsに先ほどメモったipaddressを入力牛ます
ALLOWED_HOSTSに先ほどメモったIPアドレスを入力します
ALLOWED_HOSTS = [...]
ここからはtera termです。
tera termにIPアドレスをさっきメモったipaddressパスワードに先ほど入力したパスワードを入力します。
以下のコマンドを入力します
sudo ln -s /etc/nginx/sites-available/mysite.txt /etc/nginx/sites-enabled/
sudo ufw delete allow 8000
sudo ufw allow ‘Nginx Full’
ce mysite
python3 manage.py collectstatic
sudo systemctl restart gunicorn
sudo systemctl restart nginx
以上で基本的なデプロイは終了です。 サイトのアドレスや、HTTPS化は以下のサイトを参考にしてください。
https://tomato-develop.com/django-ubuntu-python-nginx-gunicorn-postgresql/