Перейти к содержимому
Odoo Меню
  • Войти
  • Попробовать бесплатно
  • Модули
    Финансы
    • Бухгалтерия
    • Выставление счетов
    • Расходы
    • Таблицы
    • Документооборот
    • Подпись
    Продажи
    • CRM
    • Продажи
    • POS Магазин
    • POS Ресторан
    • Подписки
    • Аренда
    Вебсайты
    • Конструктор вебсайтов
    • eCommerce
    • Блог
    • Форум
    • Онлайн-чат
    • Электронное обучение
    Логистика
    • Склад
    • Производство
    • PLM
    • Закупки
    • Обслуживание
    • Качество
    Отдел кадров
    • Сотрудники
    • Подбор персонала
    • Отпуска
    • Оценка персонала
    • Реферальная программа
    • Автопарк
    Маркетинг
    • SMM
    • E-mail рассылки
    • СМС рассылки
    • Мероприятия
    • Автоматизация маркетинга
    • Опросы
    Услуги
    • Проекты
    • Табели
    • Выездной сервис
    • Поддержка
    • Планирование
    • Встречи
    Продуктивность
    • Обсуждения
    • Согласование
    • IoT
    • VoIP-телефония
    • Knowledge
    • WhatsApp
    Сторонние приложения Модуль Студия Odoo Платформа Odoo Cloud
  • Индустрии
    Розничная торговля
    • Книжный магазин
    • Магазин одежды
    • Мебельный магазин
    • Продуктовый магазин
    • Строительный магазин
    • Магазин игрушек
    Гостинично-ресторанный бизнес
    • Бар и паб
    • Ресторан
    • Фастфуд
    • Гостевой дом
    • Дистрибьютор напитков
    • Отель
    Недвижимость
    • Агентство недвижимости
    • Архитектурное бюро
    • Строительство
    • Управление недвижимостью
    • Ландшафтный дизайн
    • Товарищество собственников жилья
    Консалтинг
    • Бухгалтерская фирма
    • Партнер Odoo
    • Маркетинговое агентство
    • Юридическая фирма
    • Подбор персонала
    • Аудиторское бюро
    Производство
    • Текстиль
    • Металл
    • Мебель
    • Продукты питания
    • Пивоварня
    • Корпоративные сувениры
    Здоровье и фитнес
    • Спортивный комплекс
    • Магазин оптики
    • Фитнес-клуб
    • Велнес-центр
    • Аптека
    • Салон красоты
    Услуги
    • Специалист по бытовым услугам
    • Продажа и обслуживание IT-оборудования
    • Солнечные энергосистемы
    • Производство обуви
    • Клининг
    • Системы ОВКВ
    Прочее
    • Некоммерческая организация
    • Консалтинг в сфере устойчивого развития
    • Аренда рекламных щитов
    • Бизнес по фотосъемке
    • Прокат велосипедов
    • Реселлер программного обеспечения
    Все индустрии
  • Community
    Обучение
    • Видео уроки
    • Документация
    • Сертификация
    • Тренинг
    • Блог
    • Подкаст
    Образование и развитие
    • Образовательная программа
    • Деловая игра Scale Up!
    • Экскурсия в офис Odoo
    ПО
    • Скачать
    • Сравнить версии
    • Релизы
    Сотрудничество
    • Github
    • Форум
    • Мероприятия
    • Перевод
    • Стать партнером
    • Услуги для партнеров
    • Зарегистрировать бухгалтерскую фирму
    Услуги
    • Найти партнера
    • Найти бухгалтера
    • Встреча с экспертом
    • Услуги по внедрению
    • Отзывы клиентов
    • Поддержка
    • Обновления
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Заказать демонстрацию
  • Цены
  • Поддержка

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Бухгалтерия
  • Склад
  • PoS
  • Проекты
  • MRP
All apps
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Все посты Люди Значки
Теги (Смотреть все)
odoo accounting v14 pos v15
Об этом форуме
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Все посты Люди Значки
Теги (Смотреть все)
odoo accounting v14 pos v15
Об этом форуме
Помощь

Website and OpenERP on a VPS Server with subdomain, How to ?

Подписаться

Получайте уведомления о появлении активности в этом посте

Этот вопрос был отмечен
databasepostgresqlnginxcloudphpipsubdomainopenerp7openerpvpsapache2website
1 Ответить
9482 Представления
Аватар
ThackerS (ts)

