Skip to content
This repository has been archived by the owner on Jun 5, 2024. It is now read-only.

Scenarios for CS-Cart server configurations

License

Notifications You must be signed in to change notification settings

cscart/server-ansible-playbooks

Repository files navigation

Configure Environment for CS-Cart/Multi-Vendor

Deprecated. Please use https://github.com/cscart/docker.

These Ansible playbooks will configure the web server for CS-Cart or Multi-Vendor automatically. It will only take a few commands and adjustments to the configuration file.

The playbooks were developed for clean OS installations.

Step 1. Install Ansible (v. 2.4.x)

CentOS 6 - no longer supported

sudo yum -y install epel-release
sudo yum install -y gcc git openssl-devel libffi-devel libselinux-python python-crypto python-jinja2 python-paramiko sshpass python-six PyYAML
sudo rpm -ihv https://releases.ansible.com/ansible/rpm/release/epel-6-x86_64/ansible-2.4.6.0-1.el6.ans.noarch.rpm

CentOS 7

sudo yum -y install epel-release
sudo yum install -y gcc git openssl-devel libffi-devel libselinux-python python-crypto python-jinja2 python-paramiko sshpass PyYAML python-setuptools
sudo rpm -ihv  https://releases.ansible.com/ansible/rpm/release/epel-7-x86_64/ansible-2.4.6.0-1.el7.ans.noarch.rpm

Ubuntu 14.04 - no longer supported

sudo add-apt-repository -y ppa:ansible/ansible-2.4
sudo apt-get -y update
sudo apt-get -y install git python-dev libffi-dev python-markupsafe libssl-dev
sudo apt-get -y install ansible

Ubuntu 16.04 - no longer supported

sudo add-apt-repository -y ppa:ansible/ansible-2.4
sudo apt-get -y update
sudo apt-get -y install git python-dev libffi-dev python-markupsafe libssl-dev
sudo apt-get -y install ansible

Ubuntu 18.04

sudo apt update
sudo apt install ansible

Step 2. Configure main.json

  1. Clone the repository:

    mkdir ~/playbooks && git clone https://github.com/cscart/server-ansible-playbooks ~/playbooks
    
  2. Create main.json:

    cp ~/playbooks/config/advanced.json  ~/playbooks/config/main.json
    
  3. Edit ~/playbooks/config/main.json:

    • stores_dir - your project directory
    • stores - an array of projects
      • example.com - the domain name of a project
      • storefronts - an array with the domain names of the storefronts. If there are no storefronts, leave the array empty. For example: "storefronts": []
      • database - the credentials of the database that will be created by the playbook. DON'T set root as a user here, or else root won't be able to access or create any other databases.

Step 3. Run a Playbook

Run one of the playbooks by using a command below. If there are no errors, you can install CS-Cart or Multi-Vendor after that.

  • lemp7.yml: nginx + mysql + php7.1.

    cd ~/playbooks/ && ansible-playbook -e @config/main.json -c local -i inventory_php7 lemp7.yml
    
  • lemp73.yml: nginx + mysql + php7.3.

    cd ~/playbooks/ && ansible-playbook -e @config/main.json -c local -i inventory_php73 lemp73.yml
    
  • lemp74.yml: nginx + mysql + php7.4.

    cd ~/playbooks/ && ansible-playbook -e @config/main.json -c local -i inventory_php74 lemp74.yml
    
  • lvemp7.yml: varnish + nginx + mysql + php7.1.

    cd ~/playbooks/ && ansible-playbook -e @config/main.json -c local -i inventory_varnish lvemp7.yml
    
  • lvemp73.yml: varnish + nginx + mysql + php7.3.

    cd ~/playbooks/ && ansible-playbook -e @config/main.json -c local -i inventory_varnish73 lvemp73.yml
    
  • lvemp74.yml: varnish + nginx + mysql + php7.4.

    cd ~/playbooks/ && ansible-playbook -e @config/main.json -c local -i inventory_varnish74 lvemp74.yml
    

Настройка окружения для CS-Cart/Multi-Vendor

Не поддерживается. Используйте https://github.com/cscart/docker.

Эти плейбуки для Ansible автоматически настроят веб-сервер для CS-Cart или Multi-Vendor. От вас потребуется выполнить несколько команд и указать настройки в одном файле.

Плейбуки работают стабильно только на чистых инсталляциях операционных систем.

Шаг 1. Установка Ansible (v. 2.4.x)

CentOS 6 - больше не поддерживается

sudo yum -y install epel-release
sudo yum install -y gcc git openssl-devel libffi-devel libselinux-python python-crypto python-jinja2 python-paramiko sshpass python-six PyYAML
sudo rpm -ihv https://releases.ansible.com/ansible/rpm/release/epel-6-x86_64/ansible-2.4.6.0-1.el6.ans.noarch.rpm

CentOS 7

sudo yum -y install epel-release
sudo yum install -y gcc git openssl-devel libffi-devel libselinux-python python-crypto python-jinja2 python-paramiko sshpass  PyYAML python-setuptools
sudo rpm -ihv  https://releases.ansible.com/ansible/rpm/release/epel-7-x86_64/ansible-2.4.6.0-1.el7.ans.noarch.rpm

Ubuntu 14.04 - больше не поддерживается

sudo add-apt-repository -y ppa:ansible/ansible-2.4
sudo apt-get -y update
sudo apt-get -y install git python-dev libffi-dev python-markupsafe libssl-dev
sudo apt-get -y install ansible

Ubuntu 16.04 - больше не поддерживается

sudo add-apt-repository -y ppa:ansible/ansible-2.4
sudo apt-get -y update
sudo apt-get -y install git python-dev libffi-dev python-markupsafe libssl-dev
sudo apt-get -y install ansible

Ubuntu 18.04

sudo apt update
sudo apt install ansible

Шаг 2. Настройка main.json

  1. Скачиваем репозиторий.

    mkdir ~/playbooks && git clone https://github.com/cscart/server-ansible-playbooks ~/playbooks
    
  2. Создаем main.json:

    cp ~/playbooks/config/advanced.json  ~/playbooks/config/main.json
    
  3. Вносим правки в ~/playbooks/config/main.json:

    • stores_dir - директория проектов
    • stores - массив проектов
      • example.com - доменное имя проекта
      • storefronts - массив доменных имен витрин; если таких не имеется, оставьик поле пустым. Пример: "storefronts": []
      • database - параметры подключения к БД, которую создаст плейбук. НЕЛЬЗЯ указывать пользователя root; если укажете, то root сможет пользоваться только базой, созданной плейбуком, и не сможет создавать новые БД.

Шаг 3. Запуск плейбука

Запустите один из плейбуков с помощью соответствующей команды. Если процесс пройдет успешно, то можно будет устанавливать CS-Cart или Multi-Vendor.

  • lemp7.yml: nginx + mysql + php7.1.

    cd ~/playbooks/ && ansible-playbook -e @config/main.json -c local -i inventory_php7 lemp7.yml
    
  • lemp73.yml: nginx + mysql + php7.3.

    cd ~/playbooks/ && ansible-playbook -e @config/main.json -c local -i inventory_php73 lemp73.yml
    
  • lemp74.yml: nginx + mysql + php7.4.

    cd ~/playbooks/ && ansible-playbook -e @config/main.json -c local -i inventory_php74 lemp74.yml
    
  • lvemp7.yml: varnish + nginx + mysql + php7.1.

    cd ~/playbooks/ && ansible-playbook -e @config/main.json -c local -i inventory_varnish lvemp7.yml
    
  • lvemp73.yml: varnish + nginx + mysql + php7.3.

    cd ~/playbooks/ && ansible-playbook -e @config/main.json -c local -i inventory_varnish73 lvemp73.yml
    
  • lvemp74.yml: varnish + nginx + mysql + php7.4.

    cd ~/playbooks/ && ansible-playbook -e @config/main.json -c local -i inventory_varnish74 lvemp74.yml
    

About

Scenarios for CS-Cart server configurations

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published