# Google GCP VM設定 ## 機器設定 > 選一代 隨意選  ## 開機磁碟 UBANTU // 18.04 防火牆兩個都打勾  ## 打開GCP終端機  選擇在瀏覽器開啟 ## 安裝NVM ``` sh= curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash nvm install #14 (可選,NODE的版本) ``` ## 安裝NodeJS ``` sh # 參考網址:https://github.com/nodesource/distributions # Using Ubuntu NodeJS v14.x curl -fsSL https://deb.nodesource.com/setup_14.x | sudo -E bash - sudo apt-get install -y nodejs ``` ## 安裝pm2 ``` sh= npm install -g pm2 ``` ## 安裝git ``` sh= sudo apt update sudo apt install git ``` ## 安裝Nginx ``` sh= sudo apt update sudo apt install nginx ``` ## 設置固定IP流程  >把臨時設置為靜態   >選加入> 類型選A > 主機位置在GCP的外部地址中  ## Nginx 反向代理參數設定 進入conf.d資料夾,去設定Nginx反向代理的參數 ``` sh= cd /etc/nginx/conf.d sudo nano yourdomain.conf ``` >配置服務 ``` nano= server { server_name yourdomain www.yourdomain; location / { proxy_pass http://localhost:8080; } } ``` >部屬靜態網頁 ``` nano= server { server_name vue.jimmyy512.com; location / { root HTML絕對路徑(可以透過pwd指令查詢HTML在機器上的路徑); index index.html index.htm; } } ``` ## Nano反白刪除 First, you need to press CTRL + Shift + 6 to mark the start of your block Now, shift the cursor to the end of the block with the arrow keys, and it will outline the text. Finally, press CTRL + K to cut/delete a block and it will remove a line in nano.
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up