![]() |
| Look, it's a web server! |
In the end, I realised this web-page was bit of overkill for what I wanted. So I just gave that a read for background purposes, and went with the explanation in the Raspberry Pi User Guide by Eben Upton & Gareth Halfacre.
LAMP
Firstly, I logged on and installed what's called a 'Lamp Stack'. Lamp stands for Linux, Apache, MySql, and PHP. Linux obviously provides the operating system and is already installed; Apache is the web server; MySQL is the database handler; and PHP is the language that gives life to your web-site.[In fact, xAMP stacks are apparently behind the majority of servers. There are also WAMPs which have Windows instead of Linux, and MAMPs that have the Mac OS]
I installed the LAMP using the following commands:
- sudo apt-get update
- sudo apt-get install apache2 php5 php5-mysql mysql-server
Along the way, MySQL asked me to set a password, then confirm it. I made sure it was secure i.e. Not easy to work out by visitors to my site.
Once the installation had completed, the MySQL and Apache servers were running.
Final Checks
To check that the server was up, I got my netbook out (which is part of my home network connected via a router) and typed the Pi's IP address into a web browser (I got the IP address using the 'ifconfig' command and found it listed in the 'eth0' section).This displayed the default web page. Nearly done.
Finally, I had to confirm PHP was working, so, still following the guidance in above manual, I used the following command to create a test script:
sudo sh -c 'echo "<?php phpinfo(); ?>" > /var/www/phptest.php'
This new file asks PHP to provide an information page when called. And I did that through the netbook again, tacking /phptest.php onto the end of the ip address.
This also worked. Job done!

No comments:
Post a Comment