0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

GCPにDjangoアプリをデプロイ

Posted at

GCPインスタンス上でDjangoアプリをデプロイするまでにやったことをメモとして残す。

システムを最新の状態にする

sudo apt update
sudo apt upgrade -y

nginxのインストールと起動設定

sudo apt install nginx -y

sudo systemctl start nginx

# インスタンス立ち上げ時に自動で起動
sudo systemctl enable nginx

ここまでの作業でIPにアクセスすればNginxのWelcomeページを見れる

gitのインストール

sudo apt install git -y

git --version

Python系

sudo apt install python3-pip

sudo apt install python3.11-venv

python3 -m venv venv

source venv/bin/activate

mysql系

sudo apt-get install python3-dev libmariadb-dev gcc pkg-config

sudo apt-get install mariadb-server

sudo mysql_secure_installation

mysql系のインストールを1からやり直したい場合

sudo apt-get remove --purge mysql-server mysql-client mysql-common mysql-community-server
sudo apt-get autoremove
sudo apt-get autoclean

sudo rm -rf /etc/mysql /var/lib/mysql
sudo rm -rf /var/log/mysql*

sudo rm /etc/apt/sources.list.d/mysql.list

sudo apt-get update

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?