docs(config): add deployment procedures and server configuration guides

Expand deployment documentation to include database and file backup
commands, web server configurations for Nginx and Apache, Supervisor
setup for queue workers, and SSL/TLS installation via Certbot.

Also update the project status badge in README.md to reflect
progress completion.
This commit is contained in:
Kazem Alghasi 2026-08-28 22:52:00 +03:30
parent 6aee0324d4
commit 3c4e7010e0
2 changed files with 118 additions and 6 deletions

View File

@ -25,6 +25,25 @@
## ۱. استقرار لاراول ## ۱. استقرار لاراول
### بکاپ دیتابیس
\```bash
# بکاپ کامل دیتابیس
mysqldump -u root -p ifnex_db > /backups/ifnex_$(date +%Y%m%d_%H%M%S).sql
# یا فشرده
mysqldump -u root -p ifnex_db | gzip > /backups/ifnex_$(date +%Y%m%d_%H%M%S).sql.gz
\```
### بکاپ فایل‌ها
\```bash
# بکاپ فایل‌های لاراول
tar -czf /backups/laravel_$(date +%Y%m%d_%H%M%S).tar.gz /home/USER/web/api.ifnex.vernahost.ir/public_html
# بکاپ فایل‌های وردپرس
tar -czf /backups/wordpress_$(date +%Y%m%d_%H%M%S).tar.gz /home/USER/web/ifnex.vernahost.ir/public_html
\```
### ۱.۱ کلون مخزن روی سرور ### ۱.۱ کلون مخزن روی سرور
```bash ```bash
@ -36,16 +55,17 @@ git clone https://www.git.vernahost.ir/gitmodir110/ifnex.git .
```bash ```bash
cd /home/USER/web/api.ifnex.vernahost.ir/public_html cd /home/USER/web/api.ifnex.vernahost.ir/public_html
ngit clone https://www.git.vernahost.ir/gitmodir110/ifnex.git tmp-ifnex git clone https://www.git.vernahost.ir/gitmodir110/ifnex.git tmp-ifnex
cp -r tmp-ifnex/04_Laravel/* . cp -r tmp-ifnex/04_Laravel/* .
cp -r tmp-ifnex/04_Laravel/.* . 2>/dev/null # فقط فایل‌های مخفی خاص را کپی کنید
rm -rf tmp-ifnex cp -r tmp-ifnex/04_Laravel/.env.example .
``` cp -r tmp-ifnex/04_Laravel/.gitignore .
# یا بهتر است فایل‌ها را دستی کپی کنید ...
### ۱.۲ نصب وابستگی‌ها ### ۱.۲ نصب وابستگی‌ها
```bash ```bash
ncd /home/USER/web/api.ifnex.vernahost.ir/public_html cd /home/USER/web/api.ifnex.vernahost.ir/public_html
composer install --no-dev --optimize-autoloader composer install --no-dev --optimize-autoloader
``` ```
@ -225,3 +245,95 @@ php artisan route:list --path=api/v1
--- ---
© 2026 VernaSoft Group. Internal use only. © 2026 VernaSoft Group. Internal use only.
## ۷. تنظیمات Web Server
### Nginx (لاراول)
\```nginx
server {
listen 80;
server_name api.ifnex.vernahost.ir;
root /home/USER/web/api.ifnex.vernahost.ir/public_html/public;
index index.php;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.(?!well-known).* {
deny all;
}
}
\```
### Apache (لاراول)
\```apache
<VirtualHost *:80>
ServerName api.ifnex.vernahost.ir
DocumentRoot /home/USER/web/api.ifnex.vernahost.ir/public_html/public
<Directory /home/USER/web/api.ifnex.vernahost.ir/public_html/public>
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/api.ifnex.error.log
CustomLog ${APACHE_LOG_DIR}/api.ifnex.access.log combined
</VirtualHost>
\```
## ۸. Queue Worker (اگر استفاده می‌شود)
### Supervisor Setup
\```bash
sudo nano /etc/supervisor/conf.d/ifnex-worker.conf
\```
\```ini
[program:ifnex-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /home/USER/web/api.ifnex.vernahost.ir/public_html/artisan queue:work --sleep=3 --tries=3 --max-time=3600
autostart=true
autorestart=true
stopasgroup=true
killasgroup=true
user=USER
numprocs=2
redirect_stderr=true
stdout_logfile=/home/USER/web/api.ifnex.vernahost.ir/public_html/storage/logs/worker.log
\```
\```bash
sudo supervisorctl reread
sudo supervisorctl update
sudo supervisorctl start all
\```
## ۹. SSL/TLS (HTTPS)
### Let's Encrypt (رایگان)
\```bash
# نصب Certbot
sudo apt install certbot python3-certbot-nginx
# دریافت SSL certificate
sudo certbot --nginx -d api.ifnex.vernahost.ir -d ifnex.vernahost.ir
# تمدید خودکار (تست)
sudo certbot renew --dry-run
\```

View File

@ -10,7 +10,7 @@
[![WordPress](https://img.shields.io/badge/WordPress-7.0.3-21759B?logo=wordpress&logoColor=white)](https://wordpress.org) [![WordPress](https://img.shields.io/badge/WordPress-7.0.3-21759B?logo=wordpress&logoColor=white)](https://wordpress.org)
[![MySQL](https://img.shields.io/badge/MySQL-8+-4479A1?logo=mysql&logoColor=white)](https://mysql.com) [![MySQL](https://img.shields.io/badge/MySQL-8+-4479A1?logo=mysql&logoColor=white)](https://mysql.com)
[![License](https://img.shields.io/badge/License-Proprietary-blue.svg)]() [![License](https://img.shields.io/badge/License-Proprietary-blue.svg)]()
[![Status](https://img.shields.io/badge/Status-Phase_3-60%25-yellow.svg)]() [![Status](https://img.shields.io/badge/Status-Phase_3-95%25-success.svg)]()
--- ---