Ho kenya kopo ho Laravel 7 ho Ubuntu & Nginx

Ho kenya kopo ho Laravel 7 ho Ubuntu & Nginx

Ke ile ka etsa qeto ea ho etsa mosebetsi oa ka ho sebelisa Laravel 7. E le hore leqephe le ka sehloohong e be leqephe la ho fihla, 'me boitsebiso bohle bo ho lona bo ka fetoloa ho sebelisa sehlopha sa tsamaiso. Eseng ntlha. E fihlile ho romelloa. Ke fumane lithupelo tse 'maloa tse ntle mabapi le ho etsa sena ho seva se felletseng ka mathata ohle. Ha ke matla haholo ts'ebetsong; hangata ke ea pele ho feta stack e felletseng. 'Me, haeba ke ntse ke khona ho ngola le ho leka PHP, joale pele ke laola seva, joalo-joalo. Ha ke so hole. Empa ke ile ka tlameha ho e utloisisa.

Joale re tla feta mehatong eohle, ho qala ka ho qala ka SSH le ho qetella ka sebaka sa ho sebetsa. Re tla leka ho qoba maraba 'ohle.

U ka fumana litaelo tse tšoanang inthaneteng. Etsoe qetellong ke ile ka e fumana. Ke 'nete, eseng sebakeng se le seng, ntle le thuso ea StackOverflow, le ka thata ka Serussia. Ke ile ka utloa bohloko. Ke kahoo ke entseng qeto ea ho nolofatsa bophelo ba hao.

Re tla etsa tsohle ka lerotholi ho DigitalOcean. Sena, ehlile, ha se hlokahale; khetha moamoheli ofe kapa ofe. Ha o fihla ho seva e sebetsang ho Ubuntu, khutla. Bakeng sa ba ntseng ba etsa qeto ea ho e etsa ho DigitalOcean, ho tla ba le malebela a eketsehileng mabapi le ho theha domain. Le $100 sehokelo sa phetiso.

Mehato eohle e ikhethileng ea DigitalOcean e tla fanoa ka mongolo o botlaaseng ba leqephe joalo ka ona.

Ha re qaleng.

TL;DR (litaelo tsa motheo feela)

Etsa mosebelisi

  • ssh root@[IP-адрес вашего дроплета]
  • adduser laravel
  • usermod -aG sudo laravel
  • su laravel

Kenya SSH ho eona

  • mkdir ~/.ssh
  • chmod 700 ~/.ssh
  • vim ~/.ssh/authorized_keys
  • Kenya senotlolo sa sechaba
  • chmod 600 ~/.ssh/authorized_keys

Setsi sa mollo

  • sudo ufw allow OpenSSH
  • sudo ufw enable
  • sudo ufw status

Nginx

  • sudo apt update
  • sudo apt install -y nginx
  • sudo ufw allow 'Nginx HTTP'
  • sudo ufw status

MySQL

  • sudo apt install -y mysql-server
  • sudo mysql_secure_installation, NYNNY
  • sudo mysql
  • ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '<Ваш пароль для MySQL>';
  • SELECT user,authentication_string,plugin,host FROM mysql.user;
  • FLUSH PRIVILEGES;
  • exit

PHP

  • sudo apt update

  • sudo apt install -y curl wget gnupg2 ca-certificates lsb-release apt-transport-https

  • sudo apt-add-repository ppa:ondrej/php

  • sudo apt update

  • 7.3: sudo apt install -y php7.3-fpm php7.3-mysql

  • 7.4: sudo apt install -y php7.4-fpm php7.4-mysql

  • sudo vim /etc/nginx/sites-available/<Ваш домен>

Setupo sa mantlha:

server {
        listen 80;
        root /var/www/html;
        index index.php index.html index.htm index.nginx-debian.html;
        server_name <Ваш домен или IP>;

        location / {
                try_files $uri $uri/ =404;
        }

        location ~ .php$ {
                include snippets/fastcgi-php.conf;
                fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
        }

        location ~ /.ht {
                deny all;
        }
}

Ke tlhophiso ea HTTP feela bakeng sa Laravel:

