Basic Settings


  • Find the list of ip and ports the apache web server is listening on
  • There is always one main .conf file, the rest of the conf file are add using Include directive.


  • Listen : The ip address and port that apache web server should be listening on
  • User and group account to be used
User apache
Group apache
  • ServerName : Trying to resolve the server name by ip addresss
  • ErrorLog : Name of the log file where error will be loged
ErrorLog /var/log/httpd/error.log
  • Include : include is use to include other conf files in the current httpd.conf file
Include conf.d/*.conf

Load all the conf files in the conf.d directory

  • IncludeOptional : Alternatively, the following command will just be ignored in case of missing files or directories:
IncludeOptional conf-enabled/*.conf
  • VirtualHost : The IP and port the apache server to listen to for itself
<VirtualHost *:80>

In the above example, it will listen to all the request on port 80

FQ Example of reverse proxy

<VirtualHost *:80>
        ProxyPass "/" "http://localhost:9090/"

Note : Modules porxy and proxy_http is required to run the proxy

Read Me :

To ensure that and Location: headers generated from the backend are modified to point to the reverse proxy, instead of back to itself, the ProxyPassReverse directive is most often required:

<VirtualHost *:80>
        ProxyPass "/" "http://localhost:9090/"
        ProxyPassReverse "/" "http://localhost:9090/"

Note : If it is a two way communication ProxyPassReverse is required

To restart the apache web server use below command :

sudo systemctl restart apache2

  • LoadModule
    • authz_host_module modules/
      Control access by IP address
    • dir_module module/
      Default page to be loaded

Note : There will always be folders called sites-available, sites-enabled, conf-available and conf-enabled, We put all the conf file always in the *-available folder and when we want that configuration file to take effect we create a symbolic link on that conf file in the *-enabled folder

Read Me:

Leave a Comment