Otu esi etinye ma ọ bụ kwalite Apache na ụdị kacha ọhụrụ na Debian 11 Bullseye

Apache, bụkwa nke a maara dị ka Ihe nkesa HTTP Apache, bụ otu n'ime ngwa sava weebụ a na-ejikarị eme ihe n'ụwa niile n'ime iri afọ ole na ole gara aga. Site na ndabara, arụnyere Apache, yana na ebe nchekwa Debian 11 Bullseye; Otú ọ dị, na Debian, nsụgharị kwụsiri ike adịghị agbanwe ọtụtụ akụkụ ma e wezụga maka nchekwa ma ọ bụ mmelite ahụhụ ngwa ngwa iji mee ka aha ahụ dị "kwụsi ike," nke mara ha. N'ihi nke a, Apache nwere ike tufuo njirimara na nkwalite ọhụrụ yana ndozi ahụhụ na-enweghị nchekwa karịsịa nyere oge igbu oge n'etiti mwepụta Debian kwụsiri ike ịbụ afọ ole na ole n'etiti.

N'ime nkuzi a, ị ga-amụta Otu esi eme nkwalite gaa na sava weebụ Apache kacha ọhụrụ na Debian 11 Bullseye.

Prerequisites

  • OS akwadoro: Nnenna 11 Bullseye
  • Akaụntụ onye ọrụ: Akaụntụ onye ọrụ nwere sudo ihe ùgwù or ohere mgbọrọgwụ (su Command).
  • Ngwungwu achọrọ: curl

Na-emelite Sistemụ Ọrụ

Melite gi Debian 11 Sistemụ arụmọrụ iji hụ na ngwugwu niile dị adị adịla ugbu a:

sudo apt update && sudo apt upgrade

Mgbọrọgwụ ma ọ bụ Sudo Access

Site na ndabara, mgbe ị mepụtara akaụntụ gị na mmalite na Debian ma e jiri ya tụnyere nkesa ndị ọzọ, ọ naghị enweta ọkwa sudoers ozugbo. Ị ga-enwerịrị ike ịnweta ya mgbọrọgwụ paswọọdụ iji iwu su ma ọ bụ gaa na nkuzi nkuzi anyị Otu esi etinye onye ọrụ na Sudoers na Debian.

Wụnye ngwugwu CURL

Nkuzi ga-eji ihe ngwugwu curl; mbụ, chọpụta ma ọ bụrụ na ngwugwu dị:

curl --version

Mwepụta ihe atụ ma ọ bụrụ arụnyere:

curl 7.74.0 (x86_64-pc-linux-gnu) libcurl/7.74.0 OpenSSL/1.1.1k zlib/1.2.11 brotli/1.0.9 libidn2/2.3.0 libpsl/0.21.0 (+libidn2/2.3.0) libssh2/1.9.0 nghttp2/1.43.0 librtmp/2.3
Release-Date: 2020-12-09

Ọ bụrụ na itinyeghị curl, jiri iwu a:

sudo apt install curl -y

Advertisement


Wụnye Apache kacha ọhụrụ

Na-agbakwụnye ebe nchekwa Apache nke Ondřej Surý Repository

Nzọụkwụ mbụ bụ mbubata na wụnye Apache webserver na ọhụrụ version bụ tinye ebe nchekwa site Ondřej Surý's. Maka ndị ahụ na-amaghị, Ondřej bụ onye na-echekwa PHP na Debian.

Iji tinye ebe nchekwa ahụ, jiri iwu na-esonụ na ọdụ gị:

curl -sSL https://packages.sury.org/apache2/README.txt | sudo bash -x

Melite ebe nchekwa gị iji gosipụta mgbanwe ọhụrụ:

sudo apt update

Ugbu a ị wụnyela Ebe nchekwa Apache wee melite ndepụta nchekwa, tinye Apache2 na ihe ndị a:

sudo apt install apache2

Ihe atụ mmepụta:

Pịnye Y, mgbe ahụ, pịa igodo ntinye ịga n'ihu na mezue nrụnye.

Na-esote, gosi na nrụnye ahụ gara nke ọma site n'ịkwado ihe nrụpụta ọhụrụ:

sudo apache2 -v

Ihe atụ mmepụta:

Server version: Apache/2.4.51 (Debian)
Server built:   2021-10-07T19:28:50

Ugbu a, jide n'aka na Apache na-agba ọsọ site na iji systemctl iwu:

systemctl status apache2

Ihe atụ mmepụta:

