Cov txheej txheem:
- Kauj Ruam 1: ## Raspbian Duab ##
- Kauj ruam 2: ## Hloov kho Raspbian ##
- Kauj ruam 3: ## Nruab Apache2 ##
- Kauj ruam 4: ## Nruab PHP7 ##
- Kauj ruam 5: ## Nruab MySQL ##
- Kauj Ruam 6: ## Nruab PHPMyAdmin ##
- Kauj ruam 7: ## Teeb tsa FTP ##
Video: Txhim kho LAMP (Linux, Apache, MySQL, PHP) ntawm Raspberry Pi: 7 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:27
Teeb LAMP (Linux Rasbian Stretch Lite, Apache2, MySQL (MariaDB-10), PHP7) pawg nrog PHPMyAdmin thiab FTP nkag mus rau koj li Raspberry Pi thiab teeb tsa nws ua haujlwm li lub web server.
Koj yuav xav tau lub khoos phis tawj Raspberry Pi txuas nrog internet nrog 8GB (lossis ntau dua) MicroSD daim npav. Thaum xub thawj koj yuav tsum muaj peev xwm teeb tsa Raspi-teeb tsa nrog cov keyboard kom hloov pauv tus lej Raspbian tsis raug thiab pab kom SSH. Thaum Raspi-teeb tsa tau ua tiav koj yuav tsuas yog xav tau txuas ntawm SSH kev sib txuas.
Koj yuav tsum muaj peev xwm teeb tsa cov duab Rasbian rau MicroSD daim npav, koj yuav xav paub txog kev tuaj yeem SSH rau Raspberry Pi thiab tuaj yeem teeb tsa koj li SQL database siv PHPMyAdmin.
Qhov twg koj pom $, qhov no yog cov lus txib koj yuav tsum tau muab tshuaj txhuam/siv los teeb tsa thiab teeb tsa software.
Kauj Ruam 1: ## Raspbian Duab ##
Tsim Raspbian Stretch Lite duab rau MicroSD daim npav (> 8GB pom zoo)
Thaum RasPi tau pib nkag mus nrog Tus Neeg Siv Npe: pi Password: raspberry
ces
$ hostname -I
(Nco tseg IP chaw nyob, koj yuav xav tau qhov no rau SSH rau RasPi piv txwv li 192.168.0.100)
$ sudo raspi-teeb tsa
Qhov Xaiv 1 - 'Hloov Tus Neeg Siv Tus Password'> Ok> Nkag mus rau UNIX tus lej tshiab> Retype tus password tshiab> Ok
Kev Xaiv 5 - 'Kev Xaiv Ua Haujlwm'> 'P2 SSH'> Yog Tab rau 'Ua tiav'> Nkag mus
$ sudo rov pib dua
Kauj ruam 2: ## Hloov kho Raspbian ##
Tam sim no siv Putty txuas rau RPi siv tus IP chaw nyob los ntawm yav dhau los.log hauv nrog Username: pi & koj tus password
$ sudo apt hloov tshiab && sudo apt hloov tshiab -y
$ sudo rov pib dua
Kauj ruam 3: ## Nruab Apache2 ##
Ib zaug ntxiv siv Putty txuas rau RPi siv tus IP chaw nyob ua ntej.
nkag mus nrog Username: pi & koj tus password
$ sudo apt nruab apache2 -y
Thaum ua tiav txhim kho Apache2 qhib lub vev xaib ntawm tib lub Wi-nkaus network thiab sau tus IP chaw nyob ntawm RasPi. Yog Apache2 teeb tsa kom raug koj yuav pom nplooj ntawv uas hais tias 'Apache2 Debian Default Page' thiab 'Nws ua haujlwm!'.
$ sudo a2enmod rov sau dua
$ sudo systemctl rov pib dua apache2
$ sudo chown -R pi: www -data/var/www/html/
$ sudo chmod -R 770/var/www/html/
$ sudo nano /etc/apache2/apache2.conf
Nrhiav: (Koj tuaj yeem siv Ctrl & W nrhiav)
Cov npe/var/www/
Options Indexes FollowSymLinks AllowOverride Tsis muaj Yuav tsum tau txhua qhov tso cai /Cov npe
Hloov mus rau:
Cov npe/var/www/Options Indexes FollowSymLinks
AllowOverride Txhua
Yuav tsum tau txhua qhov kev tso cai
/Cov npe
Ctrl & O> Nkag mus> Ctrl & X
$ sudo kev pabcuam apache2 rov pib dua
Kauj ruam 4: ## Nruab PHP7 ##
$ sudo apt nruab php libapache2-mod-php -y
Xeem PHP
Koj yuav tsum xub tshem tawm cov ntawv "index.html" hauv cov npe "/var/www/html".
$ sudo rm /var/www/html/index.html
Tom qab ntawd tsim "index.php" cov ntaub ntawv hauv cov npe no, nrog kab lus hais kom ua no
$ echo ""> /var/www/html/index.php
Hloov kho lub vev xaib broswer ntawm tib lub Wi-nkaus network, tam sim no koj yuav tsum pom PHP cov ntaub ntawv nplooj ntawv.
Kauj ruam 5: ## Nruab MySQL ##
$ sudo apt nruab mysql-server php-mysql -y
$ sudo kev pabcuam apache2 rov pib dua
$ sudo mysql_secure_installation
Koj yuav raug nug kom nkag mus lo lus zais tam sim no rau lub hauv paus (lub neej ntawd tsis muaj dab tsi): nias Enter.
Teem tus password nkag mus, ntaus Y thiab nias Enter.
Ntaus tus password tshiab thiab nias Enter. Tseem ceeb: nco ntsoov lub hauv paus lo lus zais.
Rov nkag tus password tshiab thiab nias Enter.
Ntaus Y thiab nias Enter kom tshem tawm cov neeg siv tsis qhia npe.
Ntaus Y thiab nias Enter kom tsis pom lub hauv paus nkag mus deb.
Ntaus Y thiab nias Enter kom tshem tawm cov ntawv xeem thiab nkag mus rau nws.
Ntaus Y thiab nias Enter kom rov qab tau cov cai tshwj xeeb tam sim no.
Thaum ua tiav, koj yuav pom cov lus Tag nrho ua tiav! thiab Ua tsaug rau siv MariaDB !.
$ sudo mysql -uroot -p
Nkag mus rau lo lus zais hauv paus.
$ tsim database YOURDATABASENAME;
$ YOOJ YIM YOOJ YIM YOOJ YIM RAU KOJ DATABASENAME.* TO 'hauv paus'@'localhost' IDENTIFIED BY 'YOURROOTPASSWORD';
$ FLUSH PRIVILEGES;
Ctrl & D.
Kauj Ruam 6: ## Nruab PHPMyAdmin ##
$ sudo apt nruab phpmyadmin -y
Xaiv Apache2 nrog tus cursor thiab nias lub spacebar kom pom meej Apache2> Tab> Nkag mus.
Configure database rau phpmyadmin nrog dbconfig-ntau? Xaiv 'Tsis Yog'> Nkag mus, peb twb tau teeb tsa cov ntaub ntawv saum toj no nrog MySQL teeb tsa.
Txhawm rau nkag mus rau phpmyadmin siv tus IP chaw nyob ntawm RasPi xws li 192.168.0.100/phpmyadmin/ Username: hauv paus thiab YOURROOTPASSWORD
Kauj ruam 7: ## Teeb tsa FTP ##
$ sudo apt nruab vsftpd -y
$ sudo nano /etc/vsftpd.conf
Nrhiav: (Koj tuaj yeem siv Ctrl & W nrhiav)
local_enable = YOG
ssl_enable = NO
Hloov mus rau:
#local_enable = YOG
#ssl_enable = TSIS TAU
Ntxiv rau hauv qab ntawm cov ntawv:
# CUSTOMssl_enable = YES local_enable = YES chroot_local_user = YES local_root =/var/www user_sub_token = pi write_enable = YES local_umask = 002 allow_writeable_chroot = YES ftpd_banner = Zoo siab txais tos rau kuv qhov kev pabcuam Raspberry Pi FTP.
Ctrl & O> Nkag mus> Ctrl & X
$ sudo usermod -a -G www -data pi
$ sudo usermod -m -d /var /www pi
$ sudo chown -R www-data: www-data /var /www
$ sudo chmod -R 775 /var /www
$ sudo rov pib dua
Tam sim no cov txheej txheem tiav.
Pom zoo:
Kev Txhim Kho De La Carte TagTagTag Pour Nabaztag / Txhim Kho TagTagTag Board ntawm Koj Nabaztag: 15 Kauj Ruam
Kev Txhim Kho De La Carte TagTagTag Pour Nabaztag / Txhim Kho TagTagTag Board ntawm Koj Nabaztag: (saib hauv qab no rau lus Askiv version) La carte TagTagTag a été créée en 2018 lors de Maker Faire Paris pour faire renaitre les Nabaztag et les Nabaztag: tag. Elle a fait l'objet ensuite d'un nyiaj txiag kev koom tes nrog Ulule en juin 2019, si vous souhaitez
Txhim Kho Java Txhim Kho rau Raspberry Pi: 11 Kauj Ruam (nrog Duab)
Txhim Kho Java Txhim Kho rau Raspberry Pi: Cov Lus Qhia no piav qhia txog txoj hauv kev zoo rau kev txhim kho Java cov haujlwm rau Raspberry Pi. Kuv tau siv txoj hauv kev los txhim kho Java lub peev xwm xws li los ntawm kev txhawb nqa cov cuab yeej qis mus rau ntau txoj xov thiab cov phiaj xwm sib txuas hauv network. Qhov appr
Kev Txhim Kho De La Carte TagTagTag Pour Nabaztag: tag / Txhim Kho TagTagTag Board ntawm Koj Nabaztag: tag: 23 Kauj Ruam
Kev Txhim Kho De La Carte TagTagTag Pour Nabaztag: tag / Txhim Kho TagTagTag Pawg ntawm Koj Nabaztag: tag: (saib hauv qab no rau lus Askiv version) La carte TagTagTag a été créée en 2018 lors de Maker Faire Paris pour faire renaitre les Nabaztag et les Nabaztag: tag . Elle a fait l'objet ensuite d'un nyiaj txiag kev koom tes nrog Ulule en juin 2019, si vous souhaitez
10 Watt Endurance Laser Module Kev Txhim Kho Txhim Kho: 6 Cov Kauj Ruam
10 Watt Endurance Laser Module Kev Txhim Kho Txhim Kho: Kuv yuav 10 watt cov khoom siv laser. Kuv tau teeb tsa cov khoom siv laser thiab txuas nrog raws li cov lus qhia Thaum kuv tau kho lub laser volt thiab tam sim no kom muaj lub zog zoo laser thiab ua kom lub laser diode nyab xeeb ib yam li kuv tsis tuaj yeem tau txais ntau dua 3.7A@5VI
Yuav Ua Li Cas Txhim Kho Kev Txhim Kho Lub Vev Xaib ntawm Localhost: 6 Cov Kauj Ruam
Yuav Ua Li Cas Txhim Kho Kev Txhim Kho Lub Vev Xaib ntawm Localhost: Cov lus qhia no yog qhia koj yuav ua li cas rau nruab Apache, PHP, MySQL ntawm localhost. Kuj yuav teeb tsa nws li cas kom koj muaj qee lub network txias, xws li muaj peev xwm thauj lub hauv paus npe siv lub khoos phis tawj lub npe (http: //desktop/index.php), b