Apache2 on RPi
From Miscellany
Install Apache2
- This is the most popular web server software in the world. First see if it is already installed:
- Open Terminal
- Enter:
sudo systemctl status apache2
- 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:
- Open Terminal
- Enter:
ls /etc/
- If apache2 is not listed, install it:
- Enter
sudo apt-get update
sudo apt-get install apache2
sudo apache2ctl start
Your Home Website
- First, try out your web browser
- Open a Web browser
- In the navigation window, enter "Localhost".
- The "Apache2 Debian Default Page" should be displayed.
- If not, review and repeat the installation steps.
Where Are My Webpages?
- Navigate to the html directory:
- 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".
- If you want to save this file for reference, rename it or copy it to another location.
- Create your new homepage and save it as index.html in the /var/www/html/ directory
- 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