Sanya Rasberi Pi a matsayin sabar yanar gizo

yanar gizo servidor

Kwanakin baya kawai ina da bukatar nuna aikace-aikacen gidan yanar gizo da nake aiki da su ga wasu dangi domin su ba ni ra'ayinsu game da ci gaba su fada min, ko kuma su yi min jagora, inda zan ci gaba. Don yin wannan, gaskiyar ita ce ban so in sayi sarari daga kamfani, ko adireshin yanar gizo, ko wani abu makamancin haka ba. Da wannan a zuciyata, ni kadai 'ceto'Ya kamata in kafa sabar kaina da dan abin da nake da shi a gida kuma anan ne taimakon ya fara aiki Rasberi Pi.

Idan kun taɓa yin aikin haɓaka aikace-aikacen yanar gizo, tabbas zaku san waɗannan shirye-shiryen kyauta kamar su LAMP. Tabbas muna kuma da wasu nau'ikan don Windows, a wannan yanayin WAMP har ma da XAMP don sauran tsarin aiki.

Alamar Fitila

Yadda ake saita Rasberi Pi don iya amfani dashi azaman sabar yanar gizo.

Dangane da Rasberi Pi ɗinmu muna buƙatar shigar da fasalin LAMP domin ku iya karɓar bakuncin kowane irin aikace-aikacen yanar gizo, shafin yanar gizo ... ko duk abin da kuke buƙata. Don wannan, kafin ci gaba zaku buƙaci Rasbperry Pi, kamar yadda ake tsammani, a SD katin ƙwaƙwalwar ajiya 4 GB mafi ƙarancin damar, a adaftar wutar lantarki dace da MicroB mai haɗa Rasberi Pi, kebul mai haɗawa Ethernet, duba HDMI mai yarda da a HDMI na USB, a keyboard ko ma linzami duk da cewa wannan ba lallai bane.

Kafin ci gaba, abu na farko da zamuyi shine shirya Rasberi Pi. Idan baku taɓa yin hakan ba, gaya wa kanku cewa kuna buƙatar irin wannan taya daga katin SD wanda yakamata ya ƙunshi hoton diski na tsarin aiki da kake son gudanarwa.

Labari mai dangantaka:
Ayyuka 3 tare da RGB Led da Arduino

Optionaya daga cikin zaɓin wannan shine siyan katin SD wanda ya riga ya shirya don girka da taya ɗinmu Rasberi Pi ko barin shi fanko kwata-kwata kuma shigar da komai da kanmu. A takamaimata, Na zaɓi wannan zaɓin na ƙarshe. Don shirya katin muna buƙatar hoton tsarin aiki, na zaɓi Raspbian "Wheezy". Da zarar na sami ISO sai nayi amfani da shirin Hoton Win32.

Da zarar mun sami katin SD ɗinmu tare da duk abin da muke buƙata, kawai za mu saka shi a cikin Rasberi Pi kuma, kafin ma fara, girka dukkan kayan aikin da zamuyi amfani dasu, ma'ana, a haɗa allon, madanni ko linzamin kwamfuta idan kana son amfani da shi.

Lokacin da komai ya shirya, kawai muna kunna Rasbperry Pi ɗinmu kuma zamu ga yadda tsarin ya zayyana duk bayanan ta atomatik game da tsarin aiki da abubuwan da muka haɗa. Da zarar duk an gama wannan aikin za ku ga taga raspi-jeri inda dole ne kuyi canje-canje masu zuwa:

  • Faɗa tushen bangare sab thatda haka, za a iya amfani da duk sararin da ke kan katin SD.
  • Saita yankin lokaci.
  • Enable uwar garken SSH, wannan yana cikin Zaɓuɓɓuka na Ci gaba.
  • Kashe farawa a kan tebur, tunda duk jituwa za a yi ta daga tashar.
  • Aukaka Rasberi Pi, wannan zaɓi ana samunsa a cikin Babban Zaɓuɓɓuka.
  • Sake kunna Rasberi Pi, don kawai ya kamata mu rubuta Sudo sake yi.

Ana shirya haɗin SSH don haɗawa da nesa zuwa Rasberi Pi

Farawar Putty da taga sanyi

A wannan lokacin ya rage don farawa saita SSH. Wannan saboda haka zaku iya aiki tare da Rasberi Pi daga wata komfuta, ma'ana, zaku iya haɗuwa daga nesa da loda sabbin fayiloli ko canza tsarin.

Da zarar an saita Pip din Pi a cikin matakan da suka gabata, tsarin zai nemi sunan mai amfani da kalmar wucewa, saboda wannan shine karo na farko da muka fara shi, zai sami tsoffin masu amfani, idan baku canza su ba, zasu kasance pi kuma azaman kalmar shiga rasberi.

Labari mai dangantaka:
Kayan lantarki

A wannan lokacin dole ne kuyi la'akari da yadda Linux kanta take aiki tunda, kodayake kuna rubuta kalmar sirri, babu alamun kowane nau'in da aka nuna, kar ku damu tunda ana rubuta rubutun.

Kawai lokacin da muka shiga cikin tsarin dole ne mu rubuta:

ifconfig

Godiya ga wannan umarnin za mu iya sanin adireshin IP ɗin da mai kula da mu yake da shi. A cikin wadataccen kayan aiki zamu nemi layin "addet addr”Zamu iya samun lamba makamancin wannan: 192.168.1.1. Nace kwatankwacin haka tunda tabbas 1 na karshe lambobi daban daban. Wannan lambar a cikakke, dangane da misalin 192.168.1.1, dole ne mu kwafe shi tunda za mu buƙaci shi samun dama ta hanyar SSH daga wata kwamfutar.

A wannan lokacin dole ne mu zazzage abokin cinikin SSH, a halin da nake ciki na zaɓi Putty, sananne a kusan duk mahalli. Adireshin IP ɗin da muka kwafa yanzu zamu kwafa shi a ciki Putty a karkara "Sunan mai masauki (ko adireshin IP)”. A ƙasa kawai za a nemi sunan mai amfani da kalmar wucewa wanda zai kasance daidai da abin da muke amfani da shi don samun damar Rasberi Pi, wato, pi y rasberi.

Da zarar mun sami dama ga tsarin, ba mummunan ra'ayi bane canza kalmar sirri kuma a ƙarshe sabunta ɗaukacin tsarin. Don haka muna aiwatar da waɗannan umarnin ta latsa shiga bayan buga kowane ɗayan:

 

sudo passwd pi
sudo apt-get update
sudo apt-get upgrade

 

A ƙarshe mun sanya LAMP a cikin tsarin

Terminal tare da umarnin shigarwa na Apache

A ƙarshe mun isa ga shigar LAMP kuma don haka muke aiwatar da wannan umarnin:

sudo apt-get install apache2 php5 libapache2-mod-php5

Da zarar an zartar da umarnin, tsarin zai tambaye ku idan kuna son ci gaba, kawai kuna bugawa y kuma buga shiga don ci gaba. A matsayin cikakken bayani, gaya maka cewa wannan aikin shigarwa na iya ɗaukar minutesan mintuna. Idan kuna iya samun wasu nau'ikan kuskure yayin girkawa, a cikina akwai babu, gudanar da waɗannan umarnin:

sudo groupadd www-data
sudo usermod -g www-data www-data

kuma sake kunna Apache tare da umarnin:

sudo service apache2 restart

A matsayinka na karshe, dole ne ka je duk wata kwamfutar da kake da ita a gida, ka fara bincike sannan ka sanya a cikin adireshin adireshin IP na Rasberi Pi inda ya kamata ka ga wani allo da ke cewa Yana aiki!, wannan yana nufin cewa shigarwar tayi nasara kuma Apache yana sama da aiki.

Mai Binciken Sakon Nasarar Apache

Lokaci ya yi da za a shigar da bayanai

MySQL sanyi taga

Muna shigar da abin da ya wajaba don samun damar namu database

Don samun damar zuwa rumbun adana bayanan mu kawai zamu girka MySQL kuma don wannan muke aiwatar da umarni mai zuwa:

sudo apt-get install mysql-server mysql-client php5-mysql

Bugu da ƙari zai tambaye mu idan muna so mu ci gaba da shigarwa kuma don haka kawai za mu yi rajista y kuma buga shiga.

Mun sanya FTP akan Rasberi Pi

Tsarin fayil na vsftpd.conf

A wannan matakin za mu girka FTP don samun damar aika fayiloli daga kowace kwamfuta zuwa Rasberi Pi ɗinmu da kuma daga Rasberi Pi da kanta zuwa kwamfutar da muke buƙatar su. Wannan tsari ne mai sauƙi kamar aiwatar da commandsan umarni kamar:

sudo chown -R pi /var/www

Umurnin da zai biyo baya shine:

sudo apt-get install vsftpd

Da zarar dukkan aikin ya gama dole mu gyara fayil ɗin vsftpd.config kuma don haka kawai zamu rubuta:

sudo nano /etc/vsftpd.conf

Lokacin da editan fayil ya buɗe, dole ne mu canza layuka masu zuwa:

mara suna_haka = YES faruwa ya zama ba a san sunan ba = A'A

rashin damuwa local_enable = EE

rashin damuwa write_enable = IH

a wannan lokacin dole ne ka je ƙarshen fayil ɗin kuma ƙara force_dot_files = IH

A matsayin cikakken bayani, gaya maka cewa don rashin damuwa da layin da suka gabata dole kawai ka cire alamar # a gabansu. Da zarar an aiwatar da matakai na baya, latsa ctrl + X e y don adana duk bayanan da aka gyara. Abu na gaba shine sake kunna sabis na FTP tare da umarni mai zuwa:

sudo service vsftpd restart

Tare da waɗannan matakan sabar yanar gizonmu za ta riga ta fara aiki daidai don karɓar fayiloli daga aikace-aikacen gidan yanar gizonmu don samun damar duba su kai tsaye daga burauzar.


Abubuwan da ke cikin labarin suna bin ka'idodinmu na ka'idojin edita. Don yin rahoton kuskure danna a nan.

Sharhi, bar naka

Bar tsokaci

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

*

*

  1. Mai alhakin bayanan: Miguel Ángel Gatón
  2. Dalilin bayanan: Gudanar da SPAM, gudanar da 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.

  1.   Renzo m

    Labari mai kyau. Tambayi, yana da mahimmanci don sanya mai sanyaya don amfani dashi ta wannan hanyar? Tare da sanyaya mai wucewa hakan zai yi kyau?