modificación de archivos de configuración de apache
This commit is contained in:
parent
f349d248bd
commit
3ee8689b74
@ -5,3 +5,6 @@ https://htmlstream.com/preview/front-v3.2/documentation/aos.html
|
|||||||
psql -h 127.0.0.1 -U postgres -d formha -a -f forma_backup_24_04_2025.sql
|
psql -h 127.0.0.1 -U postgres -d formha -a -f forma_backup_24_04_2025.sql
|
||||||
|
|
||||||
|
|
||||||
|
psql -h 127.0.0.1 -U postgres -d formha -a -f formha_backup.sql
|
||||||
|
|
||||||
|
|
||||||
|
82
README.md
82
README.md
@ -1 +1,81 @@
|
|||||||
# En producción debes descomentar estas
|
# Descargar y mover el repositorio
|
||||||
|
```bash
|
||||||
|
cd ~
|
||||||
|
git clone gitea@192.168.10.40:dix/formha.git
|
||||||
|
sudo mv formha/ /var/www
|
||||||
|
cd /var/www/formha/
|
||||||
|
```
|
||||||
|
|
||||||
|
# Entrar en modo Dios
|
||||||
|
```bash
|
||||||
|
sudo su
|
||||||
|
```
|
||||||
|
|
||||||
|
# Crear el ambiente virtual
|
||||||
|
```bash
|
||||||
|
python3 -m venv .venv
|
||||||
|
source .venv/bin/activate
|
||||||
|
pip install -r requirements.txt
|
||||||
|
deactivate
|
||||||
|
```
|
||||||
|
|
||||||
|
# Salimos del modo Dios
|
||||||
|
```bash
|
||||||
|
exit
|
||||||
|
```
|
||||||
|
|
||||||
|
# Añade las variables de entorno del proyecto al archivo envars
|
||||||
|
```bash
|
||||||
|
sudo nano /etc/apache2/envvars
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash
|
||||||
|
#\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
|
||||||
|
# inicio variables de formha
|
||||||
|
# contraseña applicaciones DIX: MOD
|
||||||
|
export email_sender="systems.dix.dev@gmail.com"
|
||||||
|
export pswd_formha="qcpg picq gnxp kwtx"
|
||||||
|
export jwt_secret_key="pswd_2025_formha_s3cr3t_k3i_4pp"
|
||||||
|
export email_secret_key="FoRmHä_z0z5"
|
||||||
|
export forma_db='{
|
||||||
|
"host":"db_s", "port":5432, "database":"formha", "user":"postgres", "password":"Shala55951254"
|
||||||
|
}';
|
||||||
|
# final variables de formha
|
||||||
|
#/////////////////////////////////////
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
# Movemos el archivo de configuración a Apache (solo se hace 1 vez)
|
||||||
|
## SI TE DA ERROR PRIMERO DESACTIVA APACHE EL PROBLEMA ES LAS VARIABLES DE ENTORNO
|
||||||
|
sudo systemctl stop apache2
|
||||||
|
sudo mv formha.conf /etc/apache2/sites-available/
|
||||||
|
cd /etc/apache2/sites-available/
|
||||||
|
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo systemctl reload apache2
|
||||||
|
sudo systemctl restart apache2
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#########################################################################################################
|
||||||
|
# variables de entorno DIX
|
||||||
|
#########################################################################################################
|
||||||
|
export tac_db='{
|
||||||
|
"host":"db_s",
|
||||||
|
"port":5432,
|
||||||
|
"database":"tac_reclutamiento",
|
||||||
|
"user":"postgres",
|
||||||
|
"password":"Shala55951254"
|
||||||
|
}';
|
||||||
|
|
||||||
|
export n_server="Server No. 1";
|
||||||
|
|
||||||
|
export ip_device=$(ifconfig | grep -A 1 '^[a-zA-Z]' | grep 'inet ' | head -n 1 | awk '{print $2}')
|
||||||
|
|
||||||
|
|
||||||
|
@ -4,14 +4,14 @@
|
|||||||
ServerAlias formha.temporal.work
|
ServerAlias formha.temporal.work
|
||||||
DocumentRoot /var/www/formha
|
DocumentRoot /var/www/formha
|
||||||
|
|
||||||
WSGIDaemonProcess app user=www-data group=www-data threads=4 python-home=/var/www/formha/.venv
|
WSGIDaemonProcess app_formha user=www-data group=www-data threads=4 python-home=/var/www/formha/.venv
|
||||||
WSGIScriptAlias / /var/www/formha/formha.wsgi
|
WSGIScriptAlias / /var/www/formha/formha.wsgi
|
||||||
|
|
||||||
ErrorLog /var/www/formha/log/error.log
|
ErrorLog /var/www/formha/log/error.log
|
||||||
CustomLog /var/www/formha/log/access.log combined
|
CustomLog /var/www/formha/log/access.log combined
|
||||||
|
|
||||||
<Directory /var/www/formha>
|
<Directory /var/www/formha>
|
||||||
WSGIProcessGroup app
|
WSGIProcessGroup app_formha
|
||||||
WSGIApplicationGroup %{GLOBAL}
|
WSGIApplicationGroup %{GLOBAL}
|
||||||
# Order deny,allow
|
# Order deny,allow
|
||||||
Require all granted
|
Require all granted
|
||||||
|
@ -2,10 +2,10 @@ import sys
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
# ruta de linux al proyecto de flask
|
# ruta de linux al proyecto de flask
|
||||||
sys.path.insert(0, '/var/www/Formha')
|
sys.path.insert(0, '/var/www/formha')
|
||||||
|
|
||||||
# ruta de linux al ambiente virtual de flask
|
# ruta de linux al ambiente virtual de flask
|
||||||
sys.path.insert(0, '/var/www/Formha/.venv/lib/python3.12/site-packages')
|
sys.path.insert(0, '/var/www/formha/.venv/lib/python3.12/site-packages')
|
||||||
|
|
||||||
# Set up logging
|
# Set up logging
|
||||||
logging.basicConfig(stream=sys.stderr, level=logging.DEBUG)
|
logging.basicConfig(stream=sys.stderr, level=logging.DEBUG)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user