Labels

Arduino (1) Brainf**k (1) Bugs (3) C (1) HTML (1) Install (3) Linux (27) Maths (1) Python (12) Raspberry Pi (4)

Sunday, 24 January 2016

Setting up a apache web server on linux

Apache is a standalone HTTP web server for linux. There are others like nginx but in my opinion apache is the easiest to configure and understand.

To install apache :
sudo apt-get install apache2

Once it's installed you have a web server running that can be accessed on your local network.
To check it's running go to your web browser and type 127.0.0.1 and it should come up with a default page.

To access it from other computers on the network we need to find out your local IP address which can be done with:
ifconfig wlan0 | grep "inet addr"

This will give you a output of
inet addr:192.168.0.18 Bcast:192.168.0.255 Mask:255.255.255.0
With your IP being inet addr:192.168.0.18

Now enter this ip on another device on your local network and it should come up with the same default homepage, if you want to set a static IP have a look at this post.