How to install and configure Apache2 web server on Ubuntu

by Ismail.EL
0 comment


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.

2- Prerequisites:

  • Have administrative rights on the server.
  • Having a local network.
  • A configured DNS server

3- Installation:

to install the apache server on ubuntu just make an update on the system by typing the following command:

It requires a restart for it to work:

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.

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.

NameVirtualHost *:80
Listen 80
<IfModule mod_ssl.c>
# 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.
Listen 443
</IfModule>
<IfModule mod_gnutls.c>
Listen 443
</IfModule>

  • 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

4. Conclusion

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 🙂

20230cookie-checkHow to install and configure Apache2 web server on Ubuntu

Related Posts

Leave a Comment