How to install and configure Apache2 web server on Ubuntu
1- What is Apache?
Apache is an open-source web server application. it is the most commonly used Web Server on Linux systems. Web Servers are used to serve Web Pages requested by client computers. Clients typically request and view Web Pages using Web Browser applications such as Firefox, Opera, Chromium, or Mozilla.
- Have administrative rights on the server.
- Having a local network.
- A configured DNS server
to install the apache server on ubuntu just make an update on the system by typing the following command:
[user@localhost $] sudo apt-get update
[user@localhost $] sudo apt-get install apache2 apache2-doc apache2-utils
It requires a restart for it to work:
[user@localhost $] sudo /etc/init.d/apache2 restart
[user@localhost $] sudo service apache2 restart
You can do a spot check right away to verify that everything went as planned by visiting your server’s public IP address in your web browser : http://localhost or http://your_server_IP_address (if you use an ip address).
Move into the apache2 directory to view the files available.
[user@localhost $] cd /etc/apache2
[user@localhost :/etc/apache2 $] ls
apache2.conf conf.d envvars httpd.conf magic mods-available mods-enabled ports.conf sites-available sites-enabled
- apache2.conf : This file impacts all aspects of apache as it has implications for the all web server running including the default web server and any virtual servers.
- mods-available : The mods-available directory contains modules that could be loaded wit apache as they are installed on the system.
- mods-enabled : The modules that have been loaded with apache are listed in mods-enabled.
- ports.conf : This file contains the ports available for apache to listen on as you can see in a listing of the file.
# If you add NameVirtualHost *:443 here, you will also have to change
# the VirtualHost statement in /etc/apache2/sites-available/default-ssl
# to <VirtualHost *:443>
# Server Name Indication for SSL named virtual hosts is currently not
# supported by MSIE on Windows XP.
- sites-available : This directory contains sites that you could enable on your system. Actually there are two templates; default and default-ssl which allow you to use them as templates for setting up a site whether it used port 80 or port 443.
- sites-enabled : This is a directory which contains the sites that you have enabled, the domains are set up and the web servers are running.
to create your first web site click here : How To Set Up Apache Virtual Hosts
In this post, i have explained How to install and configure Apache2 web server on Ubuntu.
If you have any questions or feedback, feel free to leave a comment.
As always, if you found this post useful, then click like and share it 🙂