Raspberry Pi: Web Server Setup (Apache, PHP, MySQL, PHPMyAdmin)

preview_player
Показать описание
In episode 4 of the Raspberry PI video series on this channel, I will show you how to turn your Raspberry Pi into a web server with Apache, PHP, MySQL, and PHPMyAdmin.

Interested in hosting an entire website on your Raspberry Pi? This is part one of the process.

--- Highlights ---
0:01:27 - Install Apache (HTTP Server)
0:01:38 - Install & Configure PHP (Coding Interface)
0:02:24 - Install & Configure MySQL (For Databases)
0:03:18 - Install & Configure PHPMyAdmin (Database Management)
0:04:58 - How to Access Web Server/Web Site on Raspberry Pi

--- Commands Used ---
Get Latest Packages: sudo apt-get update

Install Apache: sudo apt-get install apache2 -y
Install PHP: sudo apt install libapache2-mod-php
Change Dir to Public Html: cd /var/www
Grant ownership to pi user: sudo chown pi: html

Install MySQL: sudo apt install mariadb-server php-mysql -y
Create User Query: CREATE USER 'admin'@'localhost' IDENTIFIED BY 'password';
Grant User Permissions: GRANT ALL PRIVILEGES ON *.* to 'admin'@'localhost' WITH GRANT OPTION;

Install PHPMyAdmin: sudo apt-get install phpmyadmin

Restart ApacheService: sudo /etc/init.d/apache2 restart
Reboot Raspberry Pi: sudo reboot

#RaspberryPI
Рекомендации по теме
Комментарии
Автор

30 hours of losing my mind and then I found this video. It helped a lot and now I am online! Thank you!

bugreport
Автор

Awesome tutorial!! Very clear in your explanation and the editing to zoom in on your commands is super helpful :)

ethanspitips
Автор

Finally, someone made a video on this in 2021. Thanks so much!

jlambert
Автор

Thanks. I'd tripped up getting the db and phpmyadmin set up several times before but the steps here worked perfectly. Great job. New subscriber.

batchrocketproject
Автор

Thank you. This was almost painless lol. More helpful than anything else I found. I just couldn't see the debian index page but the phpadmin worked. Found out in a forum it was an permission issue. Followed his permission commands and viola...Works like a charm now. Thank you!

Swannie
Автор

Great the steps were flawless and it's easy to saved me a lot of time....

AmitAnand
Автор

You made very good job! Awesome ! Thank you for you time!👏

karbous
Автор

This is a very well explained tutorial, I was doing exactly the same a years ago and was a headache because the information was too old or the libraries name were changed.

FranciscoQuevedozorrogris
Автор

great and helpful video, waiting for the second part :D

juancarlossalazarvaca
Автор

Thanks for this. I finally got there but not without some problems.:

At 2:55 Creating User, you say "replace admin and password with the credentials you want to use"
When I did that, the user was not created. However if I replaced admin, and the quotes around it with the user name and removed the quotes around localhost (leaving the quotes around password) it did work.

At 4:38 "sudo /etc/init.d/apache2 restart" did successfully restart Apache but there was no [ ok ]
I wonder if this is a version difference

I hope this comment helps anyone who has the same problems.

eezees
Автор

sehr gut und sehr interessant = ) vielen Dank 👍👍👍

adamjaakik
Автор

Great Tutorial!! Thanks but I have a problem with the "sudo chown pi: html" command, it does not work and I don't know why because I did everything like in the tutorial. pls help

ElCalvoYT
Автор

Great tutorial! Good for newbies, Thank you so much sir

reygarenbalingit
Автор

hi, i did not managed to proced "sudo chown pi:html" . It says "chown missing operant afrer 'pi:htm;'. Can u help me ?

AhmadIrfan-ey
Автор

ET MERCI LE GOAT JE T'AIME C'EST EXACTEMENT LA VIDEO QU'IL ME FALLAIT

epraqx
Автор

hey question about this - how can i install PHP 8 with compatibility for PHPMyAdmin?

tailscape
Автор

Nice job mate :) waiting for the next one to finish my webserver. Probably other one about security? Own domain? SSL? ;)

andrescalapt_
Автор

Hello Arcade Spinner, Correction, it's when you do the "Sudo MYSQL" 2:47, that you're in the "Raspberrypi" and not the "Raspberrypi/var/www" whereas I stay in the "Raspberrypi/var/www" to the very end, does that matter?

dellsam
Автор

Hi,
For Mysql, when I tape CREATE USER ‘admin’@’localhost’ IDENTIFIED BY ‘mypassword’; it dosen't work, I updated mysql today and the error message is:
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '‘mypassword’' at line 1
What should I do?
Thanks.

By.ne__pala
Автор

Hello Arcade Spinner, <?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Main loader script
*
* @package PhpMyAdmin
*/
use just added some of the code that I'm getting after reloading the whole process again. I'm wondering if the Apache2 is not talking to the PHPMYADMIN, what do you think?

dellsam
visit shbcf.ru