pu

Buscar este blog

sábado, 22 de enero de 2022

Como Instalar Odoo 13 En Centos 8



Hoy realizaremos la instalacion de odoo 13 en una maquina virtual centos 8 minimal desde 0.


1. Verificamos si tenemos instalado DNF con el Siguiente comando.


 sudo dnf update

2. Lo siguiente realizamos la instalacion de EPEL Repository

$ sudo dnf install epel-release

3. Lo siguiente es descargar e instalar todas las dependencias relacionadas para utilizar ODOO por mi parte se instalaron al rededor de 90 paquetes necesarios.

$ sudo dnf install python36 python36-devel git gcc wget nodejs libxslt-devel bzip2-devel openldap-devel libjpeg-devel freetype-devel

4. Ahora necesitamos la base de datos donde realizaremos la carga de todo relacionado con odoo para esto instalaremos POSTGRESQL

$ sudo dnf install postgresql-server postgresql-contrib

5. Ahora inicializamos el servicio en la maquina para que cada vez que inicie este habilitado.

$ sudo postgresql-setup initdb

6. Ahora realizamos una comprobacion de reinicio del sistema y habilitamos.

$ sudo systemctl restart postgresql
$ sudo systemctl enable postgresql

7. A continuacion chequiamos que este funcionando todo ok

$ sudo systemctl status postgresql
8. A continuacion instalamos un paquete indispensable para ODOO que es Wkhtmltopdf
$ sudo dnf install https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox-0.12.5-1.centos8.x86_64.rpm
9. y empezamos a instalar odoo en la maquina creando usuarios y grupos
$ sudo useradd -m -U -r -s /bin/bash odoo -d /opt/odoo 
10. cambiamos al usuario odoo para realizar la instalacion en esa cuenta.
$ sudo su - odoo
11. clonamos el repositorio en la carpeta correspondiente.
$ git clone https://www.github.com/odoo/odoo --depth 1 --branch 13.0 /opt/odoo/odoo13

12. ahora clonamos el enviroment para realizar la instalacion
$ cd /opt/odoo
$ python3 -m venv odoo13-venv
13. verificamos que estamos en el enviroment adecuado
$ source odoo13-venv/bin/activate
14. y realizamos la instalacion de la lista de requerimientos de odoo (esto tarda un momento dependiendo de tu internet y la potencia de la maquina)
pip install --upgrade pip
$ pip3 install -r odoo13/requirements.txt
15. despues de todo ok realizamos la desactivacion de los ambientes de instalacion
$ deactivate && exit
16. creeamos y damos permiso a las carpetas para los addons del sistema odoo

$ sudo mkdir /opt/odoo/odoo13-custom-addons
$ sudo chown -R odoo:odoo /opt/odoo/odoo13-custom-addons
17. en la misma linea creamos direcctorios correspondientes a las configuraciones por default
$ sudo mkdir /var/log/odoo13
$ sudo touch /var/log/odoo13/odoo.log
$ sudo chown -R odoo:odoo /var/log/odoo13/
18. a continuacion creamos el archivo de config odoo
$ sudo vim /etc/odoo.conf

19. escribimos en el siguiente archivo lo siguiente
[options]
; This is the password that allows database operations:
admin_passwd = strong_password
db_host = False
db_port = False
db_user = odoo
db_password = False
xmlrpc_port = 8069
; longpolling_port = 8072
logfile = /var/log/odoo13/odoo.log
logrotate = True
addons_path = /opt/odoo/odoo13/addons,/opt/odoo/odoo13-custom-addons
20. Continuamos con crear el archivo de servicio

$ sudo vim /etc/systemd/system/odoo13.service
21. y escribimos lo sigiunete en el archivo de servicio
[Unit]
Description=Odoo13
#Requires=postgresql-10.6.service
#After=network.target postgresql-10.6.service

[Service]
Type=simple
SyslogIdentifier=odoo13
PermissionsStartOnly=true
User=odoo
Group=odoo
ExecStart=/opt/odoo/odoo13-venv/bin/python3 /opt/odoo/odoo13/odoo-bin -c /etc/odoo.conf
StandardOutput=journal+console

[Install]
WantedBy=multi-user.target
22. realizamos un reload al sistema para que tome los cambios realizados

$ sudo systemctl daemon-reload
23. continuamos con recargar el sistema de odoo e inicializar 
$ sudo systemctl start odoo13
$ sudo systemctl enable odoo13
24. continuamos confirmamos que odoo esta correctamente corriendo.

$ sudo systemctl status odoo13
25. instalamos netstat para habilitar el acceso a la maquina

$ yum -y install net-tools
26. habilitamos el puerto para establecer comunicacion

$ sudo netstat -pnltu | grep 8069
27. para acceder del browser habilitamos desde firewall
$ sudo firewall-cmd --add-port=8069/tcp --zone=public --permanent
$ sudo firewall-cmd --reload
28. ahora instalamos nginx
$ sudo dnf install nginx
29. y pega este codigo en el archivo de odoo13.conf

$ sudo vim /etc/nginx/conf.d/odoo13.conf

siguiendo lo de mas abajo.

upstream odoo {
 server 127.0.0.1:8069;
}
server {
    listen 80;
    server_name server-IP;

    access_log /var/log/nginx/odoo13.access.log;
    error_log /var/log/nginx/odoo13.error.log;

        location / {
        proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Real-IP $remote_addr;

        proxy_redirect off;
        proxy_pass http://odoo;
    }
location ~* /web/static/ {
        proxy_cache_valid 200 90m;
        proxy_buffering on;
        expires 864000;
        proxy_pass http://odoo;
    }
    gzip_types text/css text/less text/plain text/xml application/xml application/json application/javascript;
    gzip on;
}
29. ahora inicializamos nginx
$ sudo systemctl start nginx
$ sudo systemctl enable nginx
30. confrmamos que nginx este funcionando

$ sudo systemctl status nginx
31. entramos a la url del sitio

http://tu-server/
32. actualizacion de error hacer lo siguiente para agregar el rol al usuario odoo

500 internal server error (Linux)

OperationalError: FATAL: role "root" does not exist

You find this error in file : /var/log/postgrsql/postgrsql-10-main.log (on linux system)

The solution may be :

    1- Open Terminal and enter => sudo su postgres
    2- Enter password for postgres System user (if it is necessary)
    3- createuser odoo -s
    4- psql template1
    5- alter role odoo with password 'yourpassword';
    6- \q
    7- exit
    8- service odoo restart

Now try again to localhost:8069

jueves, 13 de enero de 2022

What is header file #include ?




*The C programming language provides many standard library functions for file input and output. These functions make up the bulk of the C standard library header <stdio.h>.

  • The first thing you will notice is the first line of the file, the #include "stdio.h" line. This is very much like the #define the preprocessor , except that instead of a simple substitution, an entire file is read in at this point.
  • The system will find the file named "stdio.h" and read its entire contents in, replacing this statement.
  • Obviously then, the file named "stdio.h" must contain valid C source statements that can be compiled as part of a program.
  • This particular file is composed of several standard #defines to define some of the standard I/O operations.
  • The file is called a header file and you will find several different header files on the source disks that came with your C compiler.
  • Each of the header files has a specific purpose and any or all of them can be included in any program.

  • Your C compiler uses the double quote marks to indicate that the search for the "include" file will begin in the current directory, and if it not found there, the search will continue in the "include" directory as set up in the environment.

  • It also uses the "less than" and "greater than" signs to indicate that the file search should begin in the directory specified in the environment.
  • Most of the programs in this tutorial have the double quotes in the "include" statements. The next program uses the "<" and ">" to illustrate the usage.
  • Note that this will result is a slightly faster (but probably unnoticeable) compilation because the system will not bother to search the current directory.

C – stdio.h library functions

  ********All C inbuilt functions which are declared in stdio.h header file are given below.********

List of inbuilt C functions in stdio.h file:

  1. printf() This function is used to print the character, string, float, integer, octal and hexadecimal values onto the output screen

  2. scanf() This function is used to read a character, string, numeric data from keyboard.

  3. getc() It reads character from file

  4. gets() It reads line from keyboard

  5. getchar() It reads character from keyboard

  6. puts() It writes line to o/p screen

  7. putchar() It writes a character to screen

  8. clearerr() This function clears the error indicators

  9. f open() All file handling functions are defined in stdio.h header file

  10. f close() closes an opened file

  11. getw() reads an integer from file

  12. putw() writes an integer to file

  13. f getc() reads a character from file

  14. putc() writes a character to file

  15. f putc() writes a character to file

  16. f gets() reads string from a file, one line at a time

  17. f puts() writes string to a file

  18. f eof() finds end of file

  19. f getchar reads a character from keyboard

  20. f getc() reads a character from file

  21. f printf() writes formatted data to a file

  22. f scanf() reads formatted data from a file

  23. f getchar reads a character from keyboard

  24. f putchar writes a character from keyboard

  25. f seek() moves file pointer position to given location

  26. SEEK_SET moves file pointer position to the beginning of the file

  27. SEEK_CUR moves file pointer position to given location

  28. SEEK_END moves file pointer position to the end of file.

  29. f tell() gives current position of file pointer

  30. rewind() moves file pointer position to the beginning of the file

  31. putc() writes a character to file

  32. sprint() writes formatted output to string

  33. sscanf() Reads formatted input from a string

  34. remove() deletes a file

  35. fflush() flushes a file

lunes, 3 de enero de 2022

U.S. FDA authorizes Pfizer-BioNTech COVID-19 vaccine boosters for children ages 12-15




 The FDA also shortened the time for booster shots from at least six months after completion of the initial series to at least five months, for everyone aged 12 and older.

WASHINGTON, Jan. 3 (Xinhua) -- The U.S. Food and Drug Administration (FDA) on Monday expanded the emergency use authorization for the Pfizer-BioNTech COVID-19 vaccine boosters to children ages 12 to 15.

The FDA also shortened the time for booster shots from at least six months after completion of the initial series to at least five months, for everyone aged 12 and older.

The agency has determined that the protective health benefits of a single booster dose of the Pfizer-BioNTech COVID-19 vaccine to provide continued protection against COVID-19 and the associated serious consequences outweigh the potential risks in individuals ages 12 to 15.

The agency said that it found "no new safety concerns" following a booster shot in young teenagers, and that there were no new reports of two types of heart inflammation called myocarditis or pericarditis linked to the boosters.

The decision came as the Omicron variant is spreading rapidly across the United States and has led to record high hospitalizations among younger people.