apache2
package with this command:http://localhost/
on the Pi itself, or http://192.168.1.10
(whatever the Pi's IP address is) from another computer on the network. To find the Pi's IP address, type hostname -I
at the command line (or read more about finding your IP address)./var/www/html/index.html
./var/www/html/
called index.html
and it is owned by the root
user (as is the enclosing folder). In order to edit the file, you need to change its ownership to your own username. Change the owner of the file (the default pi
user is assumed here) using sudo chown pi: index.html
.index.html
file:index.php
:.php
extension. PHP files are often saved within a folder in a web server's public directory (or a web root directory). On most systems this will either be named public
or public_html
. For example, if a file was saved as index.php
in a web root directory, a user could access it by typing http://www.example.org
or http://www.example.org/index.php
.index.php
just as you would use an index.html
file. However, make sure you know which one takes priority so you don't get unexpected results (usually index.php
).http://example.org
? When a user types in http://example.org
in a Web client (a browser, for instance), the client issues a GET
request to the server (let's assume that we are both using Apache). When Apache gets this request, it looks for a file named index.php
(or index.html
, remember the directory indexes from earlier?). If a file named index.php
is found, Apache essentially says 'Hey, this is a PHP file because it has the .php extension. I am going to give this to the PHP interpreter'.http://laravel.com/
. The following figure has circled numbers that will highlight the various stages of the request. A step-by-step explanation of each step follows the figure.