Uyifaka njani i-Apache web server kwi-Ubuntu 18.04?

Ubuntu apache

Apache Ngumthombo ovulekileyo, umnqamlezo weqonga lomncedisi wewebhu Esebenzisa umthetho olandelwayo we-HTTP / 1.12 kunye nombono wesiza esibonakalayo. Injongo yale projekthi kukubonelela ngokukhuselekileyo, okusebenzayo, kunye nokwandiswa kweseva enika iinkonzo ze-HTTP ngokuvumelanisa nemigangatho yangoku ye-HTTP.

Iseva yewebhu yeApache Ihlala isetyenziswa ngokudibanisa ne-MySQL database, ulwimi lokubhala lwe-PHP kunye nezinye iilwimi. ithandwa njengePython kunye noPerl. Oluqwalaselo lubizwa ngokuba yi-LAMP (iLinux, i-Apache, i-MySQL kunye nePerl / iPython / i-PHP) kwaye yenza iqonga elinamandla nelomeleleyo lophuhliso kunye nokusasazwa kwezicelo ezisekwe kwiwebhu.

Inkqubo yofakelo lwe-Apache

Ngenxa yokuthandwa kakhulu kwesicelo inokufunyanwa ngaphakathi koovimba Uninzi lonikezelo lweLinux, ke ukufakwa kwayo kulula.

Kwimeko ye-Ubuntu 18.04 zombini idesktop kunye neseva Siya kuxhomekeka kwiphakheji engaphakathi koovimba.

Kufuneka sivule i-terminal kwaye senze lo mthetho ulandelayo:

sudo apt update

sudo apt install apache2

Solo kufuneka siqinisekise ukufakwa kwaye zonke iipakeji eziyimfuneko ukuze i-Apache isebenze kwikhompyuter yethu ziya kufakwa.

Igqityiwe inkqubo Kufuneka siqinisekise kuphela ukuba ifakwe kakuhle, koku kwisiphelo esikwenzayo:

sudo systemctl status apache2

Phi Sifanele ukufumana impendulo efana nale:

Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)

Ngale nto siyabona ukuba inkonzo ifakiwe kwaye isebenza ngokuchanekileyo. Nangona sinenye indlela yokuqinisekisa oku.

El Enye indlela kukucela iphepha le-Apache, kuba oku kufuneka singene kwi-ip idilesi kwisikhangeli sethu.

Ukuba abayazi idilesi ye-IP kwikhompyuter yakho, banokuyifumana ngeendlela ezahlukeneyo kwilayini yomyalelo.

Kufuneka siphumeze lo myalelo kuphela:

hostname -I

Xa sisenza njalo, siya kuboniswa uluhlu lwazo, banokuvavanya isikhangeli ngasinye nganye, sinokuchonga idilesi yethu ye-IP xa oku kulandelayo kuboniswa kwisikhangeli:

apache_default

Eli liphepha le-Apache elisibonisa ukuba liyasebenza kwikhompyuter yethu kwaye lisibonisa umkhombandlela apho ineefayile zoqwalaselo ezithile.

Imiyalelo esisiseko yeApache

Sele i-Apache web server isebenza kwinkqubo yethu, Kuya kufuneka uyazi imiyalelo esisiseko koku, kuba ngale nto sinokuqala okanye simise inkqubo ukuba kukho imfuneko.

Imiyalelo emibini esisiseko kukuqala nokumisa inkonzo kwikhompyuter yethu, ukulungiselela oku kuphela Kuya kufuneka siphumeze kwisiphelo sendlela xa sifuna ukuqala i-Apache:

sudo systemctl start apache2

Ngexesha ukumisa i-Apache esiyenzayo:

sudo systemctl stop apache2

Sikwanamathuba okuba qala inkonzo kwakhona ungayeki, oku sikwenza kuphela:

sudo systemctl restart apache2

Ngoku omnye umyalelo onokuba luncedo kakhulu xa usebenza kwaye sifuna inkqubo yokuhlaziya, singawenza lo myalelo ongazukuqhawula uqhagamshelo esele lukhona neseva:

sudo systemctl reload apache2

Kwimeko apho ufuna ukukhubaza inkonzo senza kuphela:

sudo systemctl disable apache2

Kwaye kwimeko echaseneyo kwimeko yokuphinda unike amandla inkonzo kwiqela lethu siphumeza kuphela:

sudo systemctl enable apache2

Iimodyuli ze-Apache2

I-Apache2 ngumncedisi onokuncediswa yimodyuli. Iimpawu ezongeziweyo ziyafumaneka kwiimodyuli ezinokulayishwa kwi-Apache2. Ngokuzenzekelayo, iiseti zeemodyuli zibandakanyiwe kwiseva ngexesha lokudityaniswa.

Ubuntu buhlanganisa i-Apache2 ukuvumela ukulayishwa kwemodyuli enamandla. Imikhombandlela yoqwalaselo inokubandakanya ukubakho kwemodyuli ngokuzibandakanya kwibhloko .

Banokufaka iimodyuli ezingaphezulu ze-Apache2 kwaye bazisebenzise kwiserver yewebhu. Umzekelo, sebenzisa lo myalelo ulandelayo kwikhonsoli yokufaka imodyuli yokuQinisekiswa kwe-MySQL:

sudo apt install libapache2-mod-auth-mysql

Kwikhowudi ye- / etc / apache2 / mods-available you can check the add-on modules.

I-Apache inenani elikhulu labo, kodwa ukuba ufuna ukwazi ngakumbi ndincoma funda eli candelo ukuba abafana abavela kwi-Canonical babelane nathi.


Umxholo wenqaku uyabambelela kwimigaqo yethu imigaqo yokuziphatha yokuhlela. Ukuxela impazamo cofa apha.

Yiba ngowokuqala ukuphawula

Shiya uluvo lwakho

Idilesi yakho ye email aziyi kupapashwa. ezidingekayo ziphawulwe *

*

*

  1. Uxanduva lwedatha: UMiguel Ángel Gatón
  2. Injongo yedatha: Ulawulo lwe-SPAM, ulawulo lwezimvo.
  3. Umthetho: Imvume yakho
  4. Unxibelelwano lwedatha: Idatha ayizukuhanjiswa kubantu besithathu ngaphandle koxanduva lomthetho.
  5. Ukugcinwa kweenkcukacha
  6. Amalungelo: Ngalo naliphi na ixesha unganciphisa, uphinde uphinde ucime ulwazi lwakho.