Good evening everyone.
For 5 days, I'm stuck on a problem I have to solve for one of my clients. Here's the problem.
My client has a VPS server. The server has an IP address (eg 192.168.1.1) and is connected to a domain name (eg http://www.bigme.com).

The customer wants his website and openerp is available on the same VPS.

Website coded in php would be available at http://www.bigme.com and openerp would be available at http://demo.bigme.com where demo is openerp database. Here's an example of what I have realized :

website: http://www.dailyerp.net/
openerp: http://lonlon.dailyerp.net/
lonlon is the database of openerp.
(eg: If I select the database "tutu", so I will get : http://tutu.bigme.com)

Actually, I know that the problem can be solved with a configuration at the web server. Which web server should i use apache2 or nginx for better performance ? How i can do it ? How I should proceed?
Any help would be welcome.

NB: I use openerp version 7

0
Аватар
Отменить
Аватар
Ben Bernard
Лучший ответ

Which web server should i use apache2 or nginx for better performance ?

I have learnt that performance is not a real issue in an early project. In your case I will choose nginx because its simplicity. For me, nginx configuration is easier to read than apache configuration.

My solution is something like this.

  • dabase name convention : should be in lowercase
  • default server is www.localhost.local (php web server). It should be replaced with real domain.
  • openerp server is openerp.localhost.local
  • any access to subdomain other than 'openerp' will be redirected to openerp.localhost.local

The http context is something like the following.

http {
    include       mime.types;
    default_type  application/octet-stream;

    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;

    server_names_hash_bucket_size 64;
    
    upstream openerp {
        server 127.0.0.1:8869;
    }
        
    server {
        listen       80;
        server_name  www.localhost.local;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            # it could be php app
            try_files $uri $uri/ /index.html;
        }
         
        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }

    server {
        listen       80;
        server_name ~^(?<subdomain>.*)\.localhost\.local$;
        
        if ($subdomain != 'openerp') {
            rewrite ^ http://openerp.localhost.local/?db=$subdomain last;
        }
    }
    
    server {
        listen       80;
        server_name  openerp.localhost.local;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            try_files $uri @python_openerp;
        }

        location @python_openerp {
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header  X-Forwarded-Proto $scheme;
            proxy_set_header Host $host;
            proxy_redirect off;
            proxy_read_timeout 300;
            proxy_pass http://openerp;
        }       
        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }
}

And don't forget to edit the hosts file.

0
Аватар
Отменить
ThackerS (ts)
Автор

Hi dear Ben. Thank you for your reply. i have many question : 1) upstream openerp { server 127.0.0.1:8869; } In my case, if my VPS IP is 192.168.12.1, i will have : upstream openerp { server 192.168.12.1:8069; } where 8069 is the port of openerp ?? 2) server { listen 80; server_name www.localhost.local; .... } In my case, if my domain is www.bigme.com, i will have servername www.bigme.com ?? 3) server { listen 80; server_name openerp.localhost.local; ... } In my case, if my domain is www.bigme.com, i will have openerp.bigme.com ?? 4) With the nginx code above, i will get subdomain dynamically ( something like db1.bigme.com if i select the database db1 of openerp) ?? 5) Finally, you talk about the hosts file of my VPS ? If yes why should i edit it ? thankk you.

Ben Bernard

1) yes. 2) yes. 3) yes. 4) No, this configuration is for reverse behavior, ie. you type db1.bigme.com and it will be redirected to openerp.bigme.com/?db=db1. 5) To resove your subdomain name in test mode. In production, maybe you should edit your dns record.

Ben Bernard

As a second though, depends on reverse proxy configuration is limited to number of odoo services and odoo default url scheme. There is another solution where you can make one odoo instance per subdomain (and hide the ?db=mydb url option). Other solution is to hack odoo code and make the db filtered by subdomain. My point is to make no redundant data about which db is being chosen, either from subdomain or url.

ThackerS (ts)
Автор

Hi Ben. I see you master the subject. Please, could you give me some links that will help me, because I have not understood.

ThackerS (ts)
Автор

Please sees the 2 links (http://www.dailyerp.net/ and http://lonlon.dailyerp.net/) ==> it's exactly what i want to do. And my openerp instance can be run with the url : db.mydomain.com with db= my openerp database.

Ben Bernard

Maybe you interested with this question https://www.odoo.com/forum/help-1/question/separate-databases-on-different-ports-61813

ThackerS (ts)
Автор

it's not my real thinking

Не оставайтесь в стороне – присоединяйтесь к обсуждению!

Создайте аккаунт сегодня, чтобы получить доступ к эксклюзивным функциям и стать частью нашего замечательного сообщества!

Регистрация
Похожие посты Ответы Просмотры Активность
Install openerp v7 and a php website on the same VPS server
postgresql v7 php url openerp vps
Аватар
Аватар
Аватар
4
мар. 16
9697
Run website/portal on different domain
database nginx portal loginpage website
Аватар
0
авг. 21
5307
Query Cloud Hosted Odoo PostgreSQL from external source Решено
database postgresql cloud query 12.0
Аватар
Аватар
2
июл. 19
5359
How to get the database list using XMLRPC webservice with Php ?
database postgresql php xmlrpc webservice
Аватар
Аватар
1
мар. 15
9116
Deploy openerp 7 in production environment, How to ? Решено
windows server ubuntu cloud deployment localhost openerp7 openerp vps deploy v14
Аватар
Аватар
1
мар. 15
7126
Сообщество
  • Видео уроки
  • Документация
  • Форум
Открытый исходный код
  • Скачать
  • Github
  • Runbot
  • Перевод
Услуги
  • Хостинг Odoo.sh
  • Поддержка
  • Обновление
  • Индивидуальные решения по доработке
  • Образование
  • Найти бухгалтера
  • Найти партнера
  • Стать партнером
О нас
  • Наша компания
  • Активы бренда
  • Cвяжитесь с нами
  • Вакансии
  • Мероприятия
  • Подкаст
  • Блог
  • Клиенты
  • Правовые документы • Конфиденциальность
  • Безопасность
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo – это набор бизнес-модулей с открытым исходным кодом, который закроет все потребности вашей компании: CRM, E-commerce, Бухгалтерия, Склад, POS, управление проектами и др.

Odoo сочетает в себе простоту использования и полную интеграцию всех бизнес-процессов в одной системе.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now