Ungayisetha kanjani iseva yewebhu bese ubamba iwebhu ku-GNU / Linux

I-URL Yewebhu

Uma wake wazibuza ukuthi kanjani amanye izinsizakalo zokubamba akhona kunethiwekhi angabamba ikhasi lewebhu noma yini iseva yewebhu nokuthi isebenza kanjani, kufaka phakathi imigoqo evela ku-URL yamanye amakhasi ewebhu, ukuthi iklayenti lingaxhuma kanjani ekhasini lewebhu ukude, njll kule Ndatshana izokucacisela. Ngizokufundisa hhayi imiqondo nje yokuthi iyini iseva, uzokwazi nokuthi ungayakha kanjani i-web server yakho igxathu negxathu ngenxa yesifundo sethu esilula.

Namuhla sonke sisebenzisa izinsizakalo ezikude zazo zonke izinhlobo, futhi ne-computing yefu ekhulayo, kepha uma kukhona insizakalo evelele ngaphezu kwezinye, mhlawumbe iyona abayinikezayo amaseva wewebhu, njengoba kukhona amathani amawebhusayithi esiwavakashela nsuku zonke ukufunda izindaba zethu eziyintandokazi, hlola ama-imeyili avela ku-web interface enikezela ngezinsizakalo ezithile njenge-GMail, ukwenza ukuthengiselana, ukusebenza, ukuthenga online, njll. Akekho obalekela lezi zinsizakalo, akunjalo? Kodwa-ke, kubasebenzisi bayo abaningi bahlala bengaziwa ukuthi kubangelwa yini ...

Yini iseva?

Ipulazi leseva

Abanye abasebenzisi bacabanga lokho iseva yinto ekhethekile, okuthile okuhluke kakhulu kunalokho okuyikho ngempela. Kepha kushiwo ngolimi olulula, iseva ayilutho ngaphandle kwekhompyutha efana naleyo esingaba nayo endlini yethu, kuphela esikhundleni sokwenza njengeklayenti, ikwenza njengeseva, okungukuthi, ihlinzeka insizakalo. Ungase ucabange ukuthi, kuleso simo, kungani lezo zithombe esizibona ku-TV noma kweminye imidiya lapho amaseva ephuma zingavamile kakhulu ...

Yebo, lezo zithombe ezinjengalezi engizifake lapha ziyizithombe ze- amapulazi eseva. Leli yigama elinikezwe uchungechunge lwamaqoqo wamakhompyutha asebenza ndawonye njengeseva eyodwa. Khumbula ukuthi izinsizakalo ezihlinzekwa yilawa maseva zihloselwe amakhulu, izinkulungwane noma izigidi zabasebenzisi abasebenza njengamakhasimende kumakhompyutha abo, ama-smartphone, amathebulethi, ama-TV ahlakaniphile, njll. Ngakho-ke, amandla okumele bawasebenzise aphakeme kakhulu kunalawo ekhompyutha yasekhaya.

Kumele ucabange ngezinsizakalo ezifana ne-Twitter, ukuthi zingaki izigidi zabasebenzisi le nethiwekhi yokuxhumana enayo, mangaki amafayela nemiyalezo edluliswa njalo ngomzuzwana. Uma ucabanga ngakho, kuyi- inani elikhulu lemininingwaneNgakho-ke, akuvumelekile ngoxhumano olufana nalolo esinalo ekhaya nekhompyutha ejwayelekile. Ukuxhumeka okushesha kakhulu kuyadingeka ukuze kungabikho ukubambezeleka ekufinyeleleni kwabo bonke labo basebenzisi, futhi kuyinike amandla adingekayo ukuze bakwazi ukusingatha lonke lolo lwazi.

Ngalokhu engikushoyo ukuthi yilokho kwe- le nsizakalo kusetshenziswa amashumi noma "amakhompyutha" amaningi njengalezo esingazisebenzisa ekhaya ezifakwe emakhabethe anama-racks. Kepha empeleni, ngamunye wabo akakude nekhompyutha yedeskithophu njengaleyo esinayo ekhaya lethu. Mhlawumbe abanye banama-microprocessor akhethekile afana ne-AMD EPYC, i-Intel Xeon, njll., Mhlambe banamashayela amaningi aqinile alungiselelwe njenge-RAID ukugwema ukuthi uma kukhona okwehluleka, imininingwane ilahlekile, kepha njengoba ngisho, gcina ukuthi bangamakhompyutha afana ukuphatha manje, futhi ngizokutshela lokhu ngoba manje ngizokuchazela ukuthi ungayiguqula kanjani iPC yakho ibe yiseva enesizotha ...

Impela lezi amaseva ayizinhlobo eziningi, kukhona lezo ezihlinzeka ngezinsizakalo zefu, njengokugcina, kukhona lezo ezihlinzeka ngezinsizakalo ze-imeyili, amaseva wewebhu, futhi ezinye ezivele zenze izinsizakalo ezifana ne-DNS, NTP, DHCP, LDAP, njll., okusho ukuthi, konke lokhu kuyadingeka futhi ngokuqinisekile uzisebenzisa nsuku zonke ngaphandle kokuqaphela, ngoba ziyizinsizakalo ezinye i-ISP (Internet Service Provider) noma umhlinzeki wesevisi ye-Intanethi asinikeza zona.

Lithini ikhasi lewebhu?

Iwebhusayithi kumadivayisi ahlukene

Sishilo ngaphambili ukuthi amanye amaseva wewebhu, ahlinzeka ngokusingathwa noma ukusingathwa amakhasi ewebhu. Ikhasi lewebhu liqoqo lolwazi lwe-elekthronikhi noma ledijithali (i-HTML, i-PHP, i-CSS, ...) engaqukatha umbhalo kuphela, noma nokunye okuqukethwe njengezinhlelo zokusebenza zewebhu ezibhalwe ngezilimi ezithile zokuhlela noma imibhalo (i-Perl, iJavaScript) , Ruby ne-RoR noma Ruby on Rails framework, PHP, njll.), Okuqukethwe kwe-multimedia (izithombe, amavidiyo, imisindo, njll.), Kanye nezixhumanisi ezivame ukukuholela kwenye indawo kuleli khasi lewebhu elifanayo noma elihlukile .

Futhi ukuze lokhu kwenzeke sinamaseva wewebhu awabambayo, okungukuthi, igcina yonke le datha kwi-hard drive yayo, kanye nochungechunge lwezivumelwano zenethiwekhi ezifana HTTP (I-HyperText Transfer Protocol) ne-HTTPS (i-HTTP enokuphepha kwesitifiketi se-SSL / TLS). Isoftware izokunakekela lokhu njengoba sizokufundisa ngokuhamba kwesikhathi, okusho ukuthi, ukusebenzisa ukuxhumana okuqondiswa kabili kweklayenti nokuthi likwazi ukuzulazula ngokuqukethwe yi-hypertext, okungukuthi, izindlela zokwabelana, ukuxhumanisa kanye nokuxhumana nolwazi olushintshelwe iWWW (Iwebhu Ebanzi Yomhlaba Wonke).

Isebenza kanjani?

Ukuxhumeka kweklayenti-Server

