Strapi Ubuntu 20 Nginx или Apach

Strapi Server Ubuntu используя базу данных Strapi. Работа скрипта на порту 80 под Nginx.

# How To Install Strapi API with Nginx on Ubuntu 20.04 LTS
 
----------------------------------------------------------
# Strapi is an open-source, Node.js based, headless CMS to manage content and make it available through a fully customizable API. It is designed to build practical, production-ready Node.js APIs in hours instead of weeks.

# Offcial Website -https://strapi.io/  || https://strapi.io/getting-started/

# Nginx (pronounced engine x) is open source Web server software that also performs reverse proxy, load balancing, email proxy and HTTP cache services.
# Offcial Website - https://www.nginx.com/
# NGINX Reverse Proxy - https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/
-------------------------------------------------------------
# Ubuntu 20.04 LTS                     Hostname - www.yourdomain.com  - ip Address - 192.168.1.10 
--------------------------------------------------------------
apt update ; apt install -y build-essential net-tools curl git software-properties-common nginx
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
apt install nodejs -y
node -v ; npm -v

npm install [email protected] -g  --silent
strapi version
strapi new myproject
cd myproject

npm install forever -g  --silent
forever start --minUptime 1000 --spinSleepTime 1000 -c "npm start" ./

nano /etc/nginx/conf.d/yourdomain.com.conf
server {
        listen 80;
        server_name www.yourdomain.com;

        location / {
                proxy_pass http://127.0.0.1:1337;
                proxy_set_header Host $http_host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto $scheme;
        }
}
nginx -t
netstat -tlpn | grep 1337 
systemctl daemon-reload ; systemctl restart nginx
echo "192.168.1.10 www.yourdomain.com"  >> /etc/hosts

# http://www.yourdomain.com
# http://www.yourdomain.com/admin

Strapi Server Ubuntu используя базу данных Strapi. Работа скрипта на порту 80 под Apach.

# How To Install Strapi API with Apache2 Web Server on Ubuntu 20.04 LTS
# Video Tutorial - https://youtu.be/neQoSdeaI54
-------------------------------------------------
 
# Strapi is an open-source, Node.js based, headless CMS to manage content and make it available through a fully customizable API. It is designed to build practical, production-ready Node.js APIs in hours instead of weeks.

# Offcial Website -https://strapi.io/  || https://strapi.io/getting-started/

# Apache is the most popular web server software in use today.|| Offcial website https://httpd.apache.org/
# Reverse Proxy Guide - https://httpd.apache.org/docs/2.4/howto/reverse_proxy.html
--------------------------------------------------
# Testing Environment:
# Ubuntu 20.04 LTS     Hostname - www.yourdomain.com  - ip Address - 192.168.1.10 
--------------------------------------------------
apt update ; apt install -y build-essential net-tools curl git software-properties-common
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
apt install nodejs -y ; node -v ; npm -v

npm install [email protected] -g --silent
strapi new myproject
cd myproject
npm install forever -g  --silent
forever start --minUptime 1000 --spinSleepTime 1000 -c "npm start" ./

apt update ; apt install apache2 -y
a2enmod proxy proxy_http
sudo gedit /etc/apache2/sites-available/yourdomain.conf &>/dev/null
<VirtualHost *:80>
    #Domain Name
    ServerName yourdomain.com
    ServerAlias www.yourdomain.com

    #HTTP proxy/gateway server
    ProxyRequests off
    ProxyPass / http://127.0.0.1:1337/
    ProxyPassReverse / http:/127.0.0.1:1337/    
</VirtualHost>

a2dissite 000-default.conf ; a2ensite yourdomain
apache2ctl configtest
systemctl daemon-reload ; systemctl reload apache2
echo "192.168.1.10 www.yourdomain.com"  >> /etc/hosts

#  http://www.yourdomain.com
#  http://www.yourdomain.com/admin
0
WooCommerce смена стандартных текстов через functions.php

Комментариев нет

Нет комментариев

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *