Kayan software wanda ake kira LAMP ya hada da OS akan Linux kernel, uwar garken yanar gizo Apache, da MySQL database, da kuma sassan da aka amfani dashi na kamfanin Microsoft. Bayan haka, zamu bayyana dalla-dalla da shigarwa da kuma saitin farko na wadannan add-ons, ɗaukar sabon tsarin Ubuntu misali.
Shigar da ɗakin LAMP a Ubuntu
Tun da tsarin wannan labarin ya riga ya nuna cewa ka shigar Ubuntu akan kwamfutarka, za mu yi watsi da wannan mataki kuma ka je kai tsaye zuwa wasu shirye-shiryen, amma zaka iya samun umarnin kan batun da ke sha'awarka ta karanta wasu shafukanmu a kan wadannan hanyoyin.
Ƙarin bayani:
Shigar da Ubuntu a kan VirtualBox
Shirin Shigarwa na Linux tare da Filafofin Filaye
Mataki na 1: Shigar Apache
Fara da shigar da sabar yanar gizon da ake kira Apache. Yana daya daga cikin mafi kyaun zaɓuɓɓuka, saboda haka ya zama zaɓi na masu amfani da yawa. A Ubuntu an saka ta "Ƙaddara":
- Bude menu kuma kaddamar da na'ura wasan bidiyo ko danna maɓallin haɗin Ctrl + Alt T.
- Na farko, sabunta tsarin tsararren ku don tabbatar da cewa kuna da dukkan abubuwan da ake bukata. Don yin wannan, rubuta umarnin
sudo apt-samun sabuntawa
. - Dukkan ayyuka ta hanyar sudo yana gudana tare da samun damar shiga, don haka tabbatar da shigar da kalmarka ta sirri (ba a nuna shi lokacin da ka shigar da shi).
- Lokacin kammala, shigar
sudo apt-samun shigar apache2
don ƙara apache ga tsarin. - Tabbatar da ƙara duk fayiloli ta hanyar zaɓar amsa D.
- Za mu jarraba uwar garken yanar gizon ta hanyar gujewa
sudo apache2ctl configtest
. - Haɗin ya kamata ya zama al'ada, amma wani lokaci akwai gargadi game da bukatar ƙarawa Mai ba da umurni.
- Ƙara wannan yanayin duniya zuwa fayil ɗin sanyi don kauce wa gargadi a nan gaba. Gudun fayil ɗin ta hanyar
sudo nano /etc/apache2/apache2.conf
. - A yanzu gudanar da na'ura ta biyu, inda za a gudanar da umurnin
ip addr show eth0 | grep inet | awk '{buga $ 2; } '| sed 's //.*$//'
don gano adireshin IP naka ko yankin uwar garke. - A cikin farko "Ƙaddara" sauka zuwa kasa na bude fayil kuma shigar
ServerName + sunan yankin ko adireshin IP
abin da kuka koya kawai. Ajiye canje-canje ta hanyar Ctrl + O da kuma rufe fayil din sanyi. - Yi wani gwaji don tabbatar da cewa babu kurakurai, sannan kuma sake fara sabar yanar gizo ta hanyar
sudo systemctl zata sake farawa apache2
. - Ƙara Apache zuwa farawa, idan kana so ya fara tare da tsarin aiki tare da umurnin
sudo systemctl ba dama apache2
. - Ya rage kawai don fara uwar garken yanar gizo don duba lafiyarsa, amfani da umurnin
sudo systemctl fara apache2
. - Kaddamar da burauzar ka kuma je zuwa
localhost
. Idan kun kasance a shafi na Apache, to, duk abin yana aiki daidai, ci gaba zuwa mataki na gaba.
Mataki na 2: Shigar MySQL
Mataki na biyu shine don ƙara Database na MySQL, wanda aka yi ta hanyar daidaitaccen na'ura ta amfani da umarnin da ke cikin tsarin.
- Bayani a cikin "Ƙaddara" rubuta
sudo apt-samun shigar mysql-uwar garke
kuma danna kan Shigar. - Tabbatar da ƙarin sababbin fayiloli.
- Tabbatar tabbatar da amincin ku na amfani da MySQL, don haka tabbatar da kariya tare da shigarwa da aka ƙara ta hanyar
sudo mysql_secure_installation
. - Tsayar da saitunan plugin don buƙatun kalmar sirri basu da umarni ɗaya, tun lokacin da kowane mai amfani ya mayar da shi ta hanyar mafitacinsa dangane da tabbatarwa. Idan kana so ka shigar da bukatun, shigar da na'ura y a kan bukatar.
- Na gaba, kana buƙatar zaɓar matakin kariya. Da farko ka karanta bayanin kowane saiti, sannan ka zaɓa mafi dace.
- Saita sabon kalmar sirri don tabbatar da damar shiga.
- Bugu da ari, za ku ga tsare-tsaren tsaro a gabanku, karanta su kuma karɓa ko ƙaryatãwa idan kun yi tsammanin ya zama dole.
Muna bada shawara akan karanta bayanin wani tsarin shigarwa a cikin labarinmu na dabam, wanda za ka ga a cikin mahaɗin da ke biyowa.
Duba kuma: Shirin Taimako na MySQL don Ubuntu
Mataki na 3: Shigar da PHP
Mataki na karshe don tabbatar da al'amuran al'ada na tsarin LAMP shine shigarwa na sassan PHP. Babu wani abu mai wuyar aiwatar da wannan tsari, kawai kuna buƙatar amfani da ɗaya daga cikin umarnin da aka samo, sannan kuma saita aikin ƙara-kan kanta.
- A cikin "Ƙaddara" rubuta ƙungiyar
sudo apt-samun shigar php7.0-mysql php7.0-curl php7.0-json php7.0-cgi php7.0 libapache2-mod-php7.0
don shigar da kayan da ake bukata idan akwai buƙatar sashe 7. - Wani lokaci umurnin da aka sama ya karye, don haka amfani
Sudo apt shigar php 7.2-cli
koSudo apt shigar hhvm
don shigar da sabon samfurin 7.2. - Bayan kammala aikin, tabbatar da cewa an shigar da cikakken taro ta hanyar rubutawa a cikin na'ura
php -v
. - Gudanar da bayanan yanar gizo da shafukan yanar gizon aikin yin amfani da kayan aiki kyauta PHPmyadmin, wanda mahimmanci ne don shigarwa a yayin sanyi na LAMP. Don farawa, shigar da umurnin
sudo apt-samun shigar phpmyadmin php-mbstring php-gettext
. - Tabbatar da ƙarin sababbin fayiloli ta zaɓin zaɓi mai dacewa.
- Saka uwar garke yanar gizo "Apache2" kuma danna kan "Ok".
- Za a iya sanya ka don saita jigilar ta hanyar umarni na musamman, idan ya cancanta, zaɓa amsa mai kyau.
- Ƙirƙiri kalmar sirri don yin rajistar tare da uwar garken bayanai, bayan haka zaka buƙatar tabbatar da shi ta sake shigar da shi.
- Ta hanyar tsoho, baza ku iya shiga zuwa PHPmyadmin a madadin mai amfani ba tare da samun damar tushen ko ta hanyar tashoshin TPC, don haka kuna buƙatar musaki mai amfani da ƙuƙwalwa. Kunna hakkokin tushen ta hanyar umarni
sudo -i
. - Yi amfani da shi ta hanyar bugawa
Kira "sabunta mai amfani mai sa plugin =" inda User = "tushen"; sawuwar dama; "| mysql -u tushen -p mysql
.
A wannan hanya, shigarwa da daidaitawar PHP don LAMP za a iya la'akari da nasarar kammalawa.
Duba Har ila yau: Shirin Jagora na PHP don Ubuntu Server
A yau mun rufe shigarwa da kuma tsararren tsari na LAMP don tsarin tsarin Ubuntu. Hakika, wannan ba duk bayanin da za a iya ba a kan wannan batu, akwai wasu nuances da suka haɗa da amfani da wasu yankuna ko bayanai. Duk da haka, godiya ga umarnin da ke sama, zaka iya shirya tsarinka don ingantaccen aikin wannan software.