Sanya LAMP (Linux, Apache, MySQL & PHP) akan Ubuntu 17.10

LAMP

Barka da safiya, a wannan karon zan nuna muku yadda ake girka LAMP (Linux, Apache, MySQL & PHP), wannan babban kayan aikin bude tushe cewa ƙyale mu mu gudanar da karɓar aikace-aikacen gidan yanar gizo akan kwamfutar mu.

de wanda har yanzu kyakkyawan zaɓi ne idan kanaso ka fara da menene ci gaban aikace-aikacen gidan yanar gizo ko fara rubuta ayyukan shirye shiryen gidan yanar sadarka na farko.

Daga farkon misali dole ne mu sabunta duk fakitin na tsarin mu, saboda wannan dole ne mu aiwatar da waɗannan umarnin a cikin tashar.

sudo apt update
sudo apt upgrade

Ta yaya za iSanya LAMP akan Ubuntu 17.10?

Yanzu daga nan dole ne mu girka ayyukan da ke gina LAMP, kamar yadda aka bayyana a baya, da farko iZamu girka Apache akan tsarin mu.

Shigar da sabar yanar gizo ta Apache

apache 2

Kunshin apache2-utils zai girka wasu abubuwan amfani kamar Apache HTTP Server Benchmarking Tool.

Don shigar da shi, muna yin shi tare da umarni mai zuwa:

sudo apt install -y apache2 apache2-utils

Bayan an girka shi, Apache ya kamata ya fara ta atomatik. Dole ne mu tabbatar tare da systemctl.

sudo systemctl start apache2
sudo systemctl enable apache2

Yanzu dole ne mu shiga ip ko dole ne kawai mu rubuta localhost ko 127.0.0.1 kawai a cikin adireshin adireshin mai binciken mu don tabbatar da cewa sabar Apache tana aiki daidai akan kwamfutar mu.

Bayan wannan dole ne mu aiwatar da umarni mai zuwa:

sudo chown www-data: www-data /var/www/html/ -R

Sanya uwar garken MariaDB

MariaDB shine maye gurbin MySQL kai tsaye, don shigar da wannan bayanan dole ne mu aiwatar da umarni mai zuwa:

sudo apt install mariadb-server mariadb-client

Bayan an girka shi, uwar garken MariaDB ya kamata ya yi aiki kai tsaye.
Idan baya aiki, zamu fara shi da wannan umarnin:

sudo systemctl start mariadb

Don bawa MariaDB damar farawa ta atomatik a lokacin taya:

sudo systemctl enable mariadb

Yanzu muna buƙatar gudanar da bayanan tsaro bayan shigarwa.

sudo mysql_secure_installation

Yayin wannan aikin zai tambaye mu sanya kalmar sirri ga mai amfani da ita a cikin rumbun adana bayanan, da zarar anyi haka zamu ci gaba zuwa mataki na gaba.

Sannan dole ne mu latsa Shigar don amsa duk sauran tambayoyin, wanda zai cire mai amfani da ba a san shi ba, zai iya dakatar da tushen shiga kuma ya share bayanan gwajin.
Wannan matakin shine ainihin abin buƙata don tsaron bayanan MariaDB.

Ta hanyar tsoho, kunshin MaraiDB a cikin Ubuntu yana amfani da unix_socket don tabbatar da shigowar mai amfani, wanda hakan ke nufin cewa zaku iya amfani da sunan mai amfani da tsarin aiki don shiga cikin na'urar ta MariaDB.

Sanya PHP akan Ubuntu 17.10

7.1 php

En a halin yanzu yanayin tsayayyen PHP shine 7.1 Don haka idan kuna amfani da wannan koyawa zuwa juzu'i daga baya, wannan kawai kuna canza dogaro da fakiti waɗanda ake buƙata anan ta sigar su ta yanzu.
Don shigar da shi kawai dole ne mu aiwatar:

sudo apt install php7.1 libapache2-mod-php7.1 php7.1-mysql php-common php7.1-cli php7.1-common php7.1-json php7.1-opcache php7.1-readline

Yanzu dDole ne ku kunna tsarin Apache php7.1 sannan ku sake kunna sabar yanar gizo ta Apache.

sudo a2enmod php7.1
sudo systemctl restart apache2

Yanzu abin da za mu iya yi shi ne ƙirƙiri fayil wanda ke nuna mana duk bayanan PHTambaya, don gwada rubutun PHP tare da sabar Apache, muna buƙatar ƙirƙirar fayil na info.php a cikin kundin adireshin daftarin aiki.

sudo nano /var/www/html/info.php 

Codeara lambar PHP mai zuwa zuwa fayil ɗin.

<? php phpinfo (); ?>

Adana kuma ka rufe fayil ɗin.

Yanzu a cikin adireshin adireshin mai binciken, shigar da 127.0.0.1/info.php ko localhost / info.php .

Yakamata su ga bayanan PHP na sabarku. Wannan yana nufin cewa rubutun PHP zasu iya gudana cikin nasara tare da sabar yanar gizo ta Apache.

Dole ne kawai in tunatar da ku cewa adireshin da za ku yi aiki a koyaushe shi ne na "localhost" ko "127.0.0.1", wanda shine za ku sanya a cikin burauzar gidan yanar gizonku, daga can sai kawai ku sanya hanyar ayyukanku.

Kuma wannan kenan, tuni mun girka kayan aikin da ake buƙata don fara gudanar da aikace-aikacen yanar gizon mu akan kwamfutar mu.
Ba tare da bata lokaci ba, kawai zaka fara amfani da shi, zaka iya shigar da WordPress, Joomla ko wani kayan aiki don yin gwajin gida.


Bar tsokaci

Your email address ba za a buga. Bukata filayen suna alama da *

*

*

  1. Wanda ke da alhakin bayanan: Miguel Ángel Gatón
  2. Manufar bayanan: Sarrafa SPAM, sarrafa sharhi.
  3. Halacci: Yarda da yarda
  4. Sadarwar bayanan: Ba za a sanar da wasu bayanan ga wasu kamfanoni ba sai ta hanyar wajibcin doka.
  5. Ajiye bayanai: Bayanin yanar gizo wanda Occentus Networks (EU) suka dauki nauyi
  6. Hakkoki: A kowane lokaci zaka iyakance, dawo da share bayanan ka.

      Pablo m

    Kyakkyawan jagora, tsokaci kawai, a cikin umarnin: sudo chown www-data: www-data / var / www / html / -R, yakamata a cire fararen wurare, masu haɗari sosai; ya kamata ya kasance: sudo chown www-data: www-data / var / www / html / -R. Tare da sararin samaniya, kasancewa tushen, duk wanda ya aiwatar da shi, zai canza mai shi da rukunin tushen (/) da duk manyan fayilolin yara.

    Har ila yau a:; ba mai haɗari bane, kamar na baya, yakamata ya kasance:

         Nuhu m

      Sannu Pablo, nayi kuskuren kwafa da liƙawa don Allah idan kuna iya taimaka min daga wannan kuskuren

      sudo chown www-data: www-data /var/www/html/ -R

      Na kwafe shi tare da wurare kuma yanzu ba zan iya gudanar da duk wani aikace-aikacen da ba ni da shi ba kuma ba ya karɓar kalmar sirri don samun damar zama tushen

      ni sabuwa ce ga Linux.

      Alejandro Suarez m

    Barka dai aboki, na gode da gudummawar da kake bayarwa, kayi dukkan matakan cikin gamsuwa, abin kawai shine lokacin da ake tantancewa «localhost / info.php» shafin ya zama fanko kuma baya nuna komai, da fatan ba matsala.

         David yeshael m

      Hello Alejandro.
      Abu mafi aminci shine kuna da aikin da aka toshe a cikin php.ini ɗinku
      A ciki zaku iya saita sigogi da yawa, gwada akan tashar tare da
      php -ini

         asdasd m

      Sannu Alejandro, saboda saboda sarari ne tsakanin