server {
    listen 80;
    listen [::]:80;

    root /var/www/html/<Имя проекта>/public;
    index index.php index.html index.htm index.nginx-debian.html;

    server_name <Ваш домен или IP>;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location ~ .php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
    }

    location ~ /.ht {
        deny all;
    }
}

Litlhophiso tsa HTTPS bakeng sa Laravel:

server {
    listen 80;
    listen [::]:80;

    server_name <Ваш домен> www.<Ваш домен>;
    return 301 https://$server_name$request_uri;
}

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name <Ваш домен> www.<Ваш домен>;
    root /var/www/html/<Имя проекта>/public;

    ssl_certificate /etc/letsencrypt/live/<Ваш домен>/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/<Ваш домен>/privkey.pem;

    ssl_protocols TLSv1.2;
    ssl_ciphers ECDHE-RSA-AES256-GCM-SHA512:DHE-RSA-AES256-GCM-SHA512:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384;
    ssl_prefer_server_ciphers on;

    add_header X-Frame-Options "SAMEORIGIN";
    add_header X-XSS-Protection "1; mode=block";
    add_header X-Content-Type-Options "nosniff";

    index index.php index.html index.htm index.nginx-debian.html;

    charset utf-8;

    location / {
            try_files $uri $uri/ /index.php?$query_string;
    }

    location ~ .php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
    }

    location ~ /.ht {
            deny all;
    }

    location ~ /.well-known {
            allow all;
    }
}

  • sudo ln -s /etc/nginx/sites-available/<Ваш домен> /etc/nginx/sites-enabled/
  • sudo unlink /etc/nginx/sites-enabled/default
  • sudo nginx -t
  • sudo systemctl reload nginx

Laravella

  • 7.3: sudo apt install -y php7.3-mbstring php7.3-xml composer unzip

  • 7.4: sudo apt install -y php7.4-mbstring php7.4-xml composer unzip

  • mysql -u root -p

  • CREATE DATABASE laravel DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;

  • GRANT ALL ON laravel.* TO 'root'@'localhost' IDENTIFIED BY '<Ваш пароль от MySQL>';

  • FLUSH PRIVILEGES;

  • exit

  • cd /var/www/html

  • sudo mkdir -p <Имя проекта>

  • sudo chown laravel:laravel <Имя проекта>

  • cd ./<Имя проекта>

  • git clone <ссылка на проект> . / git clone -b <имя ветки> --single-branch <ссылка на проект> .

  • composer install

  • vim .env

APP_NAME=Laravel
APP_ENV=production
APP_KEY=
APP_DEBUG=false
APP_URL=http://<Ваш домен>

LOG_CHANNEL=stack

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=<Ваш пароль от MySQL>

  • php artisan migrate

  • php artisan key:generate

  • sudo chown -R $USER:www-data storage

  • sudo chown -R $USER:www-data bootstrap/cache

  • chmod -R 775 storage

  • chmod -R 775 bootstrap/cache

HTTPS

  • sudo add-apt-repository ppa:certbot/certbot

  • sudo apt install -y python-certbot-nginx

  • sudo certbot certonly --webroot --webroot-path=/var/www/html/<Имя проекта>/public -d <Ваш домен> -d www.<Ваш домен>

  • sudo nginx -t

  • sudo ufw allow 'Nginx HTTPS'

  • sudo ufw status

  • sudo systemctl reload nginx

Theha lerotholi ho DigitalOcean 'me u ngolise senotlolo se secha sa SSH

Ke lumela kannete hore u tla tseba ho ingolisa le DigitalOcean ka bouena. Ha ho bonolo, ka linetefatso tse ngata le lintho tse ling. Haeba u lula u fumana phoso ea marang-rang ha u netefatsa ho sebelisa litokomane, leka ho etsa ntho e 'ngoe le e' ngoe ka VPN, e lokela ho thusa.

Ho menu e ka holimo, tobetsa Create->Marothodi. Khetha Botho.

Hang ha u ingolisa, u tla fumana $ 100 akhaonteng ea hau. Empa u se ke ua thetsoa. U na le matsatsi a 60 feela ho e sebelisa. Mme sena se nyane haholo. U ka, joaloka 'na, u batla ho sebelisa moralo o theko e boima, e le hore hamorao, ha chelete ea sebele e qala ho phalla, u ka fetohela ho theko e tlaase. Ke tla u bolella hang-hang hore e ke ke ea sebetsa. U ka e eketsa, empa u ke ke ua e fokotsa. Ho joalo. Ke khetha Standard->$5.

