Phukusi la mapulogalamu lotchedwa LAMP limaphatikizapo Linux kernel OS, seva ya Apache, seva ya MySQL, ndi zida za PHP zogwiritsidwa ntchito pa injini ya tsamba. Chotsatira, tifotokoza mwatsatanetsatane kukhazikitsa ndi kusintha koyambirira kwa zowonjezera izi, titenga mtundu waposachedwa wa Ubuntu monga chitsanzo.
Kukhazikitsa LAMP Software Suite ku Ubuntu
Popeza mawonekedwe a nkhaniyi akutanthauza kuti muli ndi Ubuntu woyika pakompyuta yanu, tidzadumpha sitepe iyi ndikupitilira mapulogalamu ena, komabe mutha kupeza malangizo pazomwe mungasangalale nazo powerenga zolemba zathu zotsatirazi.
Zambiri:
Ikani Ubuntu pa VirtualBox
Maulendo apamwamba a Linux kuchokera pagalimoto yaying'ono
Gawo 1: Ikani Apache
Tiyeni tiyambe ndi kukhazikitsa seva yotseguka yotchedwa Apache. Ndi imodzi mwazabwino kwambiri, chifukwa chake imakhala kusankha kwa ogwiritsa ntchito ambiri. Mu Ubuntu, zimayikidwa "Pokwelera":
- Tsegulani menyu ndikuyambitsa kontena kapena akanikizani chophatikiza Ctrl + Alt + T.
- Sinthani malo anu osungira kuti mukhale ndi zonse zofunikira. Kuti muchite izi, lembani lamulo
kukonda kwambiri
. - Zochita zonse kudzera wokonda imayendera ndi kulowa kwa mizu, onetsetsani kuti mwatchera dzina lanu lolowera (sizimawonekera mukalowa).
- Mukamaliza, lowani
sudo apt-kukhazikitsa apache2
kuwonjezera Apache kudongosolo. - Tsimikizani kuwonjezera mafayilo onse posankha yankho D.
- Tiyeni tiyeze momwe seva yolumikizira intaneti ikuyendera
sudo apache2ctl sintha
. - Maphatikizidwe amayenera kukhala abwinobwino, koma nthawi zina chenjezo limawonekera pakufunika kowonjezera Servername.
- Onjezani kusinthaku kwapadziko lonse ndi fayilo yosinthika kuti mupewe machenjezo amtsogolo. Yendetsani fayiloyo yokha
sudo nano /etc/apache2/apache2.conf
. - Tsopano yendetsani chogwirizira chachiwiri, komwe mumayendetsere lamulo
ip addr yowonetsa eth0 | grep zolowera | awk '{kusindikiza $ 2; } '| sed 's / /
kuti mudziwe adilesi yanu ya IP kapena seva ya seva. - Poyamba "Pokwelera" pita pansi pansi pa fayilo lotseguka ndikulemba
ServerName + dzina lachifumu kapena adilesi ya IP
kuti mwangophunzira. Sungani zosintha kudzera Ctrl + O ndikatseka fayilo yosinthira. - Yesaninso kuti muwonetsetse kuti palibe zolakwika, kenako kuyambitsanso seva yanu
sudo systemctl restart apache2
. - Onjezani Apache ku autoload ngati kuli kofunikira kotero kuti ikuyamba ndi opareshoni pogwiritsa ntchito lamulo
sudo systemctl imapangitsa apache2
. - Zimangoyambitsa seva ya intaneti kuti muwone ngati kayendetsedwe ka ntchito yanu, gwiritsani ntchito lamulo
sudo systemctl amayamba apache2
. - Tsegulani msakatuli ndikupita ku
khalid
. Ngati mwafika pa tsamba lalikulu la Apache, ndiye kuti zonse zikuyenda bwino, pitani ku sitepe lotsatira.
Gawo 2: Ikani MySQL
Gawo lachiwiri ndikuwonjezera database ya MySQL, yomwe imachitidwanso kudzera mu console yokhazikika pogwiritsa ntchito malamulo omwe akupezeka mu dongosololi.
- Kuyika patsogolo "Pokwelera" lembani
sudo apt-kukhazikitsa seva-seva
ndipo dinani Lowani. - Tsimikizirani kuwonjezera kwamafayilo atsopano.
- Onetsetsani kuti mukuteteza zachilengedwe za MySQL, choncho perekani chitetezo ndi pulogalamu yowonjezera, yomwe imayikidwa
sudo mysql_secure_installation
. - Kukhazikitsa zoikamo mapulogalamu azinsinsi sizikhala ndi malangizo amodzi, popeza wogwiritsa ntchito aliyense amatsogozedwa ndi zosankha zawo malinga ndi chitsimikiziro. Ngati mukufuna kukhazikitsa zofunika, lowetsani cholumikizira y mukapempha.
- Chotsatira, muyenera kusankha mtundu wa chitetezo. Choyamba, werengani malongosoledwe amtundu uliwonse, kenako sankhani yoyenera kwambiri.
- Khazikitsani mawu achinsinsi atsopano kuti mupereke mizu.
- Kenako, muwona zosintha zingapo, muziwerenga ndikuvomera kapena kukana, ngati zikufunika.
Tikukulangizani kuti mudziwe bwino momwe mungafotokozere njira ina yokhazikitsa mu nkhani yathu ina, yomwe mupezeko pa ulalo wotsatirawu.
Onaninso: Upangiri Wanga wa MySQL pa Ubuntu
Gawo 3: Ikani PHP
Gawo lomaliza lowonetsetsa kuti magwiridwe antchito a LAMP ndi kukhazikitsa zida za PHP. Palibe chosokoneza pakukhazikitsa njirayi, mumangofunika kugwiritsa ntchito imodzi mwalamulo, ndikusintha zowonjezera zokha.
- Mu "Pokwelera" lembani lamulo
sudo apt-simani php7.0-mysql php7.0-curl php7.0-json php7.0-cgi php7.0 libapache2-mod-php7.0
kukhazikitsa zinthu zofunika ngati mukufuna mtundu 7. - Nthawi zina lamulo lomwe lili pamwambapa silikugwira ntchito, choncho gwiritsani ntchito
sudo apt kukhazikitsa php 7.2-ent
kapenawokonda kukhazikitsa hhvm
kukhazikitsa mtundu waposachedwa wa 7.2. - Pamapeto pa njirayi, onetsetsani kuti msonkhano wolondola unayikidwa polemba mu cholembera
php -v
. - Kuwongolera kwa database ndi kukhazikitsa mawonekedwe awebusayiti kumachitika pogwiritsa ntchito chida chaulere cha PHPmyadmin, chofunikiranso kukhazikitsa pakukhazikitsa kwa LAMP. Kuti muyambe, ikani lamulo
sudo apt-kukhazikitsa phpmyadmin php-mbstring php-kupeza
. - Tsimikizirani kuwonjezera kwamafayilo atsopano posankha njira yoyenera.
- Fotokozerani seva yapaintaneti "Apache2" ndipo dinani Chabwino.
- Mudzauzidwa kuti musunthire database mwalamulo lapadera, ngati kuli koyenera, sankhani yankho labwino.
- Pangani mawu achinsinsi polembetsa pa seva ya database, pambuyo pake adzafunika kutsimikiziridwa ndikuyambiranso.
- Mwakusintha, simudzatha kulowa PHPmyadmin m'malo mwa wogwiritsa ntchito mizu kapena kudzera pa malo a TPC, chifukwa chake muyenera kuletsa zofunikira kutilepheretsa. Yambitsani ufulu wa mizu kudzera mwa lamulo
wokonda -i
. - Kanikizani mwa kulemba
echo "wosuta seti ya plugin =" pomwe mtumiaji = "muzu"; mwayi wosangalatsa; "| mysql -uzu -p mysql
.
Pamenepa, kukhazikitsa ndi kusintha kwa PHP kwa LAMP kuonedwa kuti kumatha bwino.
Onaninso: Kuwongolera Kukhazikitsa kwa PHP pa Ubuntu Server
Lero tidayikapo pa kukhazikitsa ndi kukhazikitsa koyambirira kwa zida za LAMP ku Ubuntu. Zachidziwikire, izi sizomwe zidziwitso zonse zomwe zingaperekedwe pamutuwu, pali zambiri zamaganizidwe zokhudzana ndi kugwiritsa ntchito madilesi angapo kapena madongosolo ambiri. Komabe, chifukwa cha malangizo omwe ali pamwambapa, mutha kukonzekera dongosolo lanu mosavuta kuti pulogalamu iyi ipangike.