Momwe mungakhalire seva ya Apache pa Ubuntu 18.04?

ubuntu apache

Apache ndi gwero lotseguka, seva yolumikizana ndi HTTP yomwe imagwiritsa ntchito njira ya HTTP / 1.12 komanso malingaliro atsamba. Cholinga cha ntchitoyi ndikupereka seva yotetezeka, yothandiza, komanso yotheka yomwe imapereka ntchito za HTTP mogwirizana ndi miyezo ya HTTP yapano.

Apache tsamba la seva Nthawi zambiri imagwiritsidwa ntchito limodzi ndi injini ya database ya MySQL, chilankhulo cha PHP, ndi zilankhulo zina. otchuka monga Python ndi Perl. Kukonzekera kumeneku kumatchedwa LAMP (Linux, Apache, MySQL ndi Perl / Python / PHP) ndipo imapanga nsanja yamphamvu komanso yolimba pakukula ndikugawa ntchito zapaintaneti.

Kukonzekera kwa Apache

Chifukwa cha kutchuka kwakukulu kwa kugwiritsa ntchito mungapezeke m'malo osungira zinthu magawo ambiri a Linux, kotero kuyiyika kwake ndikosavuta.

Pankhani ya Ubuntu 18.04 desktop ndi seva tidzadalira phukusi lomwe lili m'malo osungira zinthu.

Tiyenera kutsegula terminal ndikutsatira lamulo lotsatira:

sudo apt update

sudo apt install apache2

payekha Tiyenera kutsimikizira kuyika ndipo ma phukusi onse oyenera a ntchito ya Apache adzaikidwa pamakompyuta athu.

Anamaliza ntchitoyo Tiyenera kungowonetsetsa kuti idayikidwa molondola, chifukwa chazomwe timagwira:

sudo systemctl status apache2

Kuti tiyenera kulandira yankho lofanana ndi ili:

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

Ndi izi titha kuwona kuti ntchitoyi idakhazikitsidwa ndipo ikuyenda bwino. Ngakhale tili ndi njira ina yotsimikizira izi.

El njira ina ndikupempha tsamba la Apache, Chifukwa cha ichi tiyenera kungoyika adilesi yathu ya ip mu msakatuli wathu.

Ngati sakudziwa adilesi ya IP ya kompyuta yanu, amatha kuyipeza m'njira zosiyanasiyana kuchokera pamzere wolamula.

Tiyenera kuchita lamuloli:

hostname -I

Potero, tiwonetsedwa mndandanda wa iwo, atha kupita kukayezetsa pamsakatuli m'modzi, titha kudziwa adilesi yathu ya IP pomwe zotsatirazi zikuwonetsedwa mu msakatuli:

apache_default

Ili ndiye tsamba la Apache lomwe limatiwonetsa kuti likuyenda pakompyuta yathu ndipo imatiwonetsa chikwatu pomwe chili ndi mafayilo osintha.

Malamulo Oyambirira a Apache

Popeza tili ndi seva ya Apache yomwe ikuyenda m'dongosolo lathu, muyenera kudziwa malamulo oyambira za izi, chifukwa ndi izi titha kuyambitsa kapena kuyimitsa ntchitoyi ngati kuli kofunikira.

Malamulo awiri ofunikira kwambiri ndikuyamba ndikuyimitsa ntchitoyi pamakompyuta athu, pazokha Tiyenera kuchita pa terminal tikufuna kuyamba Apache:

sudo systemctl start apache2

Pamene kuletsa Apache timachita:

sudo systemctl stop apache2

Tilinso ndi kuthekera kwa yambitsani ntchitoyo osayimitsa, chifukwa cha izi timangopanga:

sudo systemctl restart apache2

Tsopano lamulo lina lomwe lingakhale lothandiza mukamayendetsa ndipo tikufunika kuyambiranso, titha kukwaniritsa lamuloli lomwe silimasokoneza kulumikizana komwe kulipo ndi seva:

sudo systemctl reload apache2

Ngati mukufuna kuletsa ntchitoyi timangopanga:

sudo systemctl disable apache2

Ndipo pankhani yotsutsana ngati zithandizanso ntchitoyi mu timu yathu timangopanga:

sudo systemctl enable apache2

Ma module apache2

Apache2 ndi seva yomwe imatha kuphatikizidwa ndi ma module. Zowonjezera zimapezeka kudzera ma module omwe amatha kusungidwa ku Apache2. Pokhapokha, ma module angapo amaphatikizidwa ndi seva nthawi yonse yolembetsa.

Ubuntu amalemba Apache2 kuti alole kutsegulira modula mwamphamvu. Maupangiri amasinthidwe atha kuphatikizira kupezeka kwa gawo powaphatikiza ndi block .

Amatha kukhazikitsa ma module apache2 ambiri ndikuzigwiritsa ntchito pa intaneti. Mwachitsanzo, tsatirani lamulo lotsatirali mukontena kuti muyike gawo Lotsimikizira la MySQL:

sudo apt install libapache2-mod-auth-mysql

Mu chikwatu cha / etc / apache2 / mods mutha kuwona ma module owonjezera.

Apache ali ndi ambiri, koma ngati mukufuna kudziwa zambiri ndikupangira werengani gawo ili kuti anyamata ochokera ku Canonical agawane nafe.


Zomwe zili m'nkhaniyi zikutsatira mfundo zathu za malamulo okonzekera. Kuti mufotokoze cholakwika dinani Apa.

Khalani oyamba kuyankha

Siyani ndemanga yanu

Anu email sati lofalitsidwa.

*

*

  1. Wotsogolera pazosankhazi: Miguel Ángel Gatón
  2. Cholinga cha deta: Control SPAM, kasamalidwe ka ndemanga.
  3. Kukhazikitsa: Kuvomereza kwanu
  4. Kulumikizana kwa zomwe zafotokozedwazo: Zomwezo siziziwululidwa kwa anthu ena kupatula pakukakamizidwa mwalamulo.
  5. Zosunga: Zosungidwa ndi Occentus Networks (EU)
  6. Ufulu: Nthawi iliyonse mutha kuchepetsa, kuchira ndikuchotsa zidziwitso zanu.

bool (zoona)