Jacob Clark!

All Round Developer & Database Engineer.

<< Back to the blog

Installing Apache2 to your Raspberry Pi! (Debian)

by Bioshox on 05/27/2012

So if youre interested in creating a Web Server from your Raspberry Pi the first thing youre going to need is Apache, its fairly straightforward but there are a few issues if you go straight to sudo apt-get install apache2, here Ill show you how to do it properly to avoid these issues!

First of all to avoid typing sudo everytime we want to do a command type

Now youre going to need to know the IP of your Raspberry Pi so we can check the installation later on, you can do that by running this command:

Make a note of the Internal IP Addresses, it will be something similar to (which is mine).

The next stage is to create a user and group that Apache2 will require to start, if you dont create these, Apache will fail to start.

At this stage were going to need to update our repositories, without doing this Apache will fail to install. To update we need to use the command,

Now we can move on and actually install Apache2

Once you type this command a few operations will execute to lookup and get the package, youll then be asked if you wish to continue, at this stage hit y then return

Apache will then begin installing, once its complete you can enter the IP you noted down at the beginning in the address bar and you should see this page: (please note, this IP can change based on your network settings, I will release a tutorial on setting a static IP later on)

Your websites are then stored within the directory /var/www/

You can then use vi or nano to edit the It works! file.

You can find more information about the Raspberry Pi here: http://www.raspberrypi.org

or if youre interested in finding more information about Apache: http://apache.org/

If you need any further help, please leave me a comment and Ill try to help best I can, or let me know how you got on!

Check out the rest of the tutorils Ive written in this Raspberry Pi series!

Setting up SSH and FTP Raspberry Pi (Debian)

Setting up Apache2 on your Raspberry Pi (Debian)

Setting up PHP on your Raspberry Pi (Debian)

Setting up MySQL on your Raspberry Pi (Debian) 

Setting up phpMyAdmin on your Raspberry Pi (Debian)