Ungayakha kanjani iseva elula yewebhu enemigqa emi-5 ye-bash

Kulezi zinsuku ibhulogi ibilokhu inempilo ngesihloko samaseva, umngane wethu uFico ubelokhu esinikeza inkulumo kumanethiwekhi ekhompyutha ochungechungeni lwakhe. Amanethiwekhi wekhompyutha ama-SME, kanye nama-athikili ambalwa wokufaka nokulungisa amaseva wewebhu ku- Ungayifaka kanjani futhi uyilungiselele kanjani i-XAMPP ku-GNU / Linux y Ungayifaka kanjani i-NGINX nge-Google Page Speed ​​ku-Ubuntu ngokuzenzakalela.

Indlela umhlaba wesoftware yamahhala enakekela ngayo, kwesinye isikhathi ilula futhi ngezinye izikhathi iba yinkimbinkimbi ngokwengeziwe, namuhla sikulethela umzamo omncane wemigqa emi-5, esivumela ukuthi sakhe i-web server elula.

I-Shinatra

I-Shinatra igama lomzamo owenziwe ngu UBen raady nokuthi isatshalaliswe ngokukhululeka, iyasebenza njengoba inembile, simane sidale noma silande i-bash ngemigqa edingekayo yekhodi bese sisebenzisa i-bash netheku + nomyalezo esifuna ukuwusingatha.

Lo mbhalo osivumela ukuthi sakhe i-web server elula, usebenza kuma-distros ahlukahlukene we-GNU / Linux naku-OS X, awudingi ukufakwa, uyaguquguquka ezindleleni ofuna ukuzisebenzisa, uvumela zonke izinhlobo zokuqukethwe, futhi ungafinyelela ube ithuluzi eliwusizo kakhulu, uma kwenzeka ufuna ukubeka imininingwane ngokushesha kunoma iyiphi iseva.

Ungayisebenzisa kanjani iShinatra

I-Shinatra Yenziwe imigqa yekhodi elandelayo:

#! / bin / bash IMPENDULO = "HTTP / 1.1 200 KULUNGILE \ r \ nUxhumano: gcina uphila \ r \ n \ r \ n $ {2: -" KULUNGILE "} \ r \ n" ngenkathi {echo -en " $ IMPENDULO "; } | nc -l "$ {1: -8080}"; yenza echo "============================================== = = "kwenziwe

Ungavele udale ifayela le- .sh, nganoma yiliphi igama olifunayo bese ulisebenzisa ngokulandelayo:

./shinatra.sh [port] [response]

Ungathola futhi iskripthi esibuyekeziwe kusuka kumakhosombe asemthethweni, ukwenza lokhu, landela lezi zinyathelo:

git clone https://github.com/benrady/shinatra.git cd shinatra / ./shinatra.sh 80 'Server Reply Message'

Kumbhalo ungathumela noma yini oyifunayo, ngokwesibonelo:

Dala iseva elula yewebhu

Ngokungangabazeki indlela esheshayo, elula futhi elula yokusebenzisa iseva yewebhu ukusebenza, ukusetshenziswa kwayo nobubanzi bayo buhlukahlukene. Ungawusebenzisa kanjani lo mbhalo? Ngabe uyithola ilusizo?


Okuqukethwe yi-athikili kunamathela ezimisweni zethu ze izimiso zokuhlelela. Ukubika iphutha chofoza lapha.

Amazwana ayi-7, shiya okwakho

Shiya umbono wakho

Ikheli lakho le ngeke ishicilelwe. Ezidingekayo ibhalwe nge *

*

*

  1. Ubhekele imininingwane: Miguel Ángel Gatón
  2. Inhloso yedatha: Lawula Ugaxekile, ukuphathwa kwamazwana.
  3. Ukusemthethweni: Imvume yakho
  4. Ukuxhumana kwemininingwane: Imininingwane ngeke idluliselwe kubantu besithathu ngaphandle kwesibopho esisemthethweni.
  5. Isitoreji sedatha: Idatabase ebanjwe yi-Occentus Networks (EU)
  6. Amalungelo: Nganoma yisiphi isikhathi ungakhawulela, uthole futhi ususe imininingwane yakho.

  1.   UGaspar Fernandez kusho

    Esikhathini esithile esedlule ngenza iskripthi esifanayo lapho ungachaza izimpendulo eziningana ngokuya ngomzila nakho konke. Kwakungeyona imigqa emi-5 kepha singenza izinto eziningana: http://totaki.com/poesiabinaria/2015/03/mini-servidor-web-con-bash-y-netcat-para-paginas-en-mantenimiento/

    Into embi ngokuyenza isitayela se-netcat ukuthi asiyisebenzisi i-concurrency, futhi izinsizakusebenza zimoshwa kakhulu, kepha yisilingo esihle 🙂

  2.   Gonzalo Martinez kusho

    Enye indlela nge-python (eza cishe kuwo wonke ama-distros)

    I-sudo python -m elulaHTTPServer 80

    Isebenza ngokuhlukile, ngale ndlela isebenza amafayela asenkombeni lapho kusebenza khona iseva, kepha kungenye indlela elula

  3.   UJose Perez kusho

    enye ene php ngu
    i-php -S 127.0.0.1: 9000

  4.   Isibongo Cifuentes placeholder image kusho

    Lokhu okuthunyelwe ngikufunde ngonyaka owedlule, uma kwenzeka ufuna uhlu oluphelele lwamaseva wewebhu ngomugqa womyalo.

    https://www.busindre.com/servidor_web_por_linea_de_comandos.

  5.   U-Eduardo Cuomo kusho

    Ungadlulisa ifayela kuseva elingenalutho olufakiwe, futhi awunayo imvume ye-ROOT:

    #! / bin / bash
    ifayela = »$ 1 ″
    itheku = 8080

    n = »\ r \ n»
    umzimba = »$ (base64« $ {file} »)»

    IMPENDULO = »HTTP / 1.1 200 KULUNGILE»
    I-RESPONSE = »$ {RESPONSE} $ {n} Uxhumano: gcina uphila»
    I-RESPONSE = »$ {RESPONSE} $ {n} Content-Type: application / octet-stream»
    ISIMPENDULO = »$ {RESPONSE} $ {n} Ukuqukethwe-Ukubekwa: emgqeni; igama lefayela = \ "$ {file}"
    ISIMPENDULO = »$ {RESPONSE} $ {n} $ {n} $ {body}»

    ngenkathi {echo -en "$ RESPONSE"; } | nc -l "$ {port}"; yenza
    i-echo «==========================================»
    Kwenziwe

    Ngemuva kwalokho, uma uyithola, uyiguqula futhi nge- "base64 -d filename"

  6.   U-Eduardo Cuomo kusho

    Kunezinye izibonelo eziningi ku:
    $ umuntu nc

  7.   UJose Maria Garcia kusho

    Ku-Linux naku-macOS, kungasetshenziswa igobolondo elikhethiwe nomphathi wephakheji. Ku-Windows 10, ungafaka iWindows Subsystem yeLinux ukuthola inguqulo ye-Ubuntu neBash ehlanganiswe neWindows, okokufundisa okuhle kakhulu.

    https://clongeek.com/como-instalar-macos-desde-usb/