Installing strapi on bitriVM (CentOS7)
Rus
Eng
Установка strapi на bitriVM (CentOS7)

All English-language materials have been translated fully automatically using the Google service

Having developed the site and prepared the entire infrastructure, I was surprised to find that I could not find a suitable guide (for beginners) for installing strapi on centOS. I'll try to share my experience.

Installing Node..js

Go to the root folder of your project. We will execute all commands from it.

  // Go to the project folder
cd / Full_path_to_Your_project /  

First of all, we need to get the repository node.js

Latest (January 2020) version:

  yum install -y gcc-c ++ make
curl -sL https://rpm.nodesource.com/setup_13.x | sudo -E bash -  

Stable version

  yum install -y gcc-c ++ make
curl -sL https://rpm.nodesource.com/setup_12.x | sudo -E bash -  

After adding the repository to the system, install node

  sudo yum install -y nodejs  

To check the node version, use the command:

  node -v  

To check the npm version:

  npm -v  

I got an error while installing. The latest version of node was not installed. The distribution kit 6.4.1 was constantly loaded. The problem was in the cache and it was solved quite simply:

  // Clearing the cache programmatically
yum clean all

// Physically delete the cache folder
rm -rf / var / cache / yum  

Installing strapi

According to the documentation on the developer's site, they recommend yarn as the installer. Let's use their advice

  // Enable yarn repository
curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo

// Import key from GPG repository
sudo rpm --import https://dl.yarnpkg.com/rpm/pubkey.gpg  

Installing yarn

  sudo yum install yarn  

To check the installation, we can find out the version of yarn:

  yarn --version  

Install strapi on the system. Why go to the root of the project and type:

  // Set strapi
npm install strapi @ alpha -g  

The developer documentation clearly states that the alpha version is not recommended on "combat" sites. Either use the stable version, or install at your own risk.

Install sqlite3

  npm install sqlite3 --save  

Create a strapi project

  yarn create strapi-app YOUR_PROJECT_NAME --dev  

or

  strapi new cms --quickstart  

Install admin panel dependencies. Run npm install from the admin folder. panel ./admin

Start the development server. Run npm start from the admin folder. panel ./admin

Configuring strapi for publishing to a live server

If everything went well, then in the project console you will be asked to enter the administrator login and password. at http://localhost:1337/admin

This does not suit us, because we are on a production site, which means we will have to tweak the strapi configuration files. We go to the official documentation page and get acquainted with guide . Then go to the production folder:

  cd / config / environments / production  

Open the file server.json , which, by default, looks like this:

  {
  "host": "localhost",
  "port": 1337,
  "autoReload": {
    "enabled": true
  },
  "cron": {
    "enabled": false
  },
  "admin": {
    "path": "/ dashboard"
  }
}  

We are interested in the host, port, admin / path variables. We modify them to your taste. I got it like this:

  {
  "host": "$ {process.env.APP_HOST || '127.0.0.1' || 'tichiy.ru'}",
  "port": "$ {process.env.PORT || 1111}",
  "production": true,
  "proxy": {
    "enabled": false
  },
  "cron": {
    "enabled": false
  },
  "admin": {
    "autoOpen": false,
"path": "/ dashboard"
  }
}  

Since the port is used non-standard, the first step is to open it. Go to the file / etc / sysconfig / selinux and turn off the selinux setting to get it like this:

  SELINUX = disabled
SELINUXTYPE = targeted  

Then add a new rule to iptables

  iptables -A INPUT -m state --state NEW -p tcp --dport 1111 -j ACCEPT  

Or, if it didn't work out through the console, then go to / etc / sysconfig / iptables and add a new entry manually

  -A INPUT -m state --state NEW -p tcp --dport 1111 -j ACCEPT  

Restart iptables

  systemctl restart iptables
systemctl restart ip6tables  

Almost everything is ready. It remains to go to the admin panel and install a new user. Go to http: // Your_domain: 1111 / Admin_panel and register a new administrator

Comments

There are no comments yet, you can be the first to leave it

Leave a comment

The site uses a comment pre-moderation system, so your message will be published only after approval by the moderator

You are replying to a user's comment

Send

FEEDBACK

Email me

Are you developing a new service, making improvements to the existing one and want to be better than your competitors? You have come to the right place. I offer you a comprehensive studio-level website development. From me you can order design, layout, programming, development of non-traditional functionality, implementation of communication between CMS, CRM and Data Analitics, as well as everything else related to sites, except for promotion.

Contact, I will always advise on all questions and help you find the most effective solution for your business. I am engaged in the creation of sites in Novosibirsk and in other regions of Russia, I also work with the CIS countries. You will be satisfied with our cooperation

An error occurred while sending, please try again after a while
Message sent successfully

Phones

+7(993) 007-18-96

Email

info@tichiy.ru

Address

Россия, г. Москва

By submitting the form, you automatically confirm that you have read and accept the Privacy Policy site

Contact with me
Send message
By submitting the form, you automatically confirm that you have read and accept Privacy policy of site
Sending successful!
Thank you for contacting :) I will contact you as soon as possible
Sending failed
An error occurred while sending the request. Please wait and try again after a while or call my phone number