เคญाเค เคฒोเค! เค เคเคฐ เคฐเคเคตा เคญी เค เคชเคจा DigitalOcean เคे Ubuntu server เคชเคฐ Vite + React เคธे เคฌเคจเคฒ frontend website deploy เคเคฐे เคे เคธोเคเคคाเคจी, เคค เค เคชोเคธ्เค เคฐเคเคตा เคाเคคिเคฐ เคฌा।
๐ธ Step 1: Subdomain pointing (DNS Setup)
เคฎाเคจ เคฒเคฝ เคि เคฐเคเคตा IP address เคฌा: 123.45.67.89
Subdomain: myapp.exampledomain.com
- DNS provider (เคเคเคธे GoDaddy, Cloudflare) เคฎें login เคเคฐीं
- เคจเคฏा A Record เคोเคก़ीं:
- Name: myapp
- Type: A
- Value: 123.45.67.89
๐ธ Step 2: Server เคฎें SSH เคธे login เคเคฐीं
ssh root@123.45.67.89
๐ธ Step 3: Git เคธे project clone เคเคฐीं
cd /var/www/
git clone https://github.com/username/your-vite-project.git myapp
๐ธ Step 4: Project build เคเคฐीं (Vite + React)
cd myapp
npm install
npm run build
๐ธ Step 5: NGINX configure เคเคฐीं
sudo nano /etc/nginx/sites-available/myapp.exampledomain.com
เคเคน เคฎें เคจीเคे เคตाเคฒा config paste เคเคฐीं:
server {
listen 80;
server_name myapp.exampledomain.com;
root /var/www/myapp/dist;
index index.html;
location / {
try_files $uri $uri/ /index.html;
}
}
๐ธ Step 6: NGINX enable เคเคฐीं
sudo ln -s /etc/nginx/sites-available/myapp.exampledomain.com /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx
๐ธ Step 7: HTTPS (SSL Certificate) เคฒเคाเคं
sudo apt install certbot python3-certbot-nginx -y
sudo certbot --nginx -d myapp.exampledomain.com
๐ เค เคฌ เคฌเคงाเค เคนो!
Browser เคฎें เคोเคฒ เคธเคเคคाเคจी:
https://myapp.exampledomain.com
✅ Recap
| เคเคฐเคฃ | เคाเคฎ |
|---|---|
| Subdomain | DNS A record pointing |
| Code Clone | GitHub เคธे เคฒाเคตเคฒ |
| Build | Vite เคธे production build |
| Serve | NGINX เคे เคฎเคฆเคฆ เคธे serve |
| SSL | Certbot เคธे HTTPS secure |
เค เคคเคฐीเคा เคธे เคฐเคเคตा เคเคธाเคจी เคธे React/Vite เคตाเคฒा frontend เคฆुเคจिเคฏा เคे เคฆिเคा เคธเคเคคाเคจी!

No comments:
Post a Comment