Pulogalamu yamapulogalamu yotchedwa LAMP ikuphatikizapo OS pa kernel ya Linux, seva ya Apache, database ya MySQL, ndi zipangizo za PHP zomwe zimagwiritsidwa ntchito pa injini yanu. Kenako, timalongosola mwatsatanetsatane za kukhazikitsa ndi kuyimitsa koyambirira kwazowonjezera izi, kutenga chitsanzo cha Ubuntu zatsopano.
Ikani LAMP patsogolo mu Ubuntu
Popeza momwe maonekedwewa alili kale akutanthauza kuti mwaika Ubuntu pa kompyuta yanu, tidzasunthira phazi ili ndikupita ku mapulogalamu ena, koma mungapeze malangizo pa mutu womwe umakukondani mwa kuwerenga nkhani zina pazotsatira izi.
Zambiri:
Kuyika Ubuntu pa VirtualBox
Linux Installation Guide ndi Flash Drives
Gawo 1: Sakani Apache
Yambani mwa kukhazikitsa webusaiti yotseguka yotchedwa Apache. Ndi imodzi mwa njira zabwino kwambiri, kotero zimakhala zosankha za ogwiritsa ntchito ambiri. Mu Ubuntu izo zimayikidwa "Terminal":
- Tsegulani menyu ndipo yambani kutsegula kapena kusindikiza kuphatikiza Ctrl + Alt + T.
- Choyamba, onetsani zosungira zanu kuti muonetsetse kuti muli ndi zigawo zonse zofunika. Kuti muchite izi, lembani lamuloli
sudo apt-get update
. - Zochitika zonse kudutsa sudo Kuthamanga ndi mizu yofikira, kotero onetsetsani kuti mulowetsa mawu anu achinsinsi (sichiwonetsedwe mukalowa).
- Mukamaliza, lowani
sudo apt-get kukhazikitsa apache2
kuwonjezera apache ku dongosolo. - Onetsetsani kuwonjezera mafayilo mwa kusankha yankho D.
- Tidzayesa seva la intaneti pogwiritsa ntchito
sudo apache2ctl configtest
. - Mawu omasulira ayenera kukhala achilendo, koma nthawi zina pali chenjezo lofunika kuwonjezera Servername.
- Onjezerani zosinthika zapadziko lonse pa fayilo yosinthira kuti mupewe machenjezo mtsogolomu. Kuthamangitsani fayiloyo kudutsa
sudo nano /etc/apache2/apache2.conf
. - Tsopano muthamangitsire kachiwiri, pomwe muthamanga lamulo
ip addr amasonyeza eth0 | kulola inet | awk '{kusindikiza $ 2; } '| sed 's //.*$//'
kuti mudziwe malo anu a IP kapena seva yanu. - Choyamba "Terminal" pitani kumunsi kwa fayilo yotseguka ndi kulowa
Dzina laSevaName + kapena adilesi ya IP
kuti mwangophunzira. Sungani kusintha kudzera Ctrl + O ndi kutseka fayilo yosinthidwa. - Chitani chiyeso china kuti muwone kuti palibe zolakwika, ndiyeno muyambitsenso seva la intaneti kudzera
Chikondi choyamba cha apache2
. - Onjezani Apache kuti ayambe, ngati mukufuna kuti ayambe ndi dongosolo loyendetsa ndi lamulo
sudo sitingathe kuthandiza apache2
. - Amangokhala kuti ayambe seva la intaneti kuti ayang'ane kukhazikika kwake, gwiritsani ntchito lamulo
chikondi chimayamba apache2
. - Yambani msakatuli wanu ndikupita
localhost
. Ngati muli patsamba lapamwamba la Apache, ndiye kuti zonse zikugwira ntchito molondola, pita ku sitepe yotsatira.
Gawo 2: Yesani MySQL
Khwerero yachiwiri ndi kuwonjezera deta ya MySQL, yomwe imagwiritsidwanso kupyolera muyezo wothandizira pogwiritsa ntchito malamulo omwe alipo mu dongosolo.
- Choyambirira "Terminal" lemba
sudo apt-get kukhazikitsa mysql-server
ndipo dinani Lowani. - Onetsetsani Kuwonjezera kwa mafayilo atsopano.
- Onetsetsani kuti muteteze kugwiritsa ntchito malo anga a MySQL, motero chitetezani chitetezo ndi zosiyana zowonjezeredwa zomwe zaikidwa kudzera
sudo mysql_secure_installation
. - Kukhazikitsa mapulani a pulogalamu yachinsinsi sikutanthauza malangizo amodzi, chifukwa aliyense wogwiritsira ntchito amatsutsidwa ndi njira zake zowonjezera. Ngati mukufuna kukhazikitsa zofunikira, lowetsani muzondomeko y pa pempho.
- Kenaka, muyenera kusankha mlingo wa chitetezo. Choyamba werengani kufotokozera kwa gawo lililonse, ndipo sankhani zoyenera kwambiri.
- Ikani mawu achinsinsi kuti mutsimikizire kupeza mizu.
- Kuwonjezera pamenepo, mudzawona zochitika zosiyanasiyana zotetezera patsogolo panu, kuziwerenga ndi kuvomereza kapena kukana ngati mukuona kuti ndizofunikira.
Tikukulimbikitsani kuwerenga ndondomeko ya njira yowonjezera mu nkhani yathu yapadera, yomwe mungapeze pazotsatira zotsatirazi.
Onaninso: MySQL Installation Guide ya Ubuntu
Khwerero 3: Sakani PHP
Gawo lomaliza loonetsetsa kuti ntchito ya LAMP ndiyoyendetsedwa bwino ndi kukhazikitsa zigawo za PHP. Palibe chovuta pakukwaniritsa njirayi, mukufunikira kugwiritsa ntchito limodzi la malamulo omwe alipo, ndikukonzekera ntchito yowonjezeretsa.
- Mu "Terminal" lembani gululo
sudo apt-get install php7.0-mysql php7.0-curl php7.0-json php7.0-cgi php7.0 libapache2-mod-php7.0
kukhazikitsa zofunika zigawo zikuluzikulu ngati mukufuna 7. - Nthawi zina lamulo ili pamwamba ndi losweka, choncho gwiritsani ntchito
sudo apt install php 7.2-cli
kapenasudo apt kukhazikitsa hhvm
kukhazikitsa mawonekedwe atsopano atsopano 7.2. - Pambuyo pomaliza ndondomekoyi, onetsetsani kuti msonkhano woyenera umayikidwa polemba pa console
php -v
. - Kukonzekera kwasanja ndi mawonekedwe a webusaitiyi akugwiritsidwa ntchito pogwiritsira ntchito chipangizo chaulere PHPmyadmin, chomwe chiri chofunikanso kukhazikitsa nthawi ya kukonza LAMP. Kuti muyambe, lowetsani lamulo
sudo apt-get install phpmyadmin php-mbstring php-gettext
. - Onetsetsani Kuwonjezera kwa mafayilo atsopano mwa kusankha njira yoyenera.
- Tchulani seva la intaneti "Apache2" ndipo dinani "Chabwino".
- Mudzafunsidwa kuti musungire malowa pogwiritsa ntchito lamulo lapadera, ngati kuli koyenera, sankhani yankho lolondola.
- Pangani neno lachinsinsi kuti mulembetse ndi seva ya deta, pambuyo pake muyenera kutsimikizira izi mwa kubwezeretsanso.
- Mwachinsinsi, simungathe kulowa kwa PHPmyadmin m'malo mwa wogwiritsa ntchito mizu kapena kudzera muzipangizo za TPC, kotero muyenera kulepheretsa ntchito yothandizira. Gwiritsani ntchito ufulu wa mizu kudzera mwa lamulo
sudo -i
. - Gwiritsani ntchito kutseka kwa kulemba
lembani "wosintha wosuta atsegula plugin =" kumene User = "muzu"; ufulu; "| mysql -u root -p mysql
.
Potsatira njirayi, kukhazikitsa ndi kukonzekera kwa PHP kwa LAMP kungatengedwe bwino.
Onaninso: PHP Installation Guide kwa Ubuntu Server
Lero tinaphimba maimidwe ndi masinthidwe oyambirira a zigawo za LAMP kwa Ubuntu opangira dongosolo. Zoonadi, izi sizinthu zonse zomwe zingaperekedwe pa mutuwu, pali maonekedwe ambiri ogwirizana ndi kugwiritsa ntchito madera angapo kapena mabungwe. Komabe, chifukwa cha malangizo omwe ali pamwambawa, mungathe kukonzekera mosavuta dongosolo lanu kuti mugwiritse ntchito molondola pulogalamuyi.