Hhayi-ke, sesivele siyazi ukuthi yini iwebhu neseva yewebhu, echazwe ngendlela yami nangolimi olulula ukuze cishe wonke umuntu akwazi ukuyiqonda, ngisho nalabo abangenalo lolu lwazi lobuchwepheshe. Futhi manje ngiyaqhubeka nalesi sigaba lapho ngizozama khona ukucacisa ifayili le- ukusebenza kwalolu hlelo lwe-client-server. Kepha ngalokhu, okokuqala ngizohlukanisa phakathi kwalokhu okubili:

  • Iklayenti: iklayenti ngumsebenzisi ofinyelela iwebhusayithi kusuka kudivayisi yabo, kungaba ilaptop, ideskithophu, ithebhulethi, i-smartphone, njll. Ukufinyelela, udinga kuphela ukuxhumana kwe-inthanethi kanye nesiphequluli sewebhu, isoftware ebaluleke kakhulu ohlangothini lweklayenti olubhekele ukubonisa konke lokho okuqukethwe kwewebhu ngendlela evumelana nokuvumela umsebenzisi ukuthi ahlanganyele nakho. Futhi kulokhu sizodinga kuphela ikheli lekhasi lewebhu noma i-IP ..., noma ngabe ucabanga ukuthi lokhu akudingeki ngaso sonke isikhathi ukufinyelela, ngoba kunezinjini zokusesha (isb: iGoogle) ezivumela ngamagama angukhiye kithi ukukhombisa lawa mawebhusayithi anezikhombo, futhi uqinisile.
  • IsevaNjengoba sichazile, kuzoqukatha yonke idatha kanye nesoftware esebenza njengeseva, okusho ukuthi, ivumela iklayenti ukuthi lixhumane nokwenza noma yini okudingeka liyenze. Endabeni yesiphakeli sewebhu kuzoba, ngokwesibonelo, i-Apache, i-Lighttpd, njll.

Ngithanda ukukhomba okunye, futhi ukuthi njengoba wazi, ikheli le-IP Yiyo ekhomba umshini oxhunywe kunethiwekhi, kulokhu kuzoba yi-IP yeseva yewebhu. Kukhona ezinye izinsizakalo ezinjengalezi ezikukhombisa i-IP yekhasi lakho olithandayo, isibonelo, uma usesha igoogle.es izokukhombisa i-IP ehambelana neseva lapho le nsizakalo isingathwa khona. Uma uzama ukufaka le nombolo kubha yekheli lesiphequluli sakho sewebhu, uzobona ukuthi ngokufaka ku-www.google.es bese uthi i-IP, kuzo zombili lezi zimo izokhombisa i-Google.

Kungani ngisho lokhu? Hhayi ngoba kuyangisiza ukuxhumana Amaseva we-DNS. Lawa maseva ngamanye amasevisi aqukethe amatafula anamagama amawebhusayithi kanye ne-IP yawo ehambisanayo, ukuze kuthi lapho umuntu efuna ikheli ngegama futhi angasebenzisi i-IP, iseva yenza isiphequluli sibonise okuqukethwe yile webhusayithi. Lokhu kwenziwa ukuze kube enembile kakhulu kubantu. Asizikhumbuli kalula zonke lezo zinombolo, kepha singakhumbula amagama ewebhusayithi yethu esiyithandayo, akunjalo?

Futhi ngigcina ngokucacisa ukuthi yini i- I-URL (Isitholi Sezisetshenziswa Efanayo) noma i-locator resource locator, esiyibona phezulu kwebha yesiphequluli sethu lapho sifinyelela iwebhusayithi. Isibonelo, ake ucabange ukuthi ubhalisa isizinda myweb.es. Kulokhu, leso sizinda kuzoba ngesakho futhi ungasisebenzisa ukubonisa ikhasi lakho le-web. Ake ucabange ukuthi othile ungena kuleli kheli http://www.miweb.es/info/inicio.html#web:

  • http://: Kubonisa ukuthi singena ekusebenziseni umthetho olandelwayo we-HTTP, noma kungaba yi-HTTPS, FTP, njll. Kepha kulokhu kungokokuqala, ngakho-ke kungukuqukethwe kwewebhu.
  • WWW: uyazi ukuthi ivela kuwebhu ebanzi yomhlaba.
  • ubathweb.es: lesi yisizinda osibhalisile, okungukuthi, igama elifaka indawo ye-IP yeseva noma umphathi ophethe iwebhusayithi yakho. Ngakho-ke, kuzoba igama elikhomba iseva noma umshini, ngemuva kwakho konke ... Ngaphezu kwalokho, iqukethe i-TLD (Top Level Domain) okulesi simo eyi- .es, ukukhomba ukuthi iyiwebhusayithi evela eSpain, yize kungaba .se kusuka eSweden, .com kusuka enkampanini, .org Inhlangano, njll.
  • /info/inicio.html#web: lokhu kumane kuchaze ukuthi lokhu okuqukethwe kufinyelelwe, okungukuthi, umkhombandlela wolwazi futhi ngaphakathi kwawo yifayela lasekhaya.html eline-hypertext futhi ikakhulukazi isigaba web. Kungenzeka futhi ukuthi kube isithombe, i-PDF, ividiyo, njll. Njengoba kwenzeka kumphathi wakho wefayela lapho uya endleleni kwi-hard drive yangakini, akunjalo?

