

To allow your Apache server to process PHP files, you’ll need to install PHP5 and the PHP5 module for Apache. If you know HTML you can put your own HTML files and other assets in this directory and serve them as a website on your local network.

Try editing this file and refreshing the browser to see the web page change. Change the owner to your own user with sudo chown pi: index.html before editing. In order to edit the file, you must gain rootpermissions. The group which owns the file or directoryĪs you can see, by default the html directory and index.html file are both owned by the root user.The user which owns the file or directory.The number of files in the directory (or 1 if it’s a file).The permissions of the file or directory.refers to the directory itself /var/refers to the parent directory /www/. This shows that there is one file in /var/The.

rw -r -r - 1 root root 177 Jan 8 01 : 29 index. Navigate to this directory in the Terminal and have a look at what’s inside: cd /var/www/htmlĭrwxr -xr -x 2 root root 4096 Jan 8 01 : 29. It is located at /var/Note: The directory was /var/www in Raspbian Wheezy but is now /var/www/html in Raspbian Jessie This default web page is just a HTML file on the filesystem. This means you have Apache working! CHANGING THE DEFAULT WEB PAGE To find the Pi’s IP address, type hostname -I at the command line (or read more about finding your IP address).īrowse to the default web page either on the Pi or from another computer on the network and you should see the following: This default web page is served when you browse to on the Pi itself, or (whatever the Pi’s IP address is) from another computer on the network. INSTALL APACHEįirst install the apache2 package by typing the following command in to the Terminal: sudo apt -get install apache2 -y TEST THE WEB SERVERīy default, Apache puts a test HTML file in the web folder. On its own, Apache can serve HTML files over HTTP, and with additional modules can serve dynamic web pages using scripting languages such as PHP. Apache is a popular web server application you can install on the Raspberry Pi to allow it to serve web pages.
