How to host a Website at your home using Raspberry Pi




Before start installing the software, you need to make sure that you have your Hardware set up.

First of all, you need a raspberry pi with the ability to connect to the internet.

Make sure that everything is working properly, that you are connected to the local network and to the Internet.
Firstly, execute sudo apt-get upgrade and sudo apt-get update to get the latest updates.

Then you will have to install server software: sudo apt-get install apache2 –y

If you need your server to run php service run: sudo apt-get install php5 libapache2-mod-php5 to install php5 libraries on your raspberry.

Tip: Open /etc/apache2/httpd.conf and find the line DirectoryIndex index.html. Then change it to DirectoryIndex index.php index.html so the php file is loaded by default.

Restart raspberry pi or hit: sudo service apache2 restart to restart the server and let the changes take effect.

Find your device local ip running hostname –I and type it in your web browser.
If you see the PHP INFO site then your server is probably running without any problem.

The default directory of your server is /var/www/html.

P.S: you will need to change the permissions in the directory with: sudo chown “username”: “directory” so that you are able to edit files in the directory.

Leave a Reply

Your email address will not be published. Required fields are marked *