Ngicabanga ukuthi ngalokhu kwanele ukusebenza okucacile ichazwe ngendlela elula.

Okokufundisa: yakha i-web server yakho igxathu negxathu

Iwebhu yokuhlola i-Apache

Uma unayo Ukusatshalaliswa kwe-GNU / Linux noma yikuphiKufanele wazi ukuthi uma usuyilungiselele kahle inethiwekhi yakho, ngoba awukwazi ukuba ne-IP enamandla, kufanele ibe yi-static noma kungenjalo izoshintsha inani layo futhi kungaba nzima ukufinyelela kuwebhu. Ngaphezu kwalokho, kufanele unake futhi uma une-firewall elungiselelwe ngama-iptables noma enye isoftware okungekho mthetho ovimbela ukudluliswa nge-port 80 noma i-8080, njll., Njengokungathi une-AppArmor noma i-SELinux, kufanele ivumele umsebenzisi ukuthi enze okuthile. i-web server daemon, kulokhu i-Apache.

Isinyathelo esilandelayo ukufaka isoftware ukusebenzisa i-web server yethu, kulokhu I-Apache namanye amaphakheji wokuqedela i-LAMP, kodwa kungenzeka kube enye. Mina, kusuka kuDebian:

sudo apt-get update

sudo apt-get install apache2
sudo service apache2 restart
sudo apt-get install mysql-server php5-mysql
mysql -u root
mysql -u root -p (sin no introdujiste el password durante la instalación)
sudo apt-get install php libapache2-mod-php5 php5-mycrypt
sudo apt-get install php5-sqlite

Ngemuva kwalokho unga lungiselela amanye amapharamitha kusuka kuseva uma uyidinga, noma mhlawumbe uma ingasebenzi bese uthola ikhasi engikukhombisa lona esithombeni esedlule, bheka izingodo ngoba kukhona okungahambanga kahle ... By the way, ungabona lelo khasi ngokufinyelela isiphequluli sakho sewebhu bese usetha i-localhost 127.0.0.1 .2 kubha yekheli noma i-IP emile oyilungiselele iseva yakho. Amachweba azenzakalelayo azoba ku- /etc/apacheXNUMX/ports.conf uma kwenzeka ufuna ukuwashintsha.

Uma ufuna futhi ungafaka enye i- amaphakheji angeziwe, uma futhi uhlela ukuba neseva yeposi, noma amanye amaphaneli wokumisa afana ne-phpAdmin, njll.

Bamba iwebhusayithi yakho kuseva

Ukwakhiwa kwewebhusayithi

Lapho nje iseva yethu isilungile, khumbula ukuthi i-PC oyinikele kuseva kufanele ihlale ivuliwe futhi ixhumeke kunethiwekhi ukuze iwebhu ifinyeleleke kusuka kunoma iyiphi enye idivayisi, ngaphandle kwalokho iseva izoba "phansi". Manje sinakho kuphela bamba iwebhusayithi yethu, ukuthi singazenzela thina sisebenzisa i-HTML noma enye ikhodi, noma sisebenzise i-CMS efana neWordPress eyenza izinto zibe lula kakhulu kithina nokuthi singasingatha endaweni efanayo ...

Futhi ngalokhu sizokwenza ku umkhombandlela / var / www / html / ukuthi ngaphandle kokuthi siguqule ukumiswa kwe-Apache, kuzoba lapho lapho kubanjwa khona amawebhu. Isibonelo, ungenza isivivinyo esincane usebenzisa i-PHP ngokwakha ifayili ngesihleli sakho sombhalo osithandayo ngokuqukethwe:

<?php phpinfo() ?>

