Enter username: phpmyadmin and the password that you used during the installation of phpMyAdmin: 192.168.1.223/phpmyadmin Setup SFTPīy default, the /var/www/ folder is owned by www-data and part of the www-data group, and user pi doesn’t belong to that group, so we need to add pi to the www-data group, then change user/group ownership of the /var/www/html folder recursively: sudo usermod -a -G www-data pi sudo chown -R www-data:www-data /var/www You should arrive at the phpMyAdmin login page. MySQL application password for phpmyadmin: – Enter a strong password, then TAB and ENTER, then confirm passwordĮnter your Pi’s IP address into your web browser address bar and append it with phpmyadmin then ENTER.Configure database for phpmyadmin with dbconfig-common? – Yes ( ENTER). Web server to reconfigure automatically: – apache2 (use SPACE BAR to select, TAB, then ENTER).PhpMyAdmin will ask several questions during installation. Let’s install the phpMyAdmin package so you can easily manage your MySQL databases: sudo apt-get install phpmyadmin -y Remove test database and access to it? – Y.Switch to unix_socket authentication – N.Enter current password for root (enter for none): – ENTER.I will now suggest answers to each question the script will ask you: Now we run the mysql_secure_installation security script to harden MySQL: sudo mysql_secure_installation Let’s install the MySQL server database software package: sudo apt-get install mariadb-server mariadb-client php-mysql -y It also indicates that PHP is functioning:Īfter you’ve finished with the info.php page, make sure to delete it so that nobody can see your servers sensitive information: sudo rm -rf /var/www/html/info.php Install MySQL Server You should see the PHP information page that shows the details of your PHP installation. Let’s make sure PHP is working by creating a special file called info.php with some code inside to tell us what extensions are enabled by default in PHP: sudo nano /var/192.168.1.223/info.php Let’s install the PHP programming language and the Apache PHP module: sudo apt-get install php libapache2-mod-php -y Now let’s enable the module and restart Apache: sudo a2enmod rewrite sudo systemctl restart apache2 Install PHP Then save ctrl + o, ENTER and exit nano ctrl + x. Scroll down to the section and change AllowOverride None to AllowOverride All: Let’s edit the Apache config file: sudo nano /etc/apache2/nf Most content management systems (like WordPress) need the Apache module mod_rewrite enabled (for things like pretty URLs). Use the ip address command to find the IP address of you RPi (It will be inside the eth0 section): Enable mod_rewrite If you don’t know your RPi’s IP address, use the ip address command to see it (it will be inside the eth0 interface section, see further below): You should see the default “It Works!” Apache welcome page. If you know your RPi’s IP address, enter it inside your web browser address bar. Let’s install Apache web server: sudo apt-get install apache2 -y It’s a good idea to reboot after upgrading any packages: sudo reboot Login to your Pi either directly or via SSH, then update your cache and upgrade any packages that need upgrading: sudo apt update & sudo apt upgrade -y Your Pi must have Raspberry Pi OS installed and configured (See my guide: How to install Raspberry Pi OS).You’ll need a RPi-3, RPi-4, RPi-400, with a minimum 8GB microSD card.PHP – A programming language to create dynamic “on the fly” web pages from templates and databases.MySQL – A popular database software distribution for storing almost any kind of data (i.e.Apache is the engine that serves pages to your web browser Apache – The most popular web server software in the world.Linux – In this case we’re using Ubuntu 22.04, but other popular OSes for LAMP stacks are Debian, Fedora and CentOS.Some more information about each package: You’ll be able to upload files using FTP, manage databases with phpMyAdmin, and I’ll show you how to optionally install WordPress, just for some fun. Today I’ll show you how to set up a LAMP ( Linux, Apache, MySQL, PHP) server on your Raspberry Pi.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |