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:
parent
6aee0324d4
commit
3c4e7010e0
122
DEPLOYMENT.md
122
DEPLOYMENT.md
@ -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
|
||||
@ -36,16 +55,17 @@ git clone https://www.git.vernahost.ir/gitmodir110/ifnex.git .
|
||||
|
||||
```bash
|
||||
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/.* . 2>/dev/null
|
||||
rm -rf tmp-ifnex
|
||||
```
|
||||
# فقط فایلهای مخفی خاص را کپی کنید
|
||||
cp -r tmp-ifnex/04_Laravel/.env.example .
|
||||
cp -r tmp-ifnex/04_Laravel/.gitignore .
|
||||
# یا بهتر است فایلها را دستی کپی کنید ...
|
||||
|
||||
### ۱.۲ نصب وابستگیها
|
||||
|
||||
```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
|
||||
```
|
||||
|
||||
@ -225,3 +245,95 @@ php artisan route:list --path=api/v1
|
||||
---
|
||||
|
||||
© 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
|
||||
\```
|
||||
|
||||
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
[](https://wordpress.org)
|
||||
[](https://mysql.com)
|
||||
[]()
|
||||
[]()
|
||||
[]()
|
||||
|
||||
---
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user