Инструменты пользователя

Инструменты сайта

en:installation_on_centos:start

Installation on CentOS Linux 7

Installed PostgeSQL

export LC_ALL="en_US.UTF-8"

yum install -y postgresql-server

Initialize the database and add it in startup

service postgresql initdb

systemctl enable postgresql.service

systemctl start postgresql.service

Create a database and its owner

su postgres

psql
CREATE USER scuser WITH PASSWORD '123456';

CREATE DATABASE severcart WITH ENCODING='UTF8' OWNER=scuser CONNECTION LIMIT=-1 template=template0;

Exit the psql shell

\q

Switch to root user

su -

Allow access to the user scuser to connect to postgres. To do this in the file /var/lib/pgsql/data/pg_hba.conf change the line

host    all             all             127.0.0.1/32            ident

on

host    all             all             127.0.0.1/32            md5

Fixed configuration changes

systemctl restart postgresql.service

Install python

yum install -y python34

python3 -m venv /var/venv/

mkdir -p /var/venv/severcart/

Install Severcart

cd /tmp
wget http://files.severcart.org/un/1_X_X.zip

unzip 1_X_X.zip -d /var/venv/severcart

The installation of python packages

source /var/venv/bin/activate

python3 /var/venv/severcart/tkinstaller/install.py

The installation wizard prompts you to select the language to install. «en» select and press Enter.

During the installation will install the dependencies, migration of database schema, creation administrator severcart.

Install the web service

yum install nginx supervisor -y

systemctl enable nginx 

systemctl disable httpd

systemctl enable supervisord

systemctl stop httpd

systemctl start nginx

Override section of the server in the file /etc/nginx/nginx.conf content

server {
    listen 80;
    server_name 0.0.0.0; #либо ip, либо доменное имя
    access_log  /var/log/nginx/severcart_access.log;
    error_log  /var/log/nginx/severcart_error.log;

    location /static/ {
        root /var/venv/severcart/;
        expires 30d;
    }
    
    location /media/ {
        root /var/venv/severcart/;
        expires 30d;
    }

    location / {
        proxy_pass http://127.0.0.1:9000; 
        proxy_set_header Host $server_name;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}

Assign the necessary access rights to the file

chmod 755 -R /var/venv/severcart/
chown nobody:nobody -R /var/venv/severcart/
cd /etc/supervisord.d
touch severcart.ini
[program:severcart]
command=/var/venv/bin/gunicorn conf.wsgi_prod:application -c /var/venv/severcart/conf/gunicorn.conf.py
directory=/var/venv/severcart
user=nobody
autorestart=true
redirect_stderr=true
service supervisord start

supervisorctl reread
supervisorctl update
supervisorctl status severcart
supervisorctl restart severcart


systemctl restart nginx

Next, check the browser's opening page. If you see the prompt to enter a username and password, then the installation completed successfully.

Attention!!! After successfully installing the program the password of the PostgreSQL user scuser it is recommended to change to a more resistant.

 

Инструменты страницы