Ọ bụrụ na Apache adịghị arụ ọrụ, ka ịmalite ngwa sava weebụ, jiri iwu a:

sudo systemctl start apache2

Iji mee ka Apache rụọ ọrụ na buut sistemụ, jiri ihe ndị a:

sudo systemctl enable apache2

Mwepụta ihe atụ ma ọ bụrụ na ọ ga nke ọma:

Synchronizing state of apache2.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable apache2

A ga-edobe ma na-emelite ụdị a mgbe ụdị Apache ọhụrụ dị; Ondřej Surý na-emelite n'ime ụbọchị ole na ole ruo izu ole na ole ka ọ na-edobe ebe nchekwa PHP, Nginx na Apache wuru; ọ na-agbanwe agbanwe na mmelite ya.

Nhọrọ. Hazie UFW Firewall maka Apache

Mgbe ị wụnye sava weebụ Apache 2, ị ga-achọ ịgbanwe ya Iwu UFW ma ọ bụrụ na etinyere UFW. Ka ikwe ka mpụ banye na ọdụ ụgbọ mmiri webụ ndabara. Luckily, n'oge echichi, Apache debanyere onwe ya na UFW iji nye profaịlụ ole na ole enwere ike iji mee ka ma ọ bụ gbanyụọ ohere, na-eme ka ọ dị mfe na ngwa ngwa ịhazi.

Ọ bụrụ na ị ga-achọ ịwụnye UFW firewall, mee iwu a:

sudo apt install ufw -y

Ozugbo etinyere UFW, mee ka UFW malite ma na-arụ ọrụ na buut sistemụ.

sudo ufw enable

Na-esote, depụta profaịlụ ngwa ka ịhụ profaịlụ Apache nke dị site na iwu a:

sudo ufw app list

Ihe atụ mmepụta:

Available applications:
  Apache
  Apache Full
  Apache Secure

Site na mmepụta n'elu, ị nwere nhọrọ profaịlụ atọ ịhọrọ site na. Iji kwatuo ya, Apache Ọ na-agba na ọdụ ụgbọ mmiri 80 (HTTP), Apache echekwara na-agba ọsọ na ọdụ ụgbọ mmiri 443 (HTTPS), na Apache zuru ezu bụ ngwakọta nke ikwe ma. Nke a na-ahụkarị bụ Apache Full ma ọ bụ Apache Secure.

Maka nkuzi a, ebe anyị edobebeghị SSL, anyị ga-eme ka profaịlụ Apache jiri iwu a:

sudo ufw allow 'Apache'

Ihe atụ mmepụta:

Rule added
Rule added (v6)

Dịka n'elu, agbakwunyere iwu maka ma IPV4 na IPV6. Mgbe emechara, ị nwere ike gbanyụọ profaịlụ a wee mee ka nchekwa naanị ma ọ bụ gbanyụọ iwu Apache wee jiri Apache zuru oke kama.


Advertisement


Otu esi emelite Apache

Ka imelite Apache n'ọdịniihu, naanị ihe ị ga - eme bụ ịgba ọsọ iwu mmelite dabara adaba dị ka ọhụrụ repository na-agbakwunyere na apt isi iyi ndepụta:

sudo apt update

Ọ bụrụ otu dị, kwalite Apache dị ka ndị a:

sudo apt upgrade

Ma ọ bụ kwalite Apache n'onwe ya:

sudo apt upgrade apache2

Nke ahụ bụ naanị ihe ị ga-eme ka emelite ụdị gị.

Okwu na mmechi

N'ime nkuzi a, ị mụtala ka esi etinye Apache 2 ma ọ bụ iji ebe nchekwa nke Ondřej Surý. N'ozuzu, Apache bụ ihe nkesa ngwa weebụ a na-ejikarị eme ihe n'ụwa ruo ọtụtụ iri afọ. Agbanyeghị, Nginx emechaala n'isi ntakịrị ntakịrị. Apache ka bụ otu n'ime ngwa weebụ a na-ebugharị na ama ama, ọkachasị yana ijikọ nchịkọta LAMP, nke a na-ejikarị maka sava weebụ azụ azụ. Ị ga-achọta nhọrọ enyi na enyi maka Apache karịa Nginx, na-eduga ndị ọrụ ọhụrụ ịbanye na sava weebụ ha, ikekwe ịnwale Apache n'elu Nginx dị ka nzọụkwụ mbụ.

Idenye aha
Gwa nke
0 Comments
Inline nzaghachi
Lee echiche niile
0
Ga-ahụ n'anya gị echiche, biko okwu.x