Yibize ukuhlolwa.php futhi manje, ngemuva kokuqalisa kabusha i-daemon ye-apache2, uzokwazi ukubona ukuthi ingafinyeleleka yini kusuka kusiphequluli: 127.0.0.1/test.php.

Ngiyethemba lesi sifundo sikusizile nokuthi okungenani uqonde kangcono ukuthi amaseva asebenza kanjani, ukuze manje ngaso sonke isikhathi lapho ufinyelela ibhulogi yethu ufunde into yezindaba, wazi konke ngemuva kwayo. Ungakhohlwa ukushiya ifayela lakho le- imibono, ukungabaza, noma iziphakamiso, ...


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

Amazwana ayi-8, 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.   Pedro kusho

    Sawubona. Awucabangi ukuthi ukusebenzisa i-PHP 5 ngo-2018 akunangqondo kakhulu?

  2.   UNowa Taipe kusho

    Sawubona!
    Ngingumqali uma kukhulunywa ngamaseva.
    Yini i-router okufanele ibe nayo?
    Yini ip okumele i-PC esebenza njengeseva ibe nayo
    I-Apache yini i-ip kufanele ibe nayo?
    Ingabe i-ip yomphakathi ihleliwe?

  3.   jucapopo kusho

    Ngivumelana kakhulu noNoe Taipe
    Ngichithe amasonto ambalwa ngifuna ulwazi lokusetha iseva yewebhu yeLinux nakuzo zonke izinkundla ababeka kuzo «amaqhinga» asebenza kuphela kunethiwekhi yangaphakathi noma yendawo futhi ngicabanga ukuthi inhloso yakho ukukwazi ukusetha iseva yewebhu nokuthi othile angakubona nganoma yisiphi isikhathi kwenye ikhompyutha ngaphandle kwenethiwekhi yakho kwelinye idolobha, izwe, ...
    Ngikwazile ukwenza isiphakeli sewebhu sikubone kunethiwekhi yangaphandle, ukuthi uma kuphela ngokubeka i-IP yami yomphakathi nokuvula ichweba kumzila wami wemodemu, ngafaka iBind9, ukuze ngikwazi ukukhomba isizinda esakhiwe kunethiwekhi yami yangaphakathi nokuthi isebenza kahle kunethiwekhi yami, kepha angikwazi ukuthola imininingwane yokuthi ngenza kanjani okufanayo nge-Intanethi nokuthi abantu abayifaki i-IP yami kepha isizinda esasungulwa njengoba benza, i-google, izwe, umhlaba, inkantolo yamaNgisi,… .
    Ngiyabingelela futhi ngithemba ukuthi uzothola ulwazi ngayo.

  4.   I-Logiteckno1 kusho

    Ngizama nokufunda ukufaka i-server, kepha engikuthandayo ukuthi ungafaka kanjani iseva yokukhiqiza futhi angikalutholi ulwazi oluhle.
    Uma ungakaxazululi inkinga onayo okwamanje, ngikweluleka ukuthi wenze i-akhawunti ku-noip.com. Wakha isizinda samahhala, ubeka ip yomphakathi bese ulungiselela i-DDNS kwimodemu yakho. Ngikushiya isixhumanisi: https://www.youtube.com/watch?v=6ijBQhn06CA
    Ukubingelela

  5.   GustavoIP kusho

    Ngiyabonga ngomnikelo, ngisanda kufaka iseva ye-LEMP futhi ngenxa yebhulogi yakho sengivele nginombono wokuthi ngingawasebenzisa kanjani amakhasi wami we-WEB, manje funda iPHP noma i-HTML encane, noma yikuphi okulula nokuzayo.
    Ukubingelela

  6.   UFabian Ariel Wolf kusho

    Ngokunikezwa ngamagama akho okuvula, cabanga ukuthi ungenza isifundo ngesinyathelo ngesinyathelo kubantu abangenalwazi njengami… nganginephutha.

  7.   UDiego ramos kusho

    Kungisebenzele ngokwanele, ngiyabonga kakhulu.

  8.   UMiguel Angel Silva kusho

    Kuhle lokhu kufundisa ...