Ke khetha sebaka se haufi le rona Frankfurt. VPC Network->kamehla-fra1

Re tla etsa bonnete hang hang ka SSH. Tobetsa Senotlolo se secha sa SSH. Haeba ha u na SSH, ho na le litaelo tse bonolo ka ho le letona. Bula bash terminal ebe u beha ssh-keygen. Ebe re ea faeleng ka senotlolo sa sechaba /Users/<Ваше имя пользователя>/.ssh/id_rsa.pub (kapa feela cat ~/.ssh/id_rsa.pub), kopitsa litaba ebe u li beha fensetereng e ka letsohong le letšehali. Lebitso lefe kapa lefe.

Re tla le lebitso la moamoheli bakeng sa droplet.

Sututsa Etsa Droplet

Etsa mosebelisi e mocha

  • ssh root@[IP-адрес вашего дроплета]
  • Na ehlile u batla ho tsoela pele ho hokela (ee/che/[monoana])? yes
  • Kenya password ea hau ea SSH
  • Etsa mosebelisi lerata: adduser laravel
  • Kenya phasewete ea hau le lintlha tse ling (ke kenya feela Lebitso le felletseng)
  • Kenya mosebelisi ho sehlopha sa sudo: usermod -aG sudo laravel

SSH bakeng sa mosebelisi e mocha

  • Fetohela ho mosebelisi e mocha: su laravel

Re etsa liketso tsohle ho ea pele, ho fihlela qetellong ea sengoloa, molemong oa mosebelisi oa laravel. Ka hona, haeba u sitisoa ka tšohanyetso, kena hape 'me u kene su laravel

  • mkdir ~/.ssh
  • chmod 700 ~/.ssh
  • vim ~/.ssh/authorized_keys

Re ile ra bula faele ka Vim. Haeba u sa e tsebe ho hang, u ka sebetsa ho Nano, tokelo ea hau.

Litaelo tsa mantlha tsa Vim

Bakeng sa ho sebelisa mohlophisi oa Vim ho pholletsa le sengoloa, o hloka feela ho tseba tse latelang.

  • Vim e na le mekhoa e fapaneng: Mokhoa o tloaelehileng, oo u kenyang litaelo ho oona ebe u khetha mekhoa le tse ling.
  • Ho tswa mokgweng ofe kapa ofe le ho kgutlela mokgweng o tlwaelehileng, tobetsa feela Esc
  • Tsamaea: o ka sebelisa metsu feela
  • Tsoa ntle le ho boloka <Normal mode>: :q!
  • Tsoa 'me u boloke <Normal mode>: :wq
  • Fetolela ho mokhoa oa ho kenya mongolo <Normal mode>: i (ho tsoa ho Senyesemane. kenya)
  • Re kenya senotlolo sa rona sa sechaba (seo re se entseng ka holimo)
  • Re sireletsa khahlanong le liphetoho: chmod 600 ~/.ssh/authorized_keys

Ho kenya firewall

  • Ha re shebeng litlhophiso tsohle tse fumanehang: sudo ufw app list
  • Lumella OpenSSH (ho seng joalo e tla re notlela): sudo ufw allow OpenSSH
  • Ha re qaleng firewall: sudo ufw enable, y
  • Re hlahloba: sudo ufw status

Status: active

To                         Action      From
--                         ------      ----
OpenSSH                    ALLOW       Anywhere
OpenSSH (v6)               ALLOW       Anywhere (v6)

Tsohle di lokile.

Ho kenya Nginx

Nakong ea ho kenya ka linako tse ling u tla botsoa "Na u tiile?" Araba y (hantle, ha feela o na le bonnete).

  • sudo apt update
  • sudo apt install nginx

Ho eketsa Nginx ho litlhophiso tsa firewall

  • sudo ufw app list
  • sudo ufw allow 'Nginx HTTP'
  • sudo ufw status

Status: active

To                         Action      From
--                         ------      ----
OpenSSH                    ALLOW       Anywhere
Nginx HTTP                 ALLOW       Anywhere
OpenSSH (v6)               ALLOW       Anywhere (v6)
Nginx HTTP (v6)            ALLOW       Anywhere (v6)

Kena ho IP ea hau. Haeba tsohle li tsamaea hantle, u lokela ho bona tse latelang.

Ho kenya kopo ho Laravel 7 ho Ubuntu & Nginx

Ho kenya MySQL

  • sudo apt install mysql-server
  • Ho qala mongolo oa ts'ireletso oa othomathike sudo mysql_secure_installation

Araba lipotso tse botsoang. Haeba u sa tsebe hore na u arabe eng, litlhahiso tse ling ke tsena:

  • Netefatsa plugin ea password - N

  • Tlosa basebelisi ba sa tsejoeng? - Y

  • Ha u lumelle ho kena ha motso u le hole? - N

  • Tlosa database ea liteko le ho fihlella ho eona? - N

  • Khoasolla litafole tsa litokelo hape hona joale? - Y

  • Ha re ee ho MySQL: sudo mysql

  • Ha re shebeng mekhoa ea ho fihlella: SELECT user,authentication_string,plugin,host FROM mysql.user;

  • Beha password bakeng sa motso: ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '<Ваш пароль для MySQL>';

  • Ha re shebeng mekhoa ea ho fihlella hape: SELECT user,authentication_string,plugin,host FROM mysql.user;

  • Sebelisa liphetoho 'me u tsoe ho MySQL: FLUSH PRIVILEGES; и exit

  • Joale, ho kena ho MySQL o hloka ho e sebelisa mysql -u root -p ebe o kenya phasewete

Ho kenya PHP

Ha re sebeliseng polokelo ea motho oa boraro ho tloha Ondrej Surý

  • sudo apt update
  • sudo apt install -y curl wget gnupg2 ca-certificates lsb-release apt-transport-https
  • sudo apt-add-repository ppa:ondrej/php
  • sudo apt update

Joale ha re khetheng. Bakeng sa Laravel 7, o ka khetha PHP 7.3 kapa 7.4. Phapang feela e tla ba lipalong tsa 3 le 4.

  • 7.3: sudo apt install -y php7.3-fpm php7.3-mysql
  • 7.4: sudo apt install -y php7.4-fpm php7.4-mysql

PHP FastCGI Process Manager (fpm) e sebetsa ka likopo tsa PHP. mysql, ehlile, bakeng sa ho sebetsa le MySQL.

Ho tloha joale ho ea pele ke tla etsa tsohle ka 7.4.

Ho theha Nginx

  • sudo vim /etc/nginx/sites-available/<Ваш домен>

Sebakeng sa "<Your domain>" kenya sebaka sa marang-rang (mohlala, mysite.ru) tseo u batlang ho li sebelisa nakong e tlang. Haeba ha u e-so be le eona, ngola leha e le efe, ebe u pheta mehato e khaolong ena bakeng sa sebaka sa hau sa marang-rang ha u se khetha.

Kenya tse latelang:

server {
        listen 80;
        root /var/www/html;
        index index.php index.html index.htm index.nginx-debian.html;
        server_name <Ваш домен или IP>;

        location / {
                try_files $uri $uri/ =404;
        }

        location ~ .php$ {
                include snippets/fastcgi-php.conf;
                fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
        }

        location ~ /.ht {
                deny all;
        }
}

Haeba u khethile mofuta oa 7.3 php7.4-fpm.sock ngola ka php7.4-fpm.sock.

Mamela port 80 ho ea pele server_nameha re fihla kopo ea motso /var/www/html nka faele ea index. Haeba ka mor'a server_name Ho na le ho hong, re batla faele e joalo. Haeba re sa e fumane, re lahla 404. Haeba e qetella ka .php, matha ka fpm... Haeba le teng .ht, thibela (403).

  • Ho etsa sehokelo ho tloha sites-available в sites-enabled: sudo ln -s /etc/nginx/sites-available/<Ваш домен> /etc/nginx/sites-enabled/
  • Ho tlosa sehokelo ho default: sudo unlink /etc/nginx/sites-enabled/default
  • Ho hlahloba liphoso: sudo nginx -t
  • Qala hape: sudo systemctl reload nginx

Ho hlahloba mosebetsi:

  • sudo vim /var/www/html/info.php
  • Re ngola: <?php phpinfo();
  • Ha re eeng ho <Ваш IP>/info.php

U lokela ho bona ntho e kang ena:

Ho kenya kopo ho Laravel 7 ho Ubuntu & Nginx

Joale faele ena e ka hlakoloa: sudo rm /var/www/html/info.php

Kenya Laravel

  • 7.3: sudo apt install php7.3-mbstring php7.3-xml composer unzip

  • 7.4: sudo apt install php7.4-mbstring php7.4-xml composer unzip

  • Ha re ee ho MySQL: mysql -u root -p

  • Etsa polokelo ea boitsebiso ka lebitso lerata: CREATE DATABASE laravel DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;

  • Re fana ka phihlello ea metso ho lerata: GRANT ALL ON laravel.* TO 'root'@'localhost' IDENTIFIED BY '<Ваш пароль от MySQL>';

  • FLUSH PRIVILEGES;

  • exit

  • cd /var/www/html

  • Theha sephutheli bakeng sa morero: sudo mkdir -p <Имя проекта>

  • Re fana ka mosebedisi lerata litokelo tsa morero: sudo chown laravel:laravel <Имя проекта>

Ka mor'a moo o hloka ho fetisetsa morero. Ka mohlala, ho kopanya ho tloha Github.

  • cd ./<Имя проекта>
  • git clone <ссылка на проект> .

Ke habohlokoa ho nahana hore haeba u sa boloke lifaele tse tsitsitseng (mohlala, ho tloha ho /public) ho Github, joale ka tlhaho u ke ke ua ba le tsona. Ka mohlala, ke thehile khoele e arohaneng ho rarolla sena deploy, eo ke seng ke iqapetse eona: git clone -b <имя ветки> --single-branch <ссылка на проект> ..

  • Litšepeho tsa ho kenya: composer install
  • Theha .env: vim .env

Mofuta oa motheo oa eona o shebahala tjena:

APP_NAME=Laravel
APP_ENV=production
APP_KEY=
APP_DEBUG=false
APP_URL=http://<Ваш домен>

LOG_CHANNEL=stack

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=<Ваш пароль от MySQL>

Haeba u kopitsa .env ea hau, tlosa APP_ENV ka tlhahiso, APP_DEBUG ka bohata 'me u kenye litlhophiso tse nepahetseng bakeng sa MySQL.

  • Ho falla database: php artisan migrate
  • Ho hlahisa khoutu: php artisan key:generate

Ho fetola litumello:

  • sudo chown -R $USER:www-data storage
  • sudo chown -R $USER:www-data bootstrap/cache
  • chmod -R 775 storage
  • chmod -R 775 bootstrap/cache

Ntho ea ho qetela e setseng ke ho lokisa Nginx bakeng sa Laravel:

sudo vim /etc/nginx/sites-available/<Ваш домен>

server {
    listen 80;
    listen [::]:80;

    root /var/www/html/<Имя проекта>/public;
    index index.php index.html index.htm index.nginx-debian.html;

    server_name <Ваш домен или IP>;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location ~ .php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
    }

    location ~ /.ht {
        deny all;
    }
}

Joalo ka lekhetlo la ho qetela, haeba u khethile mofuta oa 7.3 php7.4-fpm.sock ngola ka php7.4-fpm.sock.

Ho theha sebaka sa marang-rang ho DigitalOcean

Ntho e 'ngoe le e' ngoe e hlile e bonolo haholo. U reka sebaka (kae kapa kae), fetohela ho DigitalOcean ho Create->Libaka/DNS... Tšimong Kenya sebaka o kenya domain name ena ebe o tobetsa Add. Ebe u ea ho li-setting tsa domain le ho ea tšimong LEBITSO LA MOHAPI kena @. Khetha morero ebe o tobetsa Etsa rekoto.
Joale e-ea sebakeng seo u rekileng sebaka sa marang-rang, fumana "DNS Servers" moo (kapa ntho e tšoanang) 'me u kenye li-server tsa DigitalOcean (e leng. ns1.digitalocean.com, ns2.digitalocean.com, ns3.digitalocean.com). Joale o hloka ho ema hanyane (kapa haholo) ho fihlela litlhophiso tsena li amoheloa. E lokile!
Bothata feela ke hore sebaka sa hau sa marang-rang se tla bula feela joalo ka HTTP. Ho ba le HTTPS, fetela karolong e latelang.

Ho theha HTTPS

Kenya certbot 'me u e fetise lebitso la domain (format mysite.ru) le lebitso la domain le www (www.mysite.ru).

  • sudo add-apt-repository ppa:certbot/certbot
  • sudo apt install python-certbot-nginx
  • sudo certbot certonly --webroot --webroot-path=/var/www/html/<Имя проекта>/public -d <Ваш домен> -d www.<Ваш домен>

Hona joale o hloka ho hlophisa Nginx hape (u se ke oa lebala ho fetola litekanyetso tsa hau):

server {
    listen 80;
    listen [::]:80;

    server_name <Ваш домен> www.<Ваш домен>;
    return 301 https://$server_name$request_uri;
}

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name <Ваш домен> www.<Ваш домен>;
    root /var/www/html/<Имя проекта>/public;

    ssl_certificate /etc/letsencrypt/live/<Ваш домен>/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/<Ваш домен>/privkey.pem;

    ssl_protocols TLSv1.2;
    ssl_ciphers ECDHE-RSA-AES256-GCM-SHA512:DHE-RSA-AES256-GCM-SHA512:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384;
    ssl_prefer_server_ciphers on;

    add_header X-Frame-Options "SAMEORIGIN";
    add_header X-XSS-Protection "1; mode=block";
    add_header X-Content-Type-Options "nosniff";

    index index.php index.html index.htm index.nginx-debian.html;

    charset utf-8;

    location / {
            try_files $uri $uri/ /index.php?$query_string;
    }

    location ~ .php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
    }

    location ~ /.ht {
            deny all;
    }

    location ~ /.well-known {
            allow all;
    }
}

Ke nahana hore u se u ntse u utloisisa se lokelang ho fetoloa bakeng sa PHP 7.3.

Mona, ha e le hantle, ntho e 'ngoe le e' ngoe e bonolo. Re tsamaisa likopo tsohle ho tloha HTTP (port 80) ho ea HTTPS (port 443). 'Me moo re etsa ntho e' ngoe le e 'ngoe ka mokhoa o ts'oanang le pele, empa ka encryption.

Ho setseng ke ho beha litumello ho firewall:

  • sudo nginx -t
  • sudo ufw app list
  • sudo ufw allow 'Nginx HTTPS'
  • sudo ufw status
  • sudo systemctl reload nginx

Joale ntho e 'ngoe le e' ngoe e lokela ho sebetsa kamoo e lokelang.

[E tsoetseng pele] Ho kenya Node.js

Haeba ka tšohanyetso o hloka ho tsamaisa litaelo tsa npm ka kotloloho ho seva, o hloka ho kenya Node.js.

  • sudo apt update
  • sudo apt install -y nodejs npm
  • nodejs -v

Ke phetho, ke ile ka emisa mothating ona. Ha e le hantle, ke khotsofetse ke sephetho. Mohlomong ke tla tloha DigitalOcean kae-kae haufi le Russia le ka theko e tlaase. Empa kaha ke ne ke se ke fetile likarolong tsohle tsa ho netefatsa setšeng mme ke entse ntho e 'ngoe le e' ngoe moo, ke ile ka ba bontša ka mohlala. Ntle le moo, ho qala ha bona $100 ke mokhoa o motle oa ho koetlisa.

PS Liteboho tse khethehileng ho mongoli ntlha ena, e ileng ea sebeletsa e le motheo oa liketso tsohle tse ka holimo. Maemong a mang ha e sebetse bakeng sa Laravel 7, ke e lokisitse.

PPS Haeba ho ka etsahala hore u moenjiniere ea hloahloa ea nahanang ka litaelo tsa bash, ka kopo u se ke oa ahlola hampe. U ka ’na ua fumana sehlooho sena e le sa boemo bo tlaase, empa nka be ke thabetse ho se fumana ha ke ne ke se hloka. Haeba ho na le litlhahiso tsa ho ntlafatsa, ke tsohle bakeng sa eona.

Source: www.habr.com

Eketsa ka tlhaloso