Apache2 on RPi

From Miscellany
Revision as of 20:00, 16 January 2021 by Kat (talk | contribs) (Created page with "==Install Apache2== : This is the most popular web server software in the world. First see if it is already installed: # Open Terminal # Enter: <code>sudo systemctl status a...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Install Apache2

This is the most popular web server software in the world. First see if it is already installed:
  1. Open Terminal
  2. Enter:

sudo systemctl status apache2

  1. If the status is "active", you're done -- Apache is installed and running.
If the status is "not found", "not active" or words to that effect, proceed as follows:
See if Apache2 is installed:
  1. Open Terminal
  2. Enter:

ls /etc/

  1. If apache2 is not listed, install it:
  2. Enter

sudo apt-get update

sudo apt-get install apache2

sudo apache2ctl start

Your Home Website

First, try out your web browser
  1. Open a Web browser
  2. In the navigation window, enter "Localhost".
  3. The "Apache2 Debian Default Page" should be displayed.
  4. If not, review and repeat the installation steps.

Where Are My Webpages?

Navigate to the html directory:
  1. In Terminal, enter:

ls /var/www/html/

The only file in the /html directory should be index.html. This is the "Apache2 Debian Default Page".
  1. If you want to save this file for reference, rename it or copy it to another location.
  2. Create your new homepage and save it as index.html in the /var/www/html/ directory
  3. Add whatever other pages and sub-directories you want on your site in this directory.
You might find it useful to create a link to the html directory in your home directory.

Back to Raspberry Pi