Skip to content

Latest commit

 

History

History
99 lines (68 loc) · 2.83 KB

File metadata and controls

99 lines (68 loc) · 2.83 KB
title excerpt updated
Install Strapi on your POWER web hosting plan
Find out how to install Strapi headless CMS on your POWER web hosting plan
2021-02-04

Objective

You've subscribed to a Web POWER web hosting plan to deploy Node.js applications, and you want to deploy Strapi{.external} headless CMS on it.

This guide will explain how to do it.

Find out how to install Strapi on your POWER web hosting plan.

Requirements

If you have just started to use your Web POWER web hosting plan, we suggest to have a look at our Getting started with a POWER web hosting plan guide before going further.

Instructions

Let's suppose you have the default configuration for Node.js hosting:

  • Runtime: nodejs 14
  • Entrypoint: index.js
  • DocumentRoot: www

[!primary]

To verify your configuration, you can use the Retrieve active configuration API endpoint.

Connect via SSH to your POWER web hosting. Let's begin by cleaning the www folder and installing Strapi:

rm -rf www
npx create-strapi-app www --quickstart --no-run

Now let's go into the www folder and create the entrypoint index.js:

const strapi = require('strapi');
 
strapi(/* {...} */).start();

Build admin UI site :

cd www
yarn build

Create also an .htaccess file to manage HTTPS redirection:

RewriteCond %{ENV:HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Then restart your instance and your Strapi headless CMS will be online.

Strapi{.thumbnail}

Terminal output:

 ~ $ rm -rf www

~ $ npx create-strapi-app www --quickstart --no-run
npx: 91 installed in 6.741s
Creating a new Strapi application at /home/user/www.
Creating a quickstart project.
Creating files.
Dependencies installed successfully.
[...]

~ $ cat << 'EOF' > www/index.js
const strapi = require('strapi');
 
strapi(/* {...} */).start();
EOF
~ $ cat << 'EOF' > www/.htaccess
RewriteCond %{ENV:HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
EOF

~/www $ mkdir -p tmp

~/www $ touch tmp/restart.txt

Go further

Join our community of users on https://community.ovh.com/en/.

Join our Discord on our web-hosting-power channel to discuss directly with the team and other users of this lab.