Viewable With Any Browser

STATS

Todays date:
Saturday 12th of October 2024 08:08:02 PM

You are visitor

50758


Your IP address is 44.192.95.161


Page last updated
25 May 2017

installing a web server

Users     As we said on the previous pages, our intention was to use our Raspberry Pi as a low cost, low power web server.

We will install the apache web server to host our pages.


installing Apache

Login to the Pi console as user pi. Then type:

sudo apt-get install apache2

Allow that to install, then type:

ifconfig

Look for the first reference to 'inet addr:'

Make a note of the IP address. In our case this was '192.168.1.5'.

Type the IP address into the search bar of a web browser.

If all went well, you should see the Apache2 Debian Default Page.

php


We also use php to take care of some oth the backend coding on our pages.

sudo apt-get install php5

Then we create test.php to test if its all working so far.
sudo nano /var/www/html/test.php

Add the following three lines to the script:



CTRL + X to save

Go to a web browser and in the search bar, type:

IP_ADDRESS/test.php

You should see the php page.

We also need to add php-mysql for our hitcounters to work:

sudo apt-get install php5-mysql



That's as far as we have got so far. Our web server is back up.

We will stop working on this, and try to fix ou MQTT server, which was just about running when the server crashed.

>>next>>