Previously I set up the Raspberry Pi with Berry Web Server, but today I wanted to see how the Pi would run with the more often used Apache, PHP, MySQL and WordPress. One of the podcasts that I watch frequently is Know How, on the TWiT network. A couple of weeks ago they had a show where they did just this. (A RAMP/LAMP server). I’ve included their show notes below – the original episode and notes are found via Know How!
- Download all the files that you’ll need for the project. (Formatting Tool & NOOBS) You’ll find all files at the Raspberrypi.org Download Page
- Extract the files to your desktop and copy ALL the contents of the extracted NOOBs folder onto the SD Card.
- Connect the Raspberry Pi.
- Install – You’ll get a screen that lets you select which distro you want installed on your Pi. Select “Raspbian” and then click “install”
- Click “OK” and the RasPi will reboot into the configuration tool.
- Change your Password – Using the arrow keys, choose option #2 and change the default password. (Your username will be “pi” and your password will be whatever value you choose.)
- Set Language and Time Zone – Scroll down to option #4 “Internationalisation Options” and set the Pi to your language and time zones.
- Select “Finish” then hit ENTER
* You’ll now see the Raspbian command prompt which should look like this: “pi@raspberrypi ~$_”
You now need to update the list of available packages, install Apache, MySQL, PHP5, PEAR, and phpMyAdmin, then set the Apache Configuration.
sudo apt-get update
sudo apt-get install apache2
sudo apt-get install mysql-server
* In the middle of the installation, you’ll be asked to change the root password for the MySQL database.
Install PHP5 & PEAR
sudo apt-get install php5 php-pear php5-mysql
sudo service apache2 restart
sudo apt-get install phpmyadmin
* It will ask you, halfway through the installation, which web server you want to use. Select Apache and then select “OK”
* It will also ask you to confirm that you want to use the MySQL database installation that you just completed. Give it the password that you selected and continue.
* Lastly, it will ask you what password you want to use for the phpMyAdmin page.
Set the Apache Configuration
sudo nano /etc/apache2/apache2.conf
Add the line:
Start the server
sudo service apache2 restart
Type: ifconfig and you’ll get a status screen that includes the “eth0″ IP address. Type that address into your browser and you should see the “It Works!” screen.
If you append “/phpmyadmin/” to the IP address, you’ll enter the phpMyAdmin page.
Add an FTP Server!
Take ownership of the web root by typing:
sudo chown –R pi /var/www
Install the vsftpd package by typing:
sudo apt-get install vsftpd
Edit the vsftpd configuration file by typing:
sudo nano /etc/vsftpd.conf
You need to make four changes to the configuration file:
– First, change “anonymous_enable=YES” to “anonymous_enable=No”
– Remove the comment, the pound sign, from “local_enable=YES” and “write_enable=YES”
– Go to the bottom of the file and add the line: “force_dot_files=YES”
Hit CTRL & X to save and exit.
Now start the FTP server by typing :
sudo service vsftpd restart
Finally, we’re going to create a FTP shortcut. Type:
ln –s(space) /var/www/ (space) ~www
Success It runs pretty